GitHub runs hundreds of agentic workflows across their repositories - automated triage, compiler quality checks, security audits. Each one calls an LLM. Each LLM call sends the full MCP tool schema to the API. A GitHub MCP server with 40 tools adds 10-15 KB of JSON schema per turn, whether the workflow uses 2 tools or 40.
Nobody was looking at the total until GitHub built an AI auditor to look for them.
The baseline
In February 2026, GitHub's agentic workflow infrastructure consumed 215,998,387 tokens in 30 days across 333 workflow runs from 49 unique workflows. Estimated cost at GitHub's internal pricing: $21.60. At retail Sonnet pricing, that number would be significantly higher.
The post, from Microsoft Research and GitHub engineering, introduces an Effective Token (ET) metric to normalize across model tiers:
ET = m × (1.0 × I + 0.1 × C + 4.0 × O)Where I = input tokens, C = cache-read tokens (cheaper), O = output tokens (most expensive), and m = model cost multiplier (Haiku = 0.25x, Sonnet = 1.0x, Opus = 5.0x). Without this normalization, switching from Sonnet to Haiku makes raw token counts look similar while actual cost drops by 4x.
Three techniques
1. Prune unused MCP tools. The default move for agentic workflow authors is to dump every available tool into the config and let the agent sort out what it needs. A workflow that only calls get_pull_request and create_comment was still carrying 38 other JSON schemas into every API call. After cross-referencing tool manifests against actual call logs and removing unused tools, the Auto-Triage Issues workflow dropped 8-12 KB per call. Result: -62% ET across 109 post-fix runs.
Extreme case: The Glossary Maintainer workflow called search_repositories 342 times in a single run - 58% of all tool calls - despite never needing it. The tool was in the config by default.
2. Replace MCP tool calls with pre-agentic CLI data downloads. An MCP tool call is an LLM reasoning step plus a full round-trip API call with JSON schema overhead. A gh pr diff command is a deterministic HTTP request. Where the agent only needs data, not reasoning, run gh commands before the agent starts and write the output to workspace files. The agent reads files instead of calling tools.
Smoke Claude went from baseline to -59% ET with tool pruning alone. Adding a model switch from Sonnet to Haiku (and preserving the same behavior) brought it to -79% ET.
3. Catch anomalies with an auditor. The Daily Token Usage Auditor reads artifact logs from recent runs, aggregates by workflow, and flags anomalies - workflows with significantly increased usage or turn counts outside normal range. The Daily Syntax Error Quality workflow was the highest-ET workflow on the board. Root cause: a one-line misconfiguration in a bash allowlist forced the agent into a 64-turn fallback loop reading source code manually instead of calling the compiler. One config change eliminated it.
What transfers
The techniques are framework-agnostic. The post documents Claude CLI, Copilot CLI, and Codex CLI all running through the same instrumentation layer. Both the gh-aw framework and gh-aw-firewall repos are public, and the token audit workflow can be added to any repo:
gh extensions install github/gh-aw
gh aw add githubnext/agentic-ops/copilot-token-auditOne honest note from the authors: quality signals (turn count, completion rate) stayed stable. But they cannot directly measure whether optimization degraded output quality - there is no ground-truth correctness for "was this PR triaged well." The Contribution Check workflow actually showed a 5% ET increase post-optimization because 65% of PRs in the post-period were large, against 39% before. Workload variation masks real improvements in both directions, which is a polite way of saying the numbers can look good or bad depending on when you measure them.