Claude Code Agent每日消耗945万Token的踩坑复盘与优化方案
my claude code agents burned 9.45 million tokens in one day. most of it was them reading my own notes
推荐理由
Agent 开发者的硬核踩坑实录,给出了具体的 Token 预算、归档脚本逻辑和 Prompt 约束规则,直接可复用于优化多 Agent 协作的成本结构。
代码 · 1 行
solo dev here, building a toy-brick rts in ue5 with a bunch of claude code agents doing roles (engine, ai opponent, modeller, qa, etc). on sep 22 the token ledger said ~9.45 million tokens in a single day. i figured it was the hard stuff that day, a rig audit and a map-load memory fix. nope. when i dug in, the agents were mostly reading. whole source files when the task needed like 40 lines. and our own docs. between sep 22 and 25 the four big logs grew from ~1m to ~2.5m characters. the handoff file alone went from 78,631 to 373,789 characters, so any agent that opened it whole read ~93k tokens before doing a single thing. i was paying them to read their own diary lol what fixed it: - a one-page brief (Docs/BRIEF.md, ~1,350 tokens) every agent reads first, instead of the logs - a reading budget: under 6,000 tokens per role before work starts - a compactor role that rolls finished work into Docs/archive/ with a pointer left behind. it runs a script (compact_docs.py) that moves text byte for byte and never rewords. the first big roll took ~295k characters (~73,800 tokens) out of the live files - three rules in CLAUDE.md: never read a whole source file. edits, never full rewrites (a rewrite resends the whole file and can silently drop lines). one deliverable per run, stop near 250k tokens, hand a short state to a fresh agent that last one hurt the most. a resumed agent isn't a continuing worker, it's a very expensive reader. one resumed cinematics agent cost about 450k tokens per swap. the lesson if you run agents on a long project: your docs are a cost, not just context. log file sizes and tokens per run before you blame the model. anyone else tracking tokens per role? what was your biggest hidden eater?更进一步:量化金融体系
看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力