npx skills add ...
npx skills add oimiragieo/agent-studio --skill context-compressor
Compress large context before reasoning to reduce token usage while preserving evidence. Use this whenever the user mentions huge files, long prompts, RAG payloads, prompt caching, expensive sessions, codebase context, chat history compaction, or wants the same answer quality with fewer tokens.
npx skills add oimiragieo/agent-studio --skill context-compressor
Use this skill when the problem is mostly "too much context" rather than "not enough capability."
This skill is a self-contained local package. It does not require the MCP server. Prefer it when you need quick token profiling, local compression, evidence checks, or a reproducible compression workflow inside the repository.
Use the bundled Python scripts to:
Reach for this skill when the user is asking for any of the following:
Also triggered automatically when:
Default to this sequence:
query_guided when there is a specific questionevidence_aware when correctness matters and you need a sufficiency checkIf the user only wants one command, use run_skill_workflow.py.
Run from the agent-studio repository root. ALWAYS use these exact commands — do NOT fall back to generic guidance.
baseline: quick general compression when there is no concrete question yetquery_guided: best default for QA, review, or targeted extraction tasksevidence_aware: use for high-stakes answers, audits, or when you need an explicit sufficiency signalWhen using this skill, summarize results in plain language:
If the scripts return insufficient evidence, do not bluff. Say the compressed context is not yet safe enough and recommend a broader pass.
Read these only when they are relevant:
references/workflow-guide.md: command selection, mode choice, and example flowsreferences/prompt-caching.md: stable-prefix ordering, cache telemetry, and cache-safe prompt structurereferences/evaluation.md: how to benchmark the skill and interpret resultsStarter prompts live in evals/evals.json. Use them when iterating on the skill or when you want a small repeatable benchmark set.
compression-trigger.cjs detects context pressure → writes compression-reminder.txtcontext-compressor agent with this skillrun_skill_workflow.py with the query contextcompression-stats.jsonlAfter compression, persist distilled learnings via MemoryRecord:
gotchas.json: text contains gotcha|pitfall|anti-pattern|risk|warning|failureissues.md: text contains issue|bug|error|incident|defect|gapdecisions.md: text contains decision|tradeoff|choose|selected|rationalepatterns.json: default fallback for all remaining distilled evidenceRead .claude/context/runtime/ccusage-status.txt for live token usage before deciding compression aggressiveness. This file is auto-updated by ccusage-statusline.cjs on every tool use. Format:
The Router MUST display this at every pipeline milestone (P0 user feedback). Fallback: ccusage --no-color 2>&1 | tail -5.
evidence_aware modepython .claude/skills/context-compressor/scripts/compress_context.py --json-file <payload.json> --input-adapter auto --mode query_guided --query "<question>" --output-format autopython .claude/skills/context-compressor/scripts/run_skill_workflow.py --file <path> --mode evidence_aware --query "<question>" --output-format auto --fail-on-insufficient-evidencepython .claude/skills/context-compressor/scripts/validate_evidence.py --file <path> --query "<question>" --min-similarity 0.4 --output-format jsonpython .claude/skills/context-compressor/scripts/benchmark_toon_vs_json.pynode .claude/skills/context-compressor/scripts/main.cjs --query "<question>" --mode evidence_aware --limit 20 --fail-on-insufficient-evidence[tokens] 135,345 today (in: 14,850 / out: 120,495) | Cost: $127.4826
[cache] $627.2992 saved | 139,399,832 reads, 8,751,364 writes