Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add Luohaothu/everything-codex --skill strategic-compactgit clone --depth 1 https://github.com/Luohaothu/everything-codexWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/luohaothu/everything-codex/strategic-compact)<a href="https://agentmods.dev/skills/luohaothu/everything-codex/strategic-compact"><img src="https://agentmods.dev/badge/skills/luohaothu/everything-codex/strategic-compact/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/luohaothu/everything-codex/strategic-compact"><img src="https://agentmods.dev/badge/skills/luohaothu/everything-codex/strategic-compact.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00037 | $0.00567 |
| Opus 5.5 | $0.00015 | $0.00227 |
| Sonnet 5.5 | $0.00007 | $0.00113 |
| Haiku 4.5 | $0.00004 | $0.00057 |
Grade B, and why
strategic-compact scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Reads agent configuration directoriesmediumAgent snooping
.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.
添加到你的 `~/.claude/settings.json`: What it actually says
战略精简技能
建议在你的工作流程中的战略节点手动执行 /compact,而不是依赖任意的自动精简。
为何采用战略精简?
自动精简会在任意时间点触发:
- 通常在任务中途,丢失重要上下文
- 无法感知逻辑任务边界
- 可能中断复杂的多步骤操作
在逻辑边界进行战略精简:
- 探索之后,执行之前 - 精简研究上下文,保留实施计划
- 完成一个里程碑之后 - 为下一阶段全新开始
- 主要上下文切换之前 - 在不同任务开始前清理探索上下文
工作原理
suggest-compact.sh 脚本在 PreToolUse(编辑/写入)时运行并执行:
- 追踪工具调用 - 计算会话中的工具调用次数
- 阈值检测 - 在可配置的阈值(默认:50 次调用)处建议精简
- 定期提醒 - 在达到阈值后,每 25 次调用提醒一次
钩子设置
添加到你的 ~/.claude/settings.json:
{
"hooks": {
"PreToolUse": [{
"matcher": "tool == \"Edit\" || tool == \"Write\"",
"hooks": [{
"type": "command",
"command": "~/.claude/skills/strategic-compact/suggest-compact.sh"
}]
}]
}
}
配置
环境变量:
COMPACT_THRESHOLD- 首次建议前的工具调用次数(默认:50)
最佳实践
- 规划后精简 - 一旦计划确定,精简以全新开始
- 调试后精简 - 在继续之前,清理错误解决上下文
- 不要在实施中途精简 - 保留相关更改的上下文
- 阅读建议 - 钩子告诉你何时,由你决定是否
相关
- 长篇指南 - 令牌优化部分
- 内存持久化钩子 - 用于在精简后保留的状态
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3mo ago First seen · 67 lines · 37 tokens per session scan B a78a5c309906
strategic-compact is a skill published in the GitHub repository Luohaothu/everything-codex (24 stars, last pushed 3mo ago), licensed MIT. It adds 37 tokens to every session and 567 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
strategic-compact compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| strategic-compactLuohaothu/everything-codex | Skill | 24 | 3mo ago | MIT | B | 37 | Claude Code |
| orbit-notionnexu-io/open-design | Skill | 111k | today | Apache-2.0 | A | 117 | Claude Code, Codex |
| agentmailpaperclipai/paperclip | Skill | 119k | today | MIT | A | 30 | Claude Code, Codex |
| rowboat-spacesrowboatlabs/rowboat | Skill | 18k | today | Apache-2.0 | A | 60 | Claude Code, Codex |
| Cortexdanielmiessler/LifeOS | Skill | 21k | 14d ago | MIT | A | 184 | Claude Code |
| feishuHmbown/CodeWhale | Skill | 41k | 4d ago | MIT | A | 33 | Claude Code, Codex |
| pinchtab-mcppinchtab/pinchtab | Skill | 11k | 8d ago | MIT | A | 52 | Claude Code, Codex |