strategic-compact
Skill1 starsChanged 8 months agoMITView on GitHub
Suggests manual context compaction at logical intervals to preserve context through task phases rather than arbitrary auto-compaction.
We split this skill into the rules it gives an agent
5 rules. 1 is common, 3 are distinctive, and 1 is very specific to this project.
1
Common
Most of the 47 edited versions we read keep these.
3
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
- Distinctive: line 16
After completing a major milestone and starting new work
- Distinctive: line 17
When responses slow down or become less coherent (context pressure)
- Common: line 23
No awareness of logical task boundaries
- Very specific: line 41
Add to your ~/.claude/settings.json:
- Distinctive: line 67
Use this table to decide when to compact:
“Common” is measured: kept by at least 6 in 10 of the 47 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 Skill
Suggests manual /compact at strategic points in your workflow rather than relying on arbitrary auto-compaction.
When to Activate
- Running long sessions that approach context limits (200K+ tokens)
- Working on multi-phase tasks (research → plan → implement → test)
- Switching between unrelated tasks within the same session
- After completing a major milestone and starting new work
- When responses slow down or become less coherent (context pressure)
Why Strategic Compaction?
Auto-compaction triggers at arbitrary points:
- Often mid-task, losing important context
- No awareness of logical task boundaries
- Can interrupt complex multi-step operations
Strategic compaction at logical boundaries:
- After exploration, before execution — Compact research context, keep implementation plan
- After completing a milestone — Fresh start for next phase
- Before major context shifts — Clear exploration context before different task
How It Works
The suggest-compact.js script runs on PreToolUse (Edit/Write) and:
- Tracks tool calls — Counts tool invocations in session
- Threshold detection — Suggests at configurable threshold (default: 50 calls)
- Periodic reminders — Reminds every 25 calls after threshold
Hook Setup
Add to your ~/.claude/settings.json:
{
"hooks": {
"PreToolUse": [
{
"matcher": "Edit",
"hooks": [{ "type": "command", "command": "node ~/.claude/skills/strategic-compact/suggest-compact.js" }]
},
{
"matcher": "Write",
"hooks": [{ "type": "command", "command": "node ~/.claude/skills/strategic-compact/suggest-compact.js" }]
}
]
}
}Configuration
Environment variables:
COMPACT_THRESHOLD— Tool calls before first suggestion (default: 50)
Compaction Decision Guide
Use this table to decide when to compact:
| Phase Transition | Compact? | Why |
| Research → Planning | Yes | Research context is bulky; plan is the distilled output |
| Planning → Implementation | Yes | Plan is in TodoWrite or a file; free up context for code |
| Implementation → Testing | Maybe | Keep if tests reference recent code; compact if switching focus |
| Debugging → Next feature | Yes | Debug traces pollute context for unrelated work |
| Mid-implementation | No | Losing variable names, file paths, and partial state is costly |
| After a failed approach | Yes | Clear the dead-end reasoning before trying a new approach |
What Survives Compaction
Understanding what persists helps you compact with confidence:
| Persists | Lost |
| CLAUDE.md instructions | Intermediate reasoning and analysis |
| TodoWrite task list | File contents you previously read |
Memory files (~/.claude/memory/) | Multi-step conversation context |
| Git state (commits, branches) | Tool call history and counts |
| Files on disk | Nuanced user preferences stated verbally |
Best Practices
- Compact after planning — Once plan is finalized in TodoWrite, compact to start fresh
- Compact after debugging — Clear error-resolution context before continuing
- Don't compact mid-implementation — Preserve context for related changes
- Read the suggestion — The hook tells you when, you decide if
- Write before compacting — Save important context to files or memory before compacting
- Use
/compactwith a summary — Add a custom message:/compact Focus on implementing auth middleware next
Related
- The Longform Guide — Token optimization section
- Memory persistence hooks — For state that survives compaction
continuous-learningskill — Extracts patterns before session ends
Other versions66 projects use a version of this.
Word for word · 16
- cohen-liel/hivemind★ 108100% same
- tpavanipradeep/everything-claude-code★ 104100% same
- mit-network/everything-claude-code★ 76100% same
- Infopibe/everything-claude-code★ 8100% same
- yapota2018/affaan-m-everything-claude-code★ 4100% same
- ArogyaReddy/https-github.com-affaan-m-everything-claude-code1★ 2100% same
- CodeWithBehnam/cc-docs★ 2100% same
- ashutoshrathi0909-oss/everything-claude-code★ 1100% same
- divenhuang88/everything-claude-code★ 1100% same
- elainesmithburkel-code/everything-claude-code★ 1100% same
6 more not listed
Edited · 43
- affaan-m/ECC★ 246k46% same
- xu-xiang/everything-claude-code-zh★ 1.9k10% same
- loulanyue/awesome-claude-notes★ 27276% same
- cloudnative-co/claude-code-starter-kit★ 15325% same
- mturac/everything-openai-codex★ 8994% same
- GGGODLIN/gggodlin-cc-harness★ 7377% same
- Fmarzochi/EGC★ 6170% same
- ysyecust/everything-claude-code★ 4474% same
- myths-labs/muse★ 3716% same
- DangQuangSE/team-development-skills★ 1973% same
33 more not listed
Wrote their own version · 7
- mhylle/claude-skills-collection★ 20same name
- YehudaFrankel/clankbrain★ 16same name
- peopleforrester/claude-dotfiles★ 3same name
- TeamSPWK/nova★ 2same name
- rhfl04-dfdf/jychoi_everything-claude-code-ko★ 1same name
- MANVENDRA-github/agentry★ 0same name
- RhythmMittal19/claude-config★ 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.
Used alongsideProjects with it also use agent-sort, nuxt4-patterns and 2 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.
niloykumarbarmanSkillagent-sort
Build an evidence-backed ECC install plan for a specific repo by sorting skills, commands, rules, hooks, and extras into DAILY vs LIBRARY buckets using parallel repo-aware review passes. Use when ECC should be trimmed to what a project actually needs instead of loading the full bundle.
Also in 11 projects that use this
loulanyueSkillnuxt4-patterns
Nuxt 4 app patterns for hydration safety, performance, route rules, lazy loading, and SSR-safe data fetching with useFetch and useAsyncData.
Also in 8 projects that use this
mryeastcodeSkilleverything-claude-code-conventions
Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.
Also in 8 projects that use this
loulanyueSkillsanta-method
Multi-agent adversarial verification with convergence loop. Two independent review agents must both pass before output ships.
Also in 7 projects that use this
In this repository189 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .codex/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- examples/CLAUDE.mdCLAUDE.md
- .cursor/rules/common-agents.mdCursor rule
- .cursor/rules/common-coding-style.mdCursor rule
- .cursor/rules/common-development-workflow.mdCursor rule
- .cursor/rules/common-git-workflow.mdCursor rule
- .cursor/rules/common-hooks.mdCursor rule
- .cursor/rules/common-patterns.mdCursor rule
- .cursor/rules/common-performance.mdCursor rule
- .cursor/rules/common-security.mdCursor rule
- .cursor/rules/common-testing.mdCursor rule
- .cursor/rules/golang-coding-style.mdCursor rule
- .cursor/rules/golang-hooks.mdCursor rule
- .cursor/rules/golang-patterns.mdCursor rule
- .cursor/rules/golang-security.mdCursor rule
- .cursor/rules/golang-testing.mdCursor rule
- .cursor/rules/kotlin-coding-style.mdCursor rule
- .cursor/rules/kotlin-hooks.mdCursor rule
- .cursor/rules/kotlin-patterns.mdCursor rule
- .cursor/rules/kotlin-security.mdCursor rule
- .cursor/rules/kotlin-testing.mdCursor rule
- .cursor/rules/php-coding-style.mdCursor rule
- .cursor/rules/php-hooks.mdCursor rule
- .cursor/rules/php-patterns.mdCursor rule
- .cursor/rules/php-security.mdCursor rule
- .cursor/rules/php-testing.mdCursor rule
- .cursor/rules/python-coding-style.mdCursor rule
- .cursor/rules/python-hooks.mdCursor rule
- .cursor/rules/python-patterns.mdCursor rule
- .cursor/rules/python-security.mdCursor rule
- .cursor/rules/python-testing.mdCursor rule
- .cursor/rules/swift-coding-style.mdCursor rule
- .cursor/rules/swift-hooks.mdCursor rule
- .cursor/rules/swift-patterns.mdCursor rule
- .cursor/rules/swift-security.mdCursor rule
- .cursor/rules/swift-testing.mdCursor rule
- .cursor/rules/typescript-coding-style.mdCursor rule
- .cursor/rules/typescript-hooks.mdCursor rule
- .cursor/rules/typescript-patterns.mdCursor rule
- .cursor/rules/typescript-security.mdCursor rule
- .cursor/rules/typescript-testing.mdCursor rule
- api-designSkill
- article-writingSkill
- backend-patternsSkill
- bun-runtimeSkill
- claude-apiSkill
- coding-standardsSkill
- content-engineSkill
- crosspostSkill
- deep-researchSkill
- dmux-workflowsSkill
- documentation-lookupSkill
- e2e-testingSkill
- eval-harnessSkill
- exa-searchSkill
- fal-ai-mediaSkill
- frontend-patternsSkill
- frontend-slidesSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

