context-compressor
Skill7 starsChanged 42 days agoMITView on GitHub
Compress long conversation histories, large code files, research results, and documents by 70% without losing critical information. Triggers when context window fills up, when summarizing previous steps in multi-step tasks, before loading large files into context, or on 'summarize', 'compress', 'reduce context', 'save tokens'.
5 other projects use a version of this.
Adopted by
Most recently taken up by
- zedarvates/frugal-skillstheir own version, first seen Nov 8, 2026
- lihao-24/claude-skillstheir own version, first seen Oct 25, 2026
- toonight/get-shit-done-for-antigravitytheir own version, first seen Oct 8, 2026
- cyfung1031/skillstheir own version, first seen Jun 17, 2026
- PengEjeen/claude_skillstheir own version, first seen May 22, 2026
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- toonight/get-shit-done-for-antigravity★ 952same name
- cyfung1031/skills★ 2same name
- zedarvates/frugal-skills★ 1same name
- lihao-24/claude-skills★ 0same name
- PengEjeen/claude_skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository83 other files it gives its agents.
- AGENTS.mdAGENTS.md
- accessibility-enforcerSkill
- access-policy-designerSkill
- adaptive-guardSkill
- agent-reviewerSkill
- anti-ai-slop-designSkill
- api-mock-designerSkill
- api-observability-plannerSkill
- app-store-reviewerSkill
- ask-first-act-laterSkill
- assumption-checkerSkill
- auth-flow-designerSkill
- b2b-founder-roadmapSkill
- brand-name-labSkill
- breaking-change-detectorSkill
- changelog-generatorSkill
- checkpoint-guardianSkill
- claude-style-codingSkill
- claw-integration-designSkill
- contract-first-designerSkill
- coolify-orchestratorSkill
- crash-analystSkill
- data-lineage-tracerSkill
- data-maskerSkill
- deep-link-architectSkill
- design-intelligenceSkill
- design-md-enforcerSkill
- ecosystem-apiSkill
- ecosystem-databaseSkill
- ecosystem-mobileSkill
- ecosystem-orchestrationSkill
- ecosystem-productSkill
- ecosystem-reasoningSkill
- ecosystem-securitySkill
- ecosystem-webSkill
- error-recoverySkill
- fth-design-crafterSkill
- geo-auditorSkill
- geo-optimizerSkill
- index-advisorSkill
- jev-orchestratorSkill
- mastermind-loggerSkill
- memory-ledgerSkill
- migration-strategistSkill
- mobile-perf-auditorSkill
- mobile-security-auditorSkill
- multi-brain-debateSkill
- multi-brain-expertsSkill
- multi-brain-scoreSkill
- multi-brainSkill
- offline-sync-designerSkill
- onboarding-designerSkill
- output-criticSkill
- parallel-plannerSkill
- pgbouncer-architectSkill
- plan-hardenerSkill
- plan-implement-verify-recoverSkill
- proje-analizcisiSkill
- project-analyzerSkill
- project-focus-firstSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 68
Keep: All function/class signatures (with parameters), return types and critical type annotations, exception handling, configuration …
- Distinctive: line 120
If below target (< 50% reduction): re-scan for repetition, compress background more aggressively, convert long examples to single-line …
- Distinctive: line 126
Every compression starts with:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Context Compressor Protocol
Reduce content by 70% — preserve critical information, discard repetition and noise. Target: compressed output should be ~30% of original size with preserved information density.
Workflow
1. Detect content type
2. Mark critical elements (these are never discarded)
3. Apply type-specific compression
4. Verify 70% target
5. Present compressed outputStep 1: Detect Content Type
| Content Type | Detection Criteria |
| Conversation history | User/assistant message pairs |
| Code file | Function/class structures, syntax |
| Research results | URLs, source references, data points |
| Meeting notes / document | Headers, bullet lists, decisions |
Step 2: Mark Critical Elements
These elements are never discarded:
- Decisions & conclusions: "We decided to use X", "Y was chosen"
- Errors & fixes: Discovered bugs, applied solutions
- Numerical data: Dates, version numbers, metrics, amounts
- Dependencies: "A must finish before B" constraints
- Action items: Who does what, when
- Current state: Latest version, current config, last decision
Step 3: Type-Specific Compression
Conversation History
Discard: Greetings, acknowledgments ("OK", "Got it", "Thanks"), repeated explanations, intermediate reasoning that contradicts the final conclusion.
Keep: User's clear requests, decisions and rationale, error messages and fixes, current task status.
Format:
[CONVERSATION SUMMARY — N messages -> M lines]
Context: [what the task is, 1 sentence]
Decisions: [bullet list]
Current status: [where things stand]
Pending: [open questions if any]Code File
Discard: Comments (except docstrings), excessive blank lines, long import lists (consolidate), temporary debug prints.
Keep: All function/class signatures (with parameters), return types and critical type annotations, exception handling, configuration constants. Summarize function bodies as single-line pseudocode.
Format:
# [COMPRESSED — original: ~N lines -> now: ~M lines]
class ClassName:
"""[Original docstring]"""
def method_name(self, param: Type) -> ReturnType:
# [What it does — 1 line summary]
...Research / Web Results
Discard: Duplicate information, generic background, verbose URLs (use domain name), out-of-scope quotes.
Keep: Concrete data points, primary source findings, contradictory findings (keep both), directly relevant findings.
Format:
[RESEARCH SUMMARY — N sources -> M items]
Topic: [what was researched]
Key findings:
- [Finding 1] (Source: domain.com)
- [Finding 2] (Source: domain.com)
Contradictions:
- [Source A says X, Source B says Y]
Missing / unverified:
- [Information not found]Documents / Meeting Notes
Discard: Intro/closing paragraphs (if no content), repetitive statements, generic commentary.
Keep: Decisions made, action items (who, what, when), alternatives discussed and why rejected, next steps.
Step 4: Verify 70% Target
Original size : ~N words / lines / tokens
Compressed size : ~M words / lines / tokens
Compression : ~X% reduction
Target: 70% [Achieved / Below target]If below target (< 50% reduction): re-scan for repetition, compress background more aggressively, convert long examples to single-line references.
Output Header
Every compression starts with:
CONTEXT COMPRESSOR
Type : [content type]
Before : ~N [words/lines]
After : ~M [words/lines]
Saving : ~X% reductionWhen to Skip
- Content is already short (< 200 words / 50 lines)
- User said "all details matter"
- Legal, medical, or financial documents (information loss risk too high)
Guardrails
- Never discard decisions or error resolutions — these are the most valuable context.
- Preserve contradictions — if two sources disagree, keep both.
- Show compression ratio — the user must see how much was removed.
- Cross-skill: works with
memory-ledger(can compress ledger entries) andagent-reviewer(provides compressed history for retrospective).
References
references/EXAMPLES.md— a before-and-after conversation history compression. Read it when the expected output format or level of detail is unclear.
🔗 Next Steps & Handoffs
<!-- BEGIN GENERATED: handoffs (generated from the ecosystem workflow map by build_ecosystems.py — do not edit by hand) -->Ecosystem: @ecosystem-orchestration — Agent Orchestration.
Workflows:
- Failure & Context Pressure Flow (
orch-resilience, step 2 of 3): next →@session-transfer(optional).
Handoff contract: pass results to the next skill through an inline Handoff block in your reply with the fields skill, workflow, created_at, inputs, summary, and next (the handoff contract of @ecosystem-orchestration). If a next skill is not installed, continue with its step from the ecosystem map, or install it with npx skills add fatih-developer/fth-skills --skill <name> after the user agrees.
<!-- END GENERATED: handoffs -->Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

