strategic-compact
Skill43 starsChanged 10 months agoMITView on GitHub
建议在逻辑间隔进行手动上下文压缩(Context Compaction),以便在任务阶段中保留上下文,而不是依赖随机的自动压缩。
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 repository30 other files it gives its agents.
- rules/agents.mdAGENTS.md
- examples/CLAUDE.mdCLAUDE.md
- oneskillSkill
- backend-patternsSkill
- clickhouse-ioSkill
- coding-standardsSkill
- continuous-learningSkill
- continuous-learning-v2Skill
- django-patternsSkill
- django-securitySkill
- django-tddSkill
- django-verificationSkill
- eval-harnessSkill
- frontend-patternsSkill
- golang-patternsSkill
- golang-testingSkill
- iterative-retrievalSkill
- java-coding-standardsSkill
- jpa-patternsSkill
- postgres-patternsSkill
- project-guidelines-exampleSkill
- python-patternsSkill
- python-testingSkill
- security-reviewSkill
- springboot-patternsSkill
- springboot-securitySkill
- springboot-tddSkill
- springboot-verificationSkill
- tdd-workflowSkill
- verification-loopSkill
The file
Files
策略性压缩技能 (Strategic Compact Skill)
建议在工作流(Workflow)的关键点手动执行 /compact,而不是依赖随机触发的自动压缩。
为什么需要策略性压缩?
自动压缩会在随机时间点触发:
- 经常在任务进行中触发,导致丢失重要的上下文
- 无法识别逻辑上的任务边界
- 可能会中断复杂的多步操作
在逻辑边界处进行策略性压缩:
- 在探索之后,执行之前 —— 压缩研究阶段的上下文,保留实现计划
- 在完成里程碑之后 —— 为下一阶段开启全新开始
- 在重大上下文切换之前 —— 在切换到不同任务前清理探索相关的上下文
工作原理
suggest-compact.sh 脚本在工具调用前(PreToolUse,针对 Edit/Write 工具)运行,并且:
- 跟踪工具调用 —— 统计会话(Session)中的工具调用次数
- 阈值检测 —— 在达到可配置的阈值(默认:50 次调用)时给出建议
- 定期提醒 —— 达到阈值后,每隔 25 次调用提醒一次
钩子 (Hook) 配置
添加至您的 ~/.claude/settings.json:
{
"hooks": {
"PreToolUse": [{
"matcher": "tool == \"Edit\" || tool == \"Write\"",
"hooks": [{
"type": "command",
"command": "~/.claude/skills/strategic-compact/suggest-compact.sh"
}]
}]
}
}配置
环境变量:
COMPACT_THRESHOLD—— 首次建议前的工具调用次数(默认:50)
最佳实践
- 在规划后压缩 —— 一旦计划最终确定,进行压缩以全新状态开始执行
- 在调试后压缩 —— 在继续开发前清理错误修复相关的上下文
- 不要在实现过程中压缩 —— 为相关变更保留上下文
- 关注建议 —— 钩子(Hook)告诉您“何时”可以压缩,而“是否”压缩由您决定
相关资源
- 长篇指南 (The Longform Guide) —— Token 优化章节
- 记忆持久化钩子 (Memory persistence hooks) —— 用于在压缩后仍需保留的状态
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.

