/context-compress:context-compressfrom context-compress
Routes large-output commands through context-compress tools instead of Bash/cat to save context window. Covers logs, test output, API responses, git diffs, MCP tool output, and any operation exceeding ~20 lines.
Ships in context-compress. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Default to context-compress for ALL commands. Only use Bash for guaranteed-small-output operations.
Bash whitelist (safe to run directly):
mkdir, mv, cp, rm, touch, chmodgit add, git commit, git push, git checkout, git branch, git mergecd, pwd, whichkill, pkillnpm install, npm publish, pip installecho, printfEverything else → execute or execute_file. Any command that reads, queries, fetches, lists, logs, tests, builds, diffs, inspects, or calls an external service.
When uncertain, use context-compress. Every KB of unnecessary context reduces the quality and speed of the entire session.
About to run a command / read a file / call an API?
│
├── Command is on the Bash whitelist?
│ └── Use Bash
│
├── Output MIGHT be large or you're UNSURE?
│ └── Use context-compress execute or execute_file
│
├── Fetching web documentation or HTML page?
│ └── Use fetch_and_index → search
│
├── Using Playwright (navigate, snapshot, console, network)?
│ └── ALWAYS use filename parameter to save to file, then:
│ browser_snapshot(filename) → index(path) or execute_file(path)
│
├── Processing output from another MCP tool?
│ ├── Output already in context? → Use it directly
│ ├── Need to search multiple times? → Save to file → index(path) → search
│ └── One-shot extraction? → Save to file → execute_file(path)
│
└── Reading a file to analyze/summarize (not edit)?
└── Use execute_file (file loads into FILE_CONTENT, not context)
| Situation | Tool | Example |
|---|---|---|
| Hit an API endpoint | execute | fetch('http://localhost:3000/api/orders') |
| Run CLI that returns data | execute | gh pr list, aws s3 ls, kubectl get pods |
| Run tests | execute | npm test, pytest, go test ./... |
| Git operations | execute | git log --oneline -50, git diff HEAD~5 |
| Read a log file | execute_file | Parse access.log, error.log, build output |
| Read a data file | execute_file | Analyze CSV, JSON, YAML, XML |
| Fetch web docs | fetch_and_index | Index React/Next.js/Zod docs, then search |
| Situation | Language | Why |
|---|---|---|
| HTTP/API calls, JSON | javascript | Native fetch, JSON.parse, async/await |
| Data analysis, CSV, stats | python | csv, statistics, collections, re |
| Shell commands with pipes | shell | grep, awk, jq, native tools |
| File pattern matching | shell | find, wc, sort, uniq |
source parameter when multiple docs are indexedqueries array — batch ALL search questions in ONE call:
search(queries: ["transform pipe", "refine superRefine"], source: "Zod")index(content: large_data). Use index(path: ...) to read files server-side.filename parameter on Playwright tools.Subagents automatically receive context-compress tool routing via a PreToolUse hook. You do NOT need to manually add tool names to subagent prompts — the hook injects them.
curl via Bash → Use execute with fetch or fetch_and_indexcat large-file → Use execute_file instead| head -20 → Use execute to analyze ALL datanpm test via Bash → Use execute to capture and summarizebrowser_snapshot() WITHOUT filename → Always use filename parameterindex(content: ...) → Always use index(path: ...)What SKILL.md sets; muted values are Claude Code's defaults
4 skills in this plugin
/context-compress-auditAudit a repository, plugin setup, or agent session for raw Bash, Read, WebFetch, and MCP outputs that should be routed through context-compress instead. Use when asked to find context waste, raw tool output waste, missing plugin routing, or places where large command/file/web output still enters the agent context window./doctorcontext-compress:doctorRun diagnostics to check context-compress health/statscontext-compress:statsShow session statistics for context-compressnpx claudepluginhub open330/context-compress --plugin context-compressOther plugins' skills for the same job