context-manager
Skill4 starsChanged 28 days agoISCView on GitHub
Proactive context window management to maintain high-quality outputs. Use when context usage approaches 20-40%, when explanations are being repeated, or when output quality degrades.
13 other projects use a version of this.
Adopted by
Most recently taken up by
- tturupapa-stack/agent-company-v5.1their own version, first seen Nov 8, 2026
- Mark393295827/graph-engineering-architecturestheir own version, first seen Nov 8, 2026
- davidanthonyn/claude-skillstheir own version, first seen Oct 20, 2026
- xfstudio/skillstheir own version, first seen Oct 13, 2026
- felvieira/claude-skills-fvtheir own version, first seen Sep 2, 2026
- valsecchi75/project-scaffoldertheir own version, first seen Aug 3, 2026
Other versions13 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 13
- gaoziman/claude-context-manager★ 87same name
- jshsakura/awesome-opencode-skills★ 30same name
- felvieira/claude-skills-fv★ 27same name
- belokonm/claude-supercode-skills★ 11same name
- valsecchi75/project-scaffolder★ 9same name
- xfstudio/skills★ 9same name
- nicolasestrem/antigravity-gemini-skills★ 8same name
- Mark393295827/graph-engineering-architectures★ 4same name
- ai4brands-design/claude-skills★ 2same name
- RockaRhymeLLC/claude-code-skills★ 1same name
3 more not listed
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 repository7 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- dependency-updateSkill
- document-writingSkill
- engineering-terminologySkill
- security-updateSkill
- translation-expertiseSkill
- web-browsingSkill
The file
We split this skill into the rules it gives an agent
9 rules. 0 are common, 6 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 10 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 58
Write plans and progress to files that persist across sessions:
- Distinctive: line 81
Testing: - Test-runner agent executes tests, returns findings
- Distinctive: line 96
When context is bloated but you need to preserve specific information:
- Very specific: line 110
If any of these are true, /clear and start fresh:
- Distinctive: line 131
If you notice degradation symptoms:
- Distinctive: line 162
Don't: Keep explaining same thing hoping for different result
- Very specific: line 195
Use the model configured for the session.
- Distinctive: line 206
Use external memory: - Write to the task's plan.md and NOTES.md
- Very specific: line 210
Plan in a file: - Write complex plans to the task's plan.md
“Common” is measured: kept by at least 6 in 10 of the 10 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 Management for Optimal Performance
Context quality degrades at 20-40% usage, so manage it before the window fills. The actual window depends on the model (1M tokens by default in this workspace); set CLAUDE_CONTEXT_WINDOW if you run a different window size.
A UserPromptSubmit hook (.claude/hooks/context_monitor.js) measures real usage from the transcript and injects [Context Monitor] warnings at 20%, 40%, and 60%. Use this skill when one of those warnings appears.
Why Context Management Matters
The degradation pattern:
- 0-20%: Optimal performance
- 20-40%: Quality starts to chip away (subtle but present)
- 40-60%: Noticeable degradation begins
- 60%+: Significant quality loss, even after compaction
Compaction doesn't restore quality - It only buys a bit more space. If quality was already degraded before compaction, it stays degraded after.
Symptoms of Context Degradation
Watch for these signs:
- Repetition - Explaining the same thing 3+ times without progress
- Loops - Trying same solution repeatedly, failing each time
- Confusion - Mixing up different parts of codebase
- Missed context - Forgetting information from earlier in conversation
- Overengineering - Adding unnecessary abstractions unprompted
- Off-target - Implementations that miss the actual requirements
If you notice any of these, context is likely degraded. Time to intervene.
Prevention Strategies
1. Scope Conversations Per Feature
Do: One conversation per task/feature
✅ Conversation 1: Build authentication system
✅ Conversation 2: Refactor database queries
✅ Conversation 3: Add user profile pageDon't: Mix unrelated tasks in same conversation
❌ Conversation 1: Build auth + refactor DB + add profile + fix bug in checkoutWhy: Contexts bleed together. Claude gets confused about which patterns apply where.
2. Use External Memory Files
Write plans and progress to files that persist across sessions:
- tasks/
<task-name-yymmdd>/plan.md - Implementation plan and design decisions - tasks/
<task-name-yymmdd>/NOTES.md - Progress, findings, and handoff notes
Workflow:
1. Work on task, write findings to tasks/<task-name-yymmdd>/NOTES.md
2. When context approaches 30%, write a summary to the same file
3. Run /compact to summarize conversation
4. Run /clear to wipe context completely
5. Read NOTES.md and plan.md to resume with fresh contextThis gives you: A fresh context window + preserved knowledge from previous work.
3. Delegate to Subagents
Each subagent gets its own context window. Use them for:
- Complex research - Explore agent investigates codebase, returns summary
- Implementation subtasks - Custom implementer agent handles scope, returns result
- Testing - Test-runner agent executes tests, returns findings
Key: Main conversation only holds summaries, not full execution history. This prevents context pollution.
Pattern for large refactoring:
1. Main agent identifies 10 files needing changes
2. Spin up 3 subagents, each handling 3-4 files
3. Each subagent returns summary of changes made
4. Main agent synthesizes summaries, never holding all file contents4. The Copy-Paste Reset
When context is bloated but you need to preserve specific information:
1. Copy important details from terminal (file paths, error messages, decisions made)
2. Run /compact to get conversation summary
3. Run /clear to wipe context completely
4. Paste back only what matters for next steps
5. Continue with a fresh context windowWhen to use: Mid-task when quality degrades but you're not finished.
5. Know When to Just Clear
If any of these are true, /clear and start fresh:
- Explaining same thing 3+ times without progress
- Claude looping on failed solution
- Context includes multiple failed approaches that didn't work
- Conversation went off-rails into unrelated tangents
- You merged multiple unrelated topics (auth + DB + UI all discussed)
You won't lose progress - You still have:
- Your CLAUDE.md (project context)
- Task files (
tasks/<task-name-yymmdd>/plan.md,NOTES.md) - Git history (code changes)
- Audit logs (logs/
<YYYYMMDD>/logging.json)
Fresh context > struggling through degraded context - 9 times out of 10.
Recovery Strategies
When Already Degraded
If you notice degradation symptoms:
Option 1: Simplify and Reset
1. Write current progress to tasks/<task-name-yymmdd>/NOTES.md
2. /clear the conversation
3. Read NOTES.md and plan.md
4. Continue with simplified approachOption 2: Break Down the Task
1. Identify subtasks
2. /clear conversation
3. Tackle each subtask in fresh conversation
4. Combine resultsOption 3: Show Instead of Tell
1. Write minimal example of what you want
2. "Here's what success looks like. Apply this pattern to the rest."Claude is excellent at pattern-matching examples.
When Stuck in Loops
Don't: Keep explaining same thing hoping for different result
Do: Change the approach entirely
1. /clear conversation
2. Reframe the problem differently
- Instead of: "Handle these transitions"
- Try: "Implement this as a state machine"
3. Provide concrete example
4. Or delegate to subagent with fresh contextPlan in a File for Complex Tasks
Before starting complex work, write the approach to tasks/<task-name-yymmdd>/plan.md:
Why: A written plan survives /clear and keeps implementation focused even when the conversation starts fresh.
Process:
1. Use the Explore agent to understand the codebase
2. Design the architecture, considering tradeoffs
3. Write the plan to the task's plan.md
4. Get user approval when the approach needs one
5. Implement with fresh context, referencing the planThis separates: Research/planning notes from implementation context. Prevents bleeding.
Model Selection
Use the model configured for the session. This workspace inherits the main session's model for subagents (model: inherit); don't switch models mid-task just to manage context. If you need a different model, start a new session with it.
Monitoring Context Usage
The context_monitor hook reads the newest assistant usage entry from the session transcript and injects a warning at 20/40/60% of the configured window. Trust the injected percentage over guesswork from message counts.
The hook is fail-open: if the transcript is unavailable or unparsable, it stays silent. CLAUDE_CONTEXT_WINDOW overrides the default 1M window.
Best Practices Summary
- Scope per feature - One conversation per task
- Use external memory - Write to the task's plan.md and NOTES.md
- Delegate to subagents - Offload complex subtasks to fresh contexts
- Copy-paste reset - Preserve essentials, clear the rest
- Clear without hesitation - Fresh context > degraded context
- Plan in a file - Write complex plans to the task's
plan.md - Trust the monitor - Act on the injected percentage, not message-count guesses
The Meta-Skill
Recognize degradation early - The earlier you intervene, the less time wasted fighting through confusion.
Pattern: Quality dip → Write to file → Clear context → Resume fresh
This compounds: Good context management means more quality work in less time.
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.

