From pm-tokens
Compresses tool outputs, logs, and JSON structurally (schema+samples+stats) to save context tokens. Use when raw data fills the window.
How this skill is triggered — by the user, by Claude, or both
Slash command
/pm-tokens:context-crusherThe summary Claude sees in its skill listing — used to decide when to auto-load this 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...
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.
Ask for these if not provided:
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
Deterministic, stdlib-only, no API. JSON arrays → {count, schema, head samples, tail, numeric min/max/mean} · logs → consecutive-duplicate collapse + first-occurrence dedupe + an always-preserved error/warning section · text → whitespace normalization + head/tail window with an elision marker. Inputs too small to gain are returned unchanged with an honest header.
tool | crush | context), not in cleanup. Retroactive crushing saves nothing already paid for.[The crushed artifact, script header included]
Kept raw: [what wasn't crushed and why] · Original: [where it lives, how to fetch] Pipeline note: [where the crush step now sits in this workflow]
The context-compression layer pattern — structural compression of tool outputs before the LLM (as in Headroom) — rebuilt here as a keyless, deterministic, stdlib skill.
npx claudepluginhub mohitagw15856/pm-claude-skills --plugin pm-tokensSaves context tokens by compressing repetitive JSON array outputs (logs, scans, events) – keeps an informative sample and caches the rest for retrieval. Includes an automatic hook for bash output.
Compresses tool outputs, transcripts, and accumulated context in-place to save tokens; lossy compression stores originals for later retrieval via slm_retrieve.
Optimizes long contexts by extracting key info with H2O heavy-hitters, compressing documents, summarizing files, and pruning stale tool results. Use for context overflow, large docs, or multi-file synthesis.