Skip to main content
skill CX Codex

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

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add oimiragieo/agent-studio --skill context-compressor -a claude-code
Open on GitHub

What 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-code

2Manually: put the files in place

~/.claude/skills/context-compressor/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/context-compressor/

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.

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set8

Project sponsors

Companies that keep this analytics open