Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Token Forensics for Agent Runs: Five Waste Signatures and the Order to Fix Them

Description and use

A nightly agent exceeded its token budget early due to structural waste—retries, static tokens, and prompt growth. Implementing a per‑step meter identified these issues, and targeted fixes reduced costs and improved output quality.

Problem

Nightly agent jobs exceeded token budgets early, producing few usable outputs.

Outcome

The meter revealed that structural waste, not model cost, caused budget overruns. Fixing retry amplification, static token overhead, and prompt growth reduced token consumption and improved output quality.

Workflow

  • Measure per‑step token usage using the provided meter script.
  • Identify waste signatures: static token overhead, reused context, retry amplification, prompt growth, and leaf branching.
  • Prioritize fixes: stop rule for retries, shrink system prompt and tool schemas, reduce redundant context, limit leaf suggestions, and control prompt growth.
  • Apply fixes incrementally and re‑measure to confirm cost reduction.
  • Iterate until token budget aligns with expected usage.

Evidence

It was not the model. It was step 7 resending the same 4,000-token tool output on every attempt, after a validation failure that fired four times.

Source

Measure per step first. Then the routing question becomes answerable with numbers instead of vibes.

Source

You need three numbers per step that providers already return in usage, plus two annotations you add yourself: how many tokens are static, and how many are reused from an earlier step.

Source

  • Record date: 2026-10-20T10:41:03.968Z