Measuring hung AI coding agents automatically with per-project time and token accounting
VCBU · reddit · 2026-07-21
What the post argues
AI coding agents have a blind spot: it’s hard to tell a session that’s actually working from one that’s silently hung. The author proposes making measurement a property of the code itself, rather than something remembered after the fact.
The pattern
They call the approach TMDD / ToDD / TTMDD:
- Time is measured automatically by the code, not manually.
- Tokens and their cost are treated as first-class inputs for model choice and context trimming.
- Agent time and user engagement time are tracked separately, even when they overlap.
- The hook installs with the machine build, so every new session is measured from the start.
What it captures
The system records:
- per-project time, including git worktree rollups
- per-model wall time from the transcript
- input, cache, and output costs separately
- agent active time vs. the human’s engagement time
The open questions
The author asks how others handle:
- cache vs. input vs. output billing
- whether to measure human engagement alongside agent runtime
- early hung-agent detection via timeouts, heartbeats, or something smarter
More from coding & agent
- Codex helps build Valdiluce, an open-world game with climbing, gliding and gondolas — Dimillian · 2026-07-22
- HeyGen adds a media-sourcing skill for coding agents with 75k images and 10k tracks — HeyGen · 2026-07-22
- Agent search bottlenecks are now about variance, not raw latency — rohanpaul_ai · 2026-07-22
- LangSmith adds tracing for Pipecat, LiveKit, OpenAI Realtime, and Gemini Live — LangChain · 2026-07-22
- An MCP server signs every AI agent tool call into a verifiable Merkle chain — Funky_Chicken_22 · 2026-07-22
- Annotated transcript of a Claude Code team interview is now available — trq212 · 2026-07-22