context-compactor
Skill1 starsChanged 5 months agoMITView on GitHub
Tells you when to /clear vs keep, what to dump to a memory file before clearing, and how to re-seed the next session efficiently. Trigger phrases: context full, running low, should I clear, compact this, lots of files read, /compact. Auto-trigger at 70% of the context window if Claude Code exposes that metric. Warn at 85%, force-suggest at 95%. Before clearing, write a hand-off document at .proteus/sessions/<date>-<topic>.md: Then run /clear. Re-seed the next session by pasting the brief or by…
4 other projects use a version of this.
Adopted by
Most recently taken up by
- sasuketorii/rev_harness_publictheir own version, first seen Aug 19, 2026
- fubira/claude-code-settingstheir own version, first seen Aug 11, 2026
- aragaobruno/toolbelttheir own version, first seen Jun 23, 2026
- makisekurisu0827/context-compactortheir own version, first seen May 30, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- aragaobruno/toolbelt★ 2same name
- makisekurisu0827/context-compactor★ 2same name
- fubira/claude-code-settings★ 1same name
- sasuketorii/rev_harness_public★ 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 repository12 other files it gives its agents.
- commit-curatorSkill
- cost-trackerSkill
- decision-recorderSkill
- mcp-finderSkill
- permission-auditorSkill
- prd-builderSkill
- prompt-matcherSkill
- pr-reviewerSkill
- repo-onboarderSkill
- scope-clarifierSkill
- skill-matcherSkill
- tdd-flowSkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 24
Before clearing, write a hand-off document at .proteus/sessions/<date>-<topic>.md:
- Distinctive: line 61
Ask: "Save brief and clear?
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
context-compactor
Tells you when to
/clearvs keep, what to dump to a memory file before clearing, and how to re-seed the next session efficiently.
When to activate
Trigger phrases: context full, running low, should I clear, compact this, lots of files read, /compact.
Auto-trigger at 70% of the context window if Claude Code exposes that metric. Warn at 85%, force-suggest at 95%.
Decision tree
Is the current task done?
├── YES → Suggest /clear. Save anything durable to a vault note first.
└── NO →
Is most context now stale (reading files we won't touch again)?
├── YES → Suggest dumping current state to a session brief, then /clear, then re-seed.
└── NO → Stay. The model still needs this context.The "session brief" pattern
Before clearing, write a hand-off document at .proteus/sessions/<date>-<topic>.md:
# Session brief: <topic>
## What I was doing
<2-3 sentences>
## What's done
- <thing 1>
- <thing 2>
## Where I am right now
<the next concrete action>
## Files I touched
- path/file.py — <one-line change summary>
- ...
## Decisions made
- <decision> — (see ADR-NNNN if recorded)
## Open questions
- <q>Then run /clear. Re-seed the next session by pasting the brief or by saying "read .proteus/sessions/<date>-<topic>.md and continue."
Process
- Detect context pressure (token count vs window size)
- Categorize what's in context:
- Active code (keep)
- Stale file reads (drop)
- Verbose tool outputs (drop)
- Decisions / current task state (preserve as brief)
- Generate the session brief
- Ask: "Save brief and clear? (y / no / brief-only / clear-only)"
- On approval: write brief, then
/clear
Inputs
- Current context token usage
- Tool call history (to find stale reads)
- The user's stated task
Outputs
- Session brief file (at
.proteus/sessions/) /clearinvocation (if approved)- Re-seed instructions for next session
Slash command
/compact — start the flow regardless of context pressure.
Why this skill
Cherny's data: 80% of "Claude got dumb" complaints trace to bloated context. Compacting is the single highest-impact session hygiene practice.
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.

