context-compressor — Claude Code skill: shrink context
context-compressor compresses large text files, chat histories, and RAG payloads before sending to the model while preserving evidence for correct answers. Reduces token spend when context balloons.
no license 274 installs ★ 45 updated 2026-07-14
npx skills add oimiragieo/agent-studio --skill context-compressor -a claude-codeWhat context-compressor does
This skill bundles Python scripts for local token profiling and context compression without uploading to a server. Three modes: baseline for quick general compression, query_guided to extract text relevant to a specific question, and evidence_aware to verify that compressed output still contains the facts needed to answer safely.
Works with text files, JSON payloads from RAG systems, and multi-turn histories. Scripts measure token savings before and after. A Node.js wrapper integrates the skill into other agents. Requires Python 3.10+.
What it helps with
- measure token cost in a large file before sending it
- compact chat history while keeping recent turns intact
- prepare RAG payload for caching with a stable prefix
- check whether compressed context retains enough evidence to answer correctly
- cut session cost when context grows expensive
Example prompts for the agent
- Compress this log file and keep only errors and surrounding context
- Show me how many tokens I save if I compress this RAG data for the question about Kubernetes deployment
- Verify the compressed code still has enough info to locate the bug described in the issue
How to install context-compressor
1Skills CLI (Vercel)
npx skills add oimiragieo/agent-studio --skill context-compressor -a claude-code2Manually: put the files in place
~/.claude/skills/context-compressor/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/context-compressor/
1Skills CLI (Vercel)
npx skills add oimiragieo/agent-studio --skill context-compressor -a codex2Manually: put the files in place
.agents/skills/context-compressor/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add oimiragieo/agent-studio --skill context-compressor -a cursor2Manually: put the files in place
.cursor/skills/context-compressor/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install oimiragieo/agent-studio .claude/skills/context-compressor2Manually: put the files in place
.github/skills/context-compressor/SKILL.md1Skills CLI (Vercel)
npx skills add oimiragieo/agent-studio --skill context-compressor -a gemini-cli2Platform CLI
gemini skills install https://github.com/oimiragieo/agent-studio --path .claude/skills/context-compressorManually: put the files in place
.devin/skills/context-compressor/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add oimiragieo/agent-studio --skill context-compressor -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about context-compressor
How do I install context-compressor for Claude Code?
Run npx skills add oimiragieo/agent-studio --skill context-compressor -a claude-code, then open ~/.claude/skills/context-compressor/SKILL.md.
What does context-compressor do?
It shrinks large text and JSON, calculates token savings, and verifies enough information remains to answer a specific question correctly.
Should I use baseline mode or evidence_aware?
Baseline is fast but ignores your question. Use query_guided or evidence_aware when accuracy matters; evidence_aware also validates that supporting facts remain in the compressed output.