The agent workflow: keeping the receipts

Practice · 2025–2026 · every project on this site was built this way

Coding agents make one person fast. What they don't do on their own is leave a record a reviewer can trust, or a bill anyone can see. This is the practice that grew across the projects here to fix both, and the numbers it produced. The long-form version is the blog post Keeping the receipts (2026-08-17).

The contract

Every repository carries a CLAUDE.md the agent reads before it does anything: hard rules first (data-safety guardrails, the one source of truth for each fact, "never push", what is out of scope), then the project's non-obvious conventions, then banned patterns with before/after examples. Projects mandate a changelog entry per change, structured logging only, and a committed phase plan before implementation. The contract is what makes a fresh session cheap: the agent starts cold and already knows the rules.

Plan, todo, done

Three files per project. TODO.md is intake. PLAN.md is the live plan, updated as work happens, with a rule against ticking a box before the exit criteria are met. DONE.md is the timeline of what shipped, dated, original wording kept. Review audits (REVIEW.md) are worked to closure with a written resolution or a written "won't do" per finding: hoppr's audit ran as milestones and grew the test suite along the way; drumpy's closed every finding and shrank its largest module.

Verification the agent can use

An agent can't see the app, so each project builds a channel it can read instead:

Session tracking

The agent's transcript is the "how" behind every commit, and the tool prunes it after thirty days. So the end of every session runs a wrap-up that archives the raw transcript into the repository, derives a readable thread from it, and refreshes a stats.json with commits, lines, tokens and list-price cost per day. Each commit carries a trailer naming the session it came from, so a line of code can be blamed to the conversation that wrote it. A portable playbook and a shared library carry the practice to every live repository; a private service indexes all of it.

Step chart of cumulative tokens across drumpy's Claude Code sessions, April through early July, rising to 2.1 billion
Cumulative tokens across drumpy's sessions, one point per day with a session, from the per-turn usage in the archived transcripts. From the blog post.

The cost lever

Once the sessions were in the repository, the total was a sum away, and the shape of it was the surprise: on drumpy 98% of all tokens are cache reads. Long sessions are expensive because every turn re-reads the whole conversation, not because the model writes a lot. A turn at 500 k of context costs about five times a turn at 100 k, so the lever is context × turns.

The practice changed accordingly: one item of work per session, commit, wrap up, end; the next unit starts cold because the plan and the log already say where things stand; big reads go to subagents whose context dies with them. Measured on lifecast before and after the change, per commit and per line so the app maturing doesn't get credited to the discipline:

lifecastsessionsturns / commitavg contexttokens / committokens / 100 lines
before613280 k3.7 M2.9 M
after1110140 k1.4 M1.6 M

From the blog post; tokens at list price from the per-turn usage in the transcripts.

Per commit that is a 2.7× drop. Turns per commit fell a little; the context under each turn fell by half, and ending the session is the one lever that pulls both.

The numbers

drumpy
commits290
lines of code47 k
tokens, all sessions2.2 B
of which cache reads98%
agent turns10 k
list-price cost~$1.6 k
sessions archived93

drumpy docs/sessions/stats.json, generated 2026-09-01, counting each streamed assistant message once. The dollar figure is a list-price estimate from a hand-maintained pricing table, not what a subscription bills.