| name | context-compressor |
| description | Context compression and summarization methodology. Techniques for reducing token usage while preserving decision-critical information. |
| version | 1 |
| model | sonnet |
| invoked_by | both |
| user_invocable | true |
| tools | ["Read","Write"] |
| best_practices | ["Preserve decision-critical information","Remove redundant content","Use structured formats","Maintain traceability"] |
| error_handling | graceful |
| streaming | supported |
Context Compressor Skill
Context Compressor Skill - Techniques for reducing token usage while preserving decision-critical information. Helps agents work efficiently within context limits.
- Compressing conversation history
- Summarizing code and documentation
- Extracting key decisions and context
- Creating efficient memory snapshots
- Reducing redundancy in context
Step 1: Identify Compressible Content
Content types that can be compressed:
| Type | Compression Strategy |
|---|
| Code | Keep signatures, summarize implementations |
| Conversations | Extract decisions, drop small talk |
| Documentation | Keep headings and key points |
| Errors | Keep message and location, drop stack frames |
| Logs | Keep patterns, drop repetitions |
Step 2: Apply Compression Techniques
Technique 1: Decision Extraction
Before:
User: Should we use Redis or Memcached?
Assistant: Let me analyze both options...
[500 words of analysis]
Recommendation: Redis for pub/sub support.
User: Ok let's use Redis.
After:
Decision: Use Redis (chosen for pub/sub support)
Technique 2: Code Summarization
Before:
After:
UserService: CRUD operations for users
- Methods: create, read, update, delete, findByEmail
- Dependencies: db, validator, logger
- Location: src/services/user.js
Technique 3: Error Compression
Before:
Error: Cannot read property 'id' of undefined
at UserController.getUser (src/controllers/user.js:45:23)
at Layer.handle [as handle_request] (node_modules/express/lib/router/layer.js:95:5)
... 20 more stack frames
After:
Error: Cannot read 'id' of undefined @ src/controllers/user.js:45
Cause: User object is null when accessing .id
Step 3: Structure Compressed Output
Use consistent formats:
## Session Summary
### Decisions Made
- [D1] Use Redis for caching
[D2] JWT for authentication
src/auth/jwt.js (new)
src/config/redis.js (updated)
[ ] Add rate limiting
[ ] Write tests for JWT
**Compression Request**: