compress-context
Skill3 starsChanged 6 months agoMITView on GitHub
1 other project uses a version of this.
Adopted by
Most recently taken up by
- ses770227/awesome-agent-skillstheir own version, first seen Jan 21, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- ses770227/awesome-agent-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 repository18 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- assumption-checkSkill
- cache-hintSkill
- caveman-summarySkill
- clarify-intentSkill
- code-mapSkill
- detect-contradictionSkill
- error-to-actionSkill
- explain-depthSkill
- format-responseSkill
- humanize-outputSkill
- prevent-redundancySkill
- route-or-answerSkill
- setupSkill
- simplify-scopeSkill
- tone-matchSkill
- tool-call-guardSkill
- validate-outputSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
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 56
Never drop: decisions, confirmed facts, constraints, errors
- Distinctive: line 57
Never compress below 25% of original — over-compression loses signal
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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
skill: compress-context
purpose
Shrink a long conversation or document context 60–75% while keeping everything needed for the current task. Prevents token bloat across multi-turn sessions without losing decisions or facts.
when_to_use
- Conversation exceeds ~3,000 tokens and will continue for more turns
- Passing context from one agent step to the next and most of it is irrelevant
- Long document needs repeated reference across multiple calls
when_not_to_use
- Context is under 1,000 tokens — overhead not worth it
- Task requires verbatim quoting (legal, transcription)
- First turn — nothing to compress
input
context: string # Full context to compress
current_task: string # What the agent needs to do next — determines what's relevantoutput
{
"compressed": "string",
"original_tokens": "int // estimate",
"compressed_tokens": "int // estimate",
"dropped": ["category of removed content"]
}instructions
First check: if context is under ~1,000 tokens, return it as-is with a note that compression overhead isn't worth it at this size.
Compress context for a specific task. Keep only what is needed to complete that task.
Rules:
1. Convert verbose explanations to one-line facts
2. Remove pleasantries, filler, agent meta-commentary ("Sure, I'd be happy to...")
3. Merge repeated or restated information into one canonical statement
4. Remove content that does not affect the current task
5. Preserve: decisions made, data values, constraints, errors, user preferences stated
6. Use shorthand: "User: cancel sub" not "The user indicated they would like to cancel their subscription"
Never drop decisions, confirmed facts, active constraints, or error states.
Never hallucinate — if uncertain whether something is relevant, keep it.
Target 60–75% reduction. More than that risks losing signal.
Return JSON only.constraints
- Max output tokens: 600
- Never drop: decisions, confirmed facts, constraints, errors
- Never compress below 25% of original — over-compression loses signal
example
Input:
context: "User: Hi, trouble with my account. Agent: Happy to help! What's the issue? User: API key stopped working. Been using it 6 months. Agent: Can you share first 6 chars? User: sk-abc1. Agent: Key was revoked Jan 14 due to billing issue — card 4242 declined. User: Card expired. Updated it, new card ends 9191. Agent: Payment should process in 2–15 min, key reactivated then. User: How long exactly? Agent: Usually 2–5 min, up to 15."
current_task: "Check if the API key has been reactivated"Output:
{
"compressed": "API key sk-abc1*** revoked Jan 14 — failed payment (card 4242 expired). User updated to card 9191. Reactivation pending, expected 2–15 min. Task: check reactivation status.",
"original_tokens": 120,
"compressed_tokens": 38,
"dropped": ["pleasantries", "back-and-forth confirmation dialogue", "agent offers"]
}feedback_log
<!-- date | situation | what went wrong | better behavior -->2026-05-29 | invoked on a 3-turn conversation (~180 tokens) | ran full compression pipeline on trivially small context, added overhead for no gain | added: early-return guard in instructions — skip compression if context < ~1,000 tokens
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.

