strategic-compact
Skill3 starsChanged 8 months agoMITView on GitHub
Context window optimization strategies for Claude Code. Covers token budgets, CLAUDE.md sizing, skill organization, tool selection, and techniques for maximizing productive output within context limits. Use when optimizing Claude Code configurations or managing large projects.
40 other projects use a version of this.
Adopted by
Most recently taken up by
- NTPhat0322/claude-skillstheir own version, first seen Sep 28, 2026
- templetongroup/radianttheir own version, first seen Sep 17, 2026
- arfar-x/agent-skillstheir own version, first seen Sep 7, 2026
- best-radar/bradar-everything-claude-codetheir own version, first seen Sep 6, 2026
- tarrragon/claude-skillstheir own version, first seen Sep 1, 2026
- SamuelNDCE/claude-super-skill-librarytheir own version, first seen Aug 1, 2026
Used with
Projects with it also use kotlin-testing, ralphinho-rfc-pipeline and 8 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
tpavanipradeepSkillkotlin-testing
Kotlin testing patterns with Kotest, MockK, coroutine testing, property-based testing, and Kover coverage. Follows TDD methodology with idiomatic Kotlin practices.
Also in 6 projects that use this
InfopibeSkillralphinho-rfc-pipeline
RFC-driven multi-agent DAG execution pattern with quality gates, merge queues, and work unit orchestration.
Also in 10 projects that use this
mryeastcodeSkillnuxt4-patterns
Nuxt 4 app patterns for hydration safety, performance, route rules, lazy loading, and SSR-safe data fetching with useFetch and useAsyncData.
Also in 5 projects that use this
saxon-ySkillconfigure-ecc
Interactive installer for Everything Claude Code — guides users through selecting and installing skills and rules to user-level or project-level directories, verifies paths, and optionally optimizes installed files.
Also in 12 projects that use this
InfopibeSkillcontent-hash-cache-pattern
Cache expensive file processing results using SHA-256 content hashes — path-independent, auto-invalidating, with service layer separation.
Also in 11 projects that use this
mryeastcodeSkillsanta-method
Multi-agent adversarial verification with convergence loop. Two independent review agents must both pass before output ships.
Also in 6 projects that use this
- +3 more from Infopibe
Other versions40 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 40
- WorldFlowAI/everything-claude-code★ 4ksame name
- xu-xiang/everything-claude-code-zh★ 2ksame name
- sangrokjung/claude-forge★ 847same name
- loulanyue/awesome-claude-notes★ 272same name
- cloudnative-co/claude-code-starter-kit★ 151same name
- tpavanipradeep/everything-claude-code★ 134same name
- templetongroup/radiant★ 113same name
- hellangleZ/burn-in-cceverywhere-ralph★ 112same name
- cohen-liel/hivemind★ 110same name
- Jamkris/everything-gemini-code★ 87same name
30 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 repository72 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- llms.txtllms.txt
- api-designerSkill
- backend-patternsSkill
- code-reviewerSkill
- debugging-assistantSkill
- golang-testingSkill
- project-guidelines-exampleSkill
- python-testingSkill
- refactoring-guideSkill
- spec-driven-developmentSkill
- tdd-workflowSkill
- verification-loopSkill
- update-docsSkill
- api-docsSkill
- changelog-writerSkill
- readme-generatorSkill
- django-patternsSkill
- django-securitySkill
- django-tddSkill
- django-verificationSkill
- fastapi-patternsSkill
- nextjs-patternsSkill
- react-patternsSkill
- springboot-patternsSkill
- springboot-securitySkill
- springboot-tddSkill
- branch-strategySkill
- changelogSkill
- commit-helperSkill
- pr-creatorSkill
- prSkill
- evolveSkill
- instinct-exportSkill
- instinct-importSkill
- instinct-statusSkill
- cleanupSkill
- lint-fixSkill
- refactor-cleanSkill
- update-depsSkill
- continuous-learningSkill
- continuous-learning-v2Skill
- eval-harnessSkill
- iterative-retrievalSkill
- golang-patternsSkill
- python-patternsSkill
- rust-patternsSkill
- typescript-patternsSkill
- accessibility-checkerSkill
- build-fixSkill
- code-reviewSkill
- e2eSkill
- performance-reviewerSkill
- security-auditorSkill
- security-reviewSkill
- test-coverageSkill
- checkpointSkill
- deploySkill
- evalSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 36 edited versions we read keep these.
2
Distinctive
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 161
When a conversation is compacted (summarized to save space):
- Distinctive: line 165
Check git status for current change state
“Common” is measured: kept by at least 6 in 10 of the 36 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
Strategic Compact
Techniques for optimizing Claude Code's context window usage.
Context Window Budget
Claude Code loads several sources into context at session start:
| Source | Target Budget | Max Budget |
| CLAUDE.md (global) | 500 tokens | 1,000 |
| CLAUDE.md (project) | 1,500 tokens | 2,500 |
| Active skills | 1,500 per skill | 3,000 |
| Rules (all loaded) | 500 per rule | 1,000 |
| Agent definitions | 500 per agent | 1,000 |
| Total passive load | < 10,000 | < 20,000 |
The remaining context budget is for conversation, code, and tool results.
CLAUDE.md Optimization
Size Guidelines
60-100 lines → Optimal (loads fast, leaves room for code)
100-150 lines → Acceptable (for complex projects)
150+ lines → Too large (move details to skills or docs)What Belongs in CLAUDE.md
✓ Stack and language versions
✓ Build/test/deploy commands
✓ Key directory structure
✓ Critical gotchas (non-obvious behaviors)
✓ Project-specific conventionsWhat Does NOT Belong in CLAUDE.md
✗ Language tutorials or syntax guides → Use skills
✗ General best practices → Use rules
✗ Long code examples → Use skills
✗ Documentation that exists elsewhere → Link to it
✗ Change history → Use CHANGELOG.mdToken-Efficient Writing
# Bad (verbose): 45 tokens
## Testing
To run the tests for this project, you should use the following command
which will discover and execute all test files:
`pytest tests/ -v`
# Good (concise): 12 tokens
## Commands
- **Test**: `pytest tests/ -v`Skill Organization
When to Create a Skill vs. Inline in CLAUDE.md
| Signal | Location |
| Used in every session | CLAUDE.md |
| Used occasionally | Skill |
| Language-specific patterns | Skill |
| Framework-specific patterns | Skill |
| One-time workflow | Command |
Skill Loading Strategy
Skills are loaded on demand. Organize so that:
- Frequently used skills have clear, searchable names
- Related patterns are grouped in one skill (not scattered)
- Each skill is self-contained (no cross-skill dependencies)
Tool Budget Management
MCP tools consume context tokens. Fewer active tools = more room for code.
| Tool Count | Impact |
| < 10 | Minimal overhead |
| 10-20 | Optimal range |
| 20-40 | Noticeable context cost |
| 40-80 | Significant — disable unused tools |
| 80+ | Performance degradation likely |
Optimization Steps
- Audit — List all configured MCP servers and tools
- Measure — Count total tools across all servers
- Prune — Disable tools you haven't used in 2+ weeks
- Group — Use one multi-purpose tool over many single-purpose ones
Conversation Efficiency
Reduce Round Trips
Bad: "Read file A" → result → "Read file B" → result → "Now edit both"
Good: "Read file A and file B" → results → "Edit both"Batch Independent Operations
Launch parallel operations when results don't depend on each other:
✓ Read 3 files simultaneously
✓ Run lint + type-check + test in parallel
✓ Search for pattern across multiple directories at onceAvoid Context Pollution
✗ Pasting entire file contents into chat when a path reference suffices
✗ Asking Claude to "explain this code" without specifying what's unclear
✗ Requesting verbose output when a summary would workLarge Project Strategies
Monorepo Navigation
1. Use Glob to find files by pattern (not ls -R)
2. Use Grep to search content (not reading files sequentially)
3. Delegate exploration to subagents (preserves main context)
4. Focus on one package/module per taskContext Recovery After Compaction
When a conversation is compacted (summarized to save space):
- Re-read CLAUDE.md to restore project context
- Re-read the specific file(s) you're working on
- Check git status for current change state
- Continue from the task summary, not from scratch
Checklist
- CLAUDE.md under 150 lines / 2,000 tokens
- Token count documented in CLAUDE.md header comment
- Patterns moved to skills, not inlined in CLAUDE.md
- MCP tool count under 40 active tools
- Parallel tool calls used where possible
- Subagents used for exploration (preserves main context)
- Rules are concise (under 500 tokens each)
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.

