— No reviews yet
0 installs
9 views
0.0% view→install
Install
$ agentstack add skill-codelably-harmony-claude-code-strategic-compact ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Are you the author of Strategic Compact? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claimAbout
策略性压缩技能 (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) —— 用于在压缩后仍需保留的状态
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: codelably
- Source: codelably/harmony-claude-code
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.