Context Slimmer
Audit workspace files that load into every message and reduce their token footprint.
Quick Start
CODEBLOCK0
Audit Process
For each always-loaded file, evaluate:
- 1. Move to skill — Content only needed for specific tasks (betting config, group chat rules, detailed protocols). Move to a skill or reference file that loads on demand.
- Remove — Outdated info, dead features, completed one-time setup, duplicated content across files.
- Compress — Verbose explanations that could be 1 sentence. If the agent already knows it, cut it.
Rules of Thumb
- - If a cron job handles it, remove it from HEARTBEAT.md
- If it's in SOUL.md, don't repeat it in MEMORY.md or AGENTS.md
- If it's in USER.md, don't repeat it in MEMORY.md
- If the agent does it daily, it doesn't need instructions — just a trigger word
- Prefer 1 sentence over 5 bullets saying the same thing
- Target: each file should justify every line's token cost
Expected File Sizes (lean targets)
| File | Target |
|---|
| AGENTS.md | < 500 tokens |
| TOOLS.md |
< 500 tokens |
| USER.md | < 700 tokens |
| MEMORY.md | < 400 tokens |
| HEARTBEAT.md | < 400 tokens |
| SOUL.md | < 250 tokens |
| IDENTITY.md | < 50 tokens |
|
Total |
< 2,800 tokens |
Output Format
Report: current size, projected size, savings per file. Include specific recommendations grouped by move/remove/compress.
上下文精简器
审计加载到每条消息中的工作区文件,减少其令牌占用。
快速开始
bash
测量当前上下文成本
bash scripts/measure.sh
完整审计(输出建议)
bash scripts/measure.sh --audit
审计流程
对于每个始终加载的文件,评估:
- 1. 移至技能 — 仅特定任务需要的内容(投注配置、群聊规则、详细协议)。移至按需加载的技能或参考文件。
- 移除 — 过时信息、已废弃功能、已完成的一次性设置、文件间重复内容。
- 压缩 — 可用一句话概括的冗长解释。如果代理已知晓,则删减。
经验法则
- - 如果由定时任务处理,则从HEARTBEAT.md中移除
- 如果已在SOUL.md中,不要在MEMORY.md或AGENTS.md中重复
- 如果已在USER.md中,不要在MEMORY.md中重复
- 如果代理每日执行,则无需指令——只需一个触发词
- 优先用一句话而非五个要点表达相同内容
- 目标:每个文件应证明其每一行的令牌成本合理
预期文件大小(精简目标)
| 文件 | 目标 |
|---|
| AGENTS.md | < 500 令牌 |
| TOOLS.md |
< 500 令牌 |
| USER.md | < 700 令牌 |
| MEMORY.md | < 400 令牌 |
| HEARTBEAT.md | < 400 令牌 |
| SOUL.md | < 250 令牌 |
| IDENTITY.md | < 50 令牌 |
|
总计 |
< 2,800 令牌 |
输出格式
报告:当前大小、预期大小、每个文件的节省量。包含按移动/移除/压缩分组的具体建议。