Skip to content
Skills Library
AI & agents · Automation

context-compress

/context-compress

Use context-compress tools (execute, execute_file) instead of Bash/cat when processing large outputs. Trigger phrases: "analyze logs", "summarize output", "process data", "parse JSON", "filter results", "extract errors", "check build output", "analyze dependencies", "process API response", "large file analysis", "extract elements", "page snapshot", "browser snapshot", "take a snapshot", "DOM structure", "inspect page", "form fields", "element selectors", "web page structure", "accessibility tree", "Playwright snapshot", "run tests", "test output", "coverage report", "git log", "recent commits"

Licence
MIT
Last repository change
12.09.2026

Assessment and security

87/ 100Class: good
Format20 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability17 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
1
Deprecation

No signals detected. Repository changed on 12.09.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Use context-compress tools (execute, execute_file) instead of Bash/cat when processing large outputs. Trigger phrases: "analyze logs", "summarize output", "process data", "parse JSON", "filter results", "extract errors", "check build output", "analyze dependencies", "process API response", "large file analysis", "extract elements", "page snapshot", "browser snapshot", "take a snapshot", "DOM structure", "inspect page", "form fields", "element selectors", "web page structure", "accessibility tree", "Playwright snapshot", "run tests", "test output", "coverage report", "git log", "recent commits"

Triggers from the description

analyze logssummarize outputprocess dataparse JSONfilter resultsextract errorscheck build outputanalyze dependencies
Original author description

Use context-compress tools (execute, execute_file) instead of Bash/cat when processing large outputs. Trigger phrases: "analyze logs", "summarize output", "process data", "parse JSON", "filter results", "extract errors", "check build output", "analyze dependencies", "process API response", "large file analysis", "extract elements", "page snapshot", "browser snapshot", "take a snapshot", "DOM structure", "inspect page", "form fields", "element selectors", "web page structure", "accessibility tree", "Playwright snapshot", "run tests", "test output", "coverage report", "git log", "recent commits"

How it works

  1. MANDATORY RULE
  2. Decision Tree
  3. When to Use Each Tool
  4. Language Selection
  5. Search Query Strategy
  6. Critical Rules
  7. Subagent Usage
  8. Anti-Patterns
Original SKILL.md headings · 99 lines, 686 words
SKILL.md preview
---
name: context-compress
description: |
  Use context-compress tools (execute, execute_file) instead of Bash/cat when processing
  large outputs. Trigger phrases: "analyze logs", "summarize output", "process data",
  "parse JSON", "filter results", "extract errors", "check build output",
  "analyze dependencies", "process API response", "large file analysis",
  "extract elements", "page snapshot", "browser snapshot", "take a snapshot",
  "DOM structure", "inspect page", "form fields", "element selectors",
  "web page structure", "accessibility tree", "Playwright snapshot",
  "run tests", "test output", "coverage report", "git log", "recent commits",
  "diff between branches", "list containers", "pod status", "disk usage",
  "fetch docs", "API reference", "index documentation", "hit endpoint",
  "call API", "check response", "query results", "show tables",
  "find TODOs", "count lines", "codebase statistics", "security audit",
  "outdated packages", "dependency tree", "cloud resources", "CI/CD output".
  Also triggers on ANY MCP tool output (Playwright, Context7, GitHub API) that
  may exceed 20 lines, and any operation where output size is uncertain.
  Subagent routing is handled automatically via PreToolUse hook — no manual tool names needed in prompts.
---

# Context Compress: Default for All Large Output

## MANDATORY RULE

**Default to context-compress for ALL commands. Only use Bash for guaranteed-small-output operations.**

Bash whitelist (safe to run directly):
- **File mutations**: `mkdir`, `mv`, `cp`, `rm`, `touch`, `chmod`
- **Git writes**: `git add`, `git commit`, `git push`, `git checkout`, `git branch`, `git merge`
- **Navigation**: `cd`, `pwd`, `which`
- **Process control**: `kill`, `pkill`
- **Package management**: `npm install`, `npm publish`, `pip install`
- **Simple output**: `echo`, `printf`

**Everything 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.

## Decision Tree

```
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)
```

## When to Use Each Tool

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

## Language Selection

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

## Search Query Strategy

- BM25 uses **OR semantics** — results matching more terms rank higher automatically
- Use 2-4 specific technical terms per query
- **Always use `source` parameter** when multiple docs are indexed
- **Always use `queries` array** — batch ALL search questions in ONE call:
  - `search(queries: ["transform pipe", "refine superRefine"], source: "Zod")`
  - NEVER make multiple separate search() calls

## Critical Rules

1. **Always console.log/print your findings.** stdout is all that enters context.
2. **Write analysis code, not just data dumps.** Analyze first, print findings.
3. **Be specific in output.** Print bug details with IDs, line numbers, exact values.
4. **For files you need to EDIT**: Use the normal Read tool.
5. **For Bash whitelist commands only**: Use Bash. Everything else → context-compress.
6. **Never use `index(content: large_data)`.** Use `index(path: ...)` to read files server-side.
7. **Always use `filename` parameter** on Playwright tools.

## Subagent Usage

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.

## Anti-Patterns

- Using `curl` via Bash → Use `execute` with fetch or `fetch_and_index`
- Using `cat large-file` → Use `execute_file` instead
- Piping Bash output through `| head -20` → Use `execute` to analyze ALL data
- Running `npm test` via Bash → Use `execute` to capture and summarize
- Calling `browser_snapshot()` WITHOUT `filename` → Always use `filename` parameter
- Passing large data to `index(content: ...)` → Always use `index(path: ...)`

Versions

The database has no other skills named context-compress.

Database snapshot: 13.11.2026 · package version 0b71dab5e513 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 2 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100context-mode
    Use context-mode tools (ctx_execute, ctx_execute_file) instead of Bash/cat when processing large outputs. Triggers: "analyze logs", "summarize output", "process data", "parse JSON", "filter results", "extract errors", "check build output", "analyze dependencies", "process API…
  • 100context-mode
    Use context-mode tools (ctx_execute, ctx_execute_file) instead of Bash/cat when processing large outputs. Triggers: "analyze logs", "summarize output", "process data", "parse JSON", "filter results", "extract errors", "check build output", "analyze dependencies", "process API…
  • 100context-compress-audit
    Audit 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…
  • 90supercompress
    Always-on context compression for coding agents. Use whenever tool output, file reads, logs, diffs, search results, or pasted docs get large (~2K+ tokens): compress them with compress_context, never the user's request. Also check rate-limit runway before large work.
  • 100headroom
    Use when a Python or TypeScript app sends large tool outputs, logs, JSON, search results or long chat history to an LLM and the task is to cut input tokens, reduce token cost, fit a context window, or trim tool results without losing errors. Adds the headroom-ai compress() call;…
  • 100supercompress
    Always-on context compression for coding agents. Use whenever tool output, file reads, logs, diffs, search results, or pasted docs get large (~2K+ tokens): compress them with compress_context, never the user's request. Also check rate-limit runway before large work.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.