How We Cut 70% of Multi-Agent Token Waste by Replacing Supervisor LLMs with Typed State Machines A developer redesigned a multi-agent AI runtime by replacing a central supervisor LLM with a deterministic typed state machine, cutting token consumption by more than 70% and eliminating non-deterministic supervisor drift. In the new design, worker agents return schema-validated receipts with explicit transition keys instead of free-form prose, and constraints are encoded as code-level transition guards rather than long supervisor prompts. Raw LLM transcripts are sealed to persistent storage while only the receipt is passed forward to the state machine. If you have built a multi-agent AI system over the past two years, you have almost certainly encountered what we call the Supervisor Tax . The pattern usually starts with clean intentions: you have 3–4 specialized subagents a researcher, an executor, an evaluator, and a reporter coordinated by a central "Supervisor" or "Router" LLM. The supervisor inspects intermediate outputs, decides who gets called next, evaluates task completion, and synthesizes the final response. In local testing with 2 steps, it works great. But once you deploy it against real workloads with flaky APIs, 40-step workflows, and messy user requests, three problems immediately emerge: Here is how we redesigned our agent runtime to cut 70%+ of token consumption and eliminate non-deterministic supervisor drift. LLMs are extraordinary at fuzzy cognitive translation: understanding ambiguous user intent, parsing unstructured tool output, and authoring code or summaries. They are remarkably inefficient and unreliable at finite state routing. ❌ Traditional Hierarchical Supervisor Every Step Re-evaluates Context User Request │ ▼ ┌──────────────┐ Raw Prompt + History │ Supervisor │ ──────────────────────────► Worker Agent 1 │ LLM │ ◄────────────────────────── Natural Language Output └──────────────┘ Balloons Context Window │ ▼ ┌──────────────┐ │ Supervisor │ ──────────────────────────► Worker Agent 2 │ LLM │ ◄────────────────────────── ... └──────────────┘ ──────────────────────────────────────────────────────────────────────────── ✅ Typed State Machine Zero-Token Deterministic Handoff User Request ──► Intent Classifier / Fast Model ──► { State: RESEARCH } │ ▼ Worker Agent 1 │ ▼ Emits Typed Receipt { status: "SUCCESS", ... } │ Deterministic Transition Rule │ ▼ { State: CODE EXEC } When you replace the supervisor LLM with a deterministic typed state machine e.g. using XState, a custom DAG, or a lightweight transition matrix , every agent step has an explicit contract: Instead of letting worker agents dump markdown or free-form prose back to a coordinator, every leaf agent must return a schema-validated receipt. // types/agent-receipt.ts export interface AgentReceipt