context-crusher
Compress tool outputs, logs, and JSON before they enter the context window — structural compression via a deterministic stdlib script (schema + samples + stats instead of 300 raw rows), no API, no summarization loss. Use when asked shrink this tool output, my context is full of JSON, compress these logs before analysis, or stop wasting tokens on raw data. Produces the crushed artifact with its token math shown, the crush-or-keep decision rules, and the fetch-the-original escape hatch.
npx skills add mohitagw15856/pm-claude-skills --skill context-crusher --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Context Crusher Skill The most expensive tokens in agent work are the ones nobody reads: 300 identical JSON rows when the schema plus three samples would do, a log where one error hides among four hundred heartbeats, a file pasted whole for one relevant section. This skill crushes those *structurally* — schema + head/tail samples + numeric stats for JSON arrays, dedupe-with-counts plus guaranteed error-line survival for logs, head/tail windowing for text — with a deterministic stdlib script, no model call, no summarization risk. The information that defines meaning survives; the repetition that defines cost doesn't. ## What This Skill Produces - **The crushed artifact** — the compressed version, with its token math in the header (~6,000 → ~130 is typical for uniform JSON) - **The crush decision** — what to crush, what to keep raw, and what to *link instead of load* - **The escape hatch** — every crush names how to fetch the original when a detail turns out to matter - **The pipeline habit** — where in the agent's workflow the crush step belongs (between tool and context, always) ## Required Inputs Ask for these if not provided: - **The payload** — the JSON/log/text (or its path),
- What This Skill Produces
- Required Inputs
- Programmatic Helper
- Framework: The Crush Rules
- Output Format
- Quality Checks
- Anti-Patterns
- Based On
python3 scripts/context_crush.py --mode json --file response.json python3 scripts/context_crush.py --mode log --file build.log --keep 40 cat data.json | python3 scripts/context_crush.py --mode json
What does the context-crusher skill do?
Compress tool outputs, logs, and JSON before they enter the context window — structural compression via a deterministic stdlib script (schema + samples + stats instead of 300 raw rows), no API, no summarization loss. Use when asked shrink this tool output, my context is full of JSON, compress these logs before analysis, or stop wasting tokens on raw data. Produces the crushed artifact with its token math shown, the crush-or-keep decision rules, and the fetch-the-original escape hatch.
How do I install it?
Run `npx skills add mohitagw15856/pm-claude-skills --skill context-crusher --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From mohitagw15856/pm-claude-skills, a repository with 1,255 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
