version: 1.0.0 name: token-compressor description: Deterministically compresses long logs/text into high-signal excerpts to free context window. allowed-tools: Read, Bash, Grep tags: token, compression
Token Compressor
This skill reduces token overhead by compressing bulky inputs (logs, stack traces, long docs) while preserving evidence.
When to Use
- The user pastes long logs.
- Tool output is huge.
- A file is too large to read fully.
Compression Rules (Deterministic)
Apply these tactics in order:
-
Keep evidence lines
- Always keep lines matching:
error,exception,traceback,fail,warning,fatal.
- Always keep lines matching:
-
Keep structure
- Keep the first N lines (header/context) and last M lines (final error).
-
Deduplicate noise
- Collapse repeated consecutive lines.
- Collapse repeated blocks (same line repeated many times).
-
Summarize the rest
- Replace large omitted blocks with a short note:
(… 3,421 lines omitted …).
- Replace large omitted blocks with a short note:
Tooling
If available, use the bundled compressor script:
python3 ~/.ai-context/skills/token-compressor/scripts/compress_text.py --help
Output Format
## Compressed Context
- Source: …
- Original: X lines
- Kept: Y lines
- Notes: …
```text
…compressed excerpt…
## Anti-Patterns
- Removing the exact error line.
- Keeping only a summary with no evidence.
- Dumping the entire log into the reasoning window.
Related skills
Task Prioritizer
Productivity
Prioritizes your tasks using Eisenhower, ICE, and RICE frameworks.
claudechatgptbeginner
241
67
719
Weekly Status Report Generator
Productivity
Generate structured and concise weekly status reports.
Claude CodeCursorWindsurf+1beginner
234
78
746
Daily Standup Report
Productivity
Generates structured and concise daily standup reports.
claudeCursorWindsurfbeginner
178
45
583