Reduces an always-on LifeOS context file that has grown too big via a human-gated pass — deterministic GC of stale entries first, then semantic merges and reloc
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-trim-56479901527e ,按照其中的说明把「Trim」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Shrink an always-on context file that has gotten too big. /trim <file> walks the reduction, safest cuts first, never dropping a rule.
| Trigger | Workflow |
|---|---|
/trim <file>, "trim OPERATIONAL_RULES", "this file is too big", "reduce a doctrine file", "fold the proposal inbox" | Workflows/Trim.md |
OPERATIONAL_RULES) resolves against the always-on set — the system prompt, CLAUDE.md, its @-imports, and the hook-injected memory files. No arg → wc -c that set and take the largest.Workflows/Trim.md.LIFEOS/TOOLS/ProposalGC.ts (removes superseded/duplicate/absorbed entries). Sizes come from wc -c.~/.claude. LIFEOS/USER/** (OPERATIONAL_RULES, PROJECTS, the identity files) is a symlink into a separate private repo. Commit with git -C ~/.config/LIFEOS/USER …. A ~/.claude commit captures nothing under LIFEOS/USER/ — a false safety net.bun/bunx only, never npm/npx./trim OPERATIONAL_RULES
# → shows 40,456 B → ProposalGC dry-run (0 removable) → ranks semantic trims (fold the
# 40-entry proposal tail, relocate skill-scoped directives to a reference)
# → applies approved ones behind the safety gate → commits to USER_DATA → 28,043 B (−31%)
/trim
# → no arg: wc -c the always-on set, take the largest, then the same walkthrough
After completing the workflow, append a single JSONL entry:
echo '{"ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","skill":"Trim","workflow":"Trim","input":"8_WORD_SUMMARY","status":"ok|error","duration_s":SECONDS}' >> ~/.claude/LIFEOS/MEMORY/SKILLS/execution.jsonl