What it says

GitHub instrumented hundreds of production agentic workflows by capturing token usage at an API proxy into a normalized token-usage.jsonl artifact, then built two daily agentic workflows (auditor and optimizer) that flag anomalies and propose fixes. The main optimizations were pruning unused MCP tool registrations, replacing GitHub MCP data-fetching with gh CLI calls (pre-agentic downloads and in-agent proxy substitution), and measuring gains with an Effective Tokens (ET) metric that normalizes across model tiers. Results: Auto-Triage Issues -62% across 109 post-fix runs, Daily Compiler Quality -19%, Daily Community Attribution -37%, Security Guard -43%, Smoke Claude -59%. The post also flags confounds (workload shift, cache-read tokens), the missing outcome-level quality instrumentation, and a single misconfigured rule causing a 64-turn runaway loop.

Claims drawn from this source

  • A single API proxy can normalize token usage across agent frameworks. Each framework (Claude CLI, Copilot CLI, Codex CLI) emitted logs in different formats, so usage data was incomplete for historical runs. The proxy architecture captured token usage across all runs in one normalized format: a token-usage.jsonl artifact with one record per API call containing input tokens, output tokens, cache-read tokens, cache-write tokens, model, provider, and timestamps.
  • Daily agentic auditor and optimizer workflows close the loop on token spend. A Daily Token Usage Auditor reads token usage artifacts, aggregates consumption by workflow, and posts structured reports flagging significantly increased usage and anomalous runs (e.g. a workflow normally completing in four LLM turns taking 18). A Daily Token Optimizer cross-references tool manifests against actual tool calls and creates GitHub Issues describing concrete inefficiencies. The auditor and optimizer are agentic workflows themselves, so their own token usage appears in the daily reports.
  • Unused MCP tool registrations are the most common inefficiency. Because LLM APIs are stateless, agent runtimes include MCP tool names and JSON schemas with each request, so a 40-tool GitHub MCP server adds 10-15 KB of schema per turn. Removing unused tools from the MCP configuration reduced per-call context size by 8-12 KB, saving several thousand tokens per run with no change in behavior.
  • Replacing GitHub MCP data-fetching with gh CLI removes work from the reasoning loop. An MCP tool call is a reasoning step in addition to data retrieval: the agent must decide to call the tool, formulate arguments, and receive its output as context, a full round-trip LLM API call. gh pr diff is a deterministic HTTP request with no LLM involvement. Pre-agentic setup steps run gh commands before the agent starts and write results to workspace files; where the agent determines what to fetch at runtime, a transparent HTTP proxy routes CLI traffic without exposing auth.
  • Raw token counts confound efficiency with workload and model choice. Claude Haiku costs roughly 4x less per token than Sonnet, so the same workflow on different models looks unchanged in raw token counts. The Effective Tokens metric applies model multipliers (Haiku = 0.25x, Sonnet = 1.0x, Opus = 5.0x): ET = m x (1.0 x I + 0.1 x C + 4.0 x O), with output tokens carrying 4x weight. Workload variation on a live repository also masks efficiency gains, so the team tracks LLM API call counts alongside token counts; constant turns-per-run with falling tokens-per-call indicates genuine efficiency.
  • Optimizer results compound with run frequency. Auto-Triage Issues shows a sustained 62% reduction across 109 post-fix runs (6.8 runs per day, max 15); Daily Compiler Quality improved 19% over 12 runs; Daily Community Attribution 37% over eight runs; Security Guard 43% and Smoke Claude 59% in the gh-aw-firewall repo. Auto-Triage Optimization saved roughly 7.8M ET in aggregate assuming the pre-optimization rate.
  • Efficiency measurement is hard and outcome quality stays unobserved. Process-level signals (output tokens per LLM call, turn counts per run, tool-call completion rates) approximate quality but are not outcome signals. The Contribution Check workflow had 82-83% of input tokens as cache reads yet average ET rose 5%, because a burst of development activity shifted the workload from small to large pull requests. Measuring tokens-per-unit-of-correct-work requires outcome instrumentation that does not yet exist at scale.
  • One misconfigured rule distorted a whole run budget. Daily Syntax Error Quality was the highest-ET workflow in the project before optimization. The workflow copied test files to /tmp then called gh aw compile*, but the sandbox allowlist only permitted relative-path globs, so every compile attempt was blocked. The agent fell into a 64-turn fallback loop reading source code manually to reconstruct what the compiler would have told it. One fix to the allowed bash patterns eliminated the loop.