Handoffs can turn one task into a 15x token bill

LangGraph multi-agent workflow guide to token usage tracing, state pruning, handoffs, and official docs.

Handoffs can turn one task into a 15x token bill
Share

Handoffs are useful when a specialist agent needs to take over a task. They also make cost easier to hide, because the bill is spread across graph nodes instead of one visible chat turn.

Why can LangGraph handoffs multiply tokens?

Screenshot of https://www.anthropic.com/engineering/multi-agent-research-system

LangGraph handoffs can multiply tokens because each model-calling node may resend instructions, prior messages, retrieved material, tool returns, summaries, and artifacts, then loops or handoffs repeat that payload for the next agent. Token amplification is the total prompt-plus-completion tokens across a trace divided by a simpler baseline for the same task; Anthropic reported in June 2025 that multi-agent systems used about 15x more tokens than chats while improving an internal research evaluation by 90.2% .

Quick Answer: Handoffs raise the token bill when each agent receives copied context instead of a narrow task packet. Anthropic’s June 2025 research system showed the tradeoff clearly: multi-agent runs used about 15x more tokens than chats while scoring 90.2% higher on its internal research evaluation .

In LangGraph, the practical issue is observability and budgeting, not whether graphs are bad. The LangGraph project describes the runtime as a way to build stateful, long-running agents with persistence, human control, memory, and debugging support; those same traits make it possible to measure where context grows instead of guessing.

"Multi-agent systems are often highly effective at open-ended research tasks, but token usage can be substantial," — Anthropic engineering team at Anthropic

The small verified demo below shows the arithmetic behind a 15x bill: a 100-token task becomes 1,500 billed tokens when 5 agents each receive 3 copies of the relevant context .

"""Tiny token-accounting demo: handoffs multiply the same task context."""

task_tokens = 100
agents = 5
context_copies_per_handoff = 3  # instructions + task + summary/history

direct_bill = task_tokens
handoff_bill = task_tokens * agents * context_copies_per_handoff

print(f"Direct one-agent task: {direct_bill} tokens")
print(f"Handoff workflow: {agents} agents x {context_copies_per_handoff} context copies x {task_tokens} tokens")
print(f"Token bill: {handoff_bill} tokens ({handoff_bill / direct_bill:.0f}x)")

Prerequisites before tracing LangGraph spend

Screenshot of https://docs.langchain.com/oss/python/langchain/multi-agent/handoffs

Before tracing LangGraph spend, decide whether the task truly needs graph-shaped coordination or whether a single agent with better tools is enough. LangChain’s multi-agent guide warns that multi-agent systems add model calls and tokens, and that simpler agent designs are often cheaper for tasks that do not require specialist handoffs .

Use LangSmith tracing before changing the graph. A trace should let you inspect each LLM call, prompt formatting span, retrieval step, tool invocation, and graph node as part of one trace tree . Without that structure, “handoffs are expensive” stays too vague to fix.

Capture usage metadata wherever the provider exposes it: input tokens, output tokens, total tokens, model name, provider name, and cost fields. LangSmith’s LLM trace logging docs describe usage metadata fields for token and model accounting , while its cost-tracking docs show token and cost totals in trace views and project dashboards .

Finally, create a baseline. Run the same task through a single-agent or router-only path, then compare total graph tokens against that baseline. Raw spend is useful for billing; amplification is useful for engineering decisions.

Numbered steps to find the expensive path

Numbered steps to find the expensive path

The fastest way to find expensive LangGraph handoffs is to compare each traced graph run against a simpler baseline, then attribute the extra tokens to specific nodes, loop turns, and handoff boundaries. LangSmith traces represent a workflow as runs or spans, so model calls, retrieval calls, tool invocations, and prompt-formatting work can be inspected as separate units .

  1. Run the same task through the simplest viable path first: a single agent, a router-only flow, or a manually invoked tool path. Record total tokens, model-call count, final answer length, and whether the answer met the task criteria.
  2. Run the LangGraph version with LangSmith tracing enabled. Group spend by node, transition, loop iteration, handoff source, and receiving subgraph. LangSmith cost tracking exposes token and cost totals in trace trees, project stats, and dashboards .
  3. Add stable trace tags before comparing runs: graph_version, node_name, active_agent, handoff_source, handoff_destination, task_type, and benchmark_case. LangSmith custom LLM traces can record usage metadata including input tokens, output tokens, total tokens, token details, and costs .
  4. Calculate amplification as total graph tokens divided by baseline tokens. Then calculate delivery efficiency as total graph tokens divided by final delivered output tokens. The first ratio shows orchestration overhead; the second shows how much invisible coordination was spent per visible answer token.
  5. Compare your trace against public pattern data instead of guessing. LangChain’s multi-agent guide reports that a one-shot coffee task uses 4 model calls with subagents versus 3 with handoffs, skills, or routers, while multi-domain handoffs can exceed 14K tokens when conversation history grows across domains .
Metric Why it matters Where to inspect it
Total graph tokens Shows the full prompt-plus-completion bill for the workflow. LangSmith trace tree and cost dashboard
Model-call count Separates repeated reasoning from large-context copying. Trace runs or spans
Handoff count Identifies where agent-to-agent context transfer may be inflating spend. Tagged transitions and receiving subgraphs
Final answer length Reveals workflows that spend heavily on coordination but deliver little output. Application log or final response span

The verified toy calculation below is intentionally small, but it captures the accounting shape: repeated handoffs can copy the same task context many times.

"""Tiny token-accounting demo: handoffs multiply the same task context."""

task_tokens = 100
agents = 5
context_copies_per_handoff = 3  # instructions + task + summary/history

direct_bill = task_tokens
handoff_bill = task_tokens * agents * context_copies_per_handoff

print(f"Direct one-agent task: {direct_bill} tokens")
print(f"Handoff workflow: {agents} agents x {context_copies_per_handoff} context copies x {task_tokens} tokens")
print(f"Token bill: {handoff_bill} tokens ({handoff_bill / direct_bill:.0f}x)")

Gotchas when pruning LangGraph state

Pruning LangGraph state is safe only when you separate short-term graph state from long-term stored memory before deleting, trimming, or summarizing messages. LangGraph’s memory guidance treats short-term memory as state carried through the graph, while long-term memory belongs in a store that can be retrieved when needed .

The first trap is deleting text that still makes the provider message history valid. If an assistant message includes tool calls, the matching tool result messages need to remain in the right order; otherwise the next model call may fail or behave differently. Use token-aware trimming so the budget is based on what the model actually receives, not on character count or message count alone.

The second trap is summarizing too early. A compact summary is useful for old turns, but keep the recent decision context, active instructions, current artifacts, and any unresolved tool outputs intact. Summaries should replace stale conversational bulk, not the evidence the next node needs to choose a tool, route to another agent, or produce the final answer.

The third trap is treating every handoff as a full transcript transfer. For subgraph handoffs, LangChain’s handoff guidance makes the payload choice explicit: pass only the triggering AIMessage, the matching ToolMessage, a clear task description, and selected artifacts when the receiving agent does not need the whole conversation .

  • Keep: current user goal, active constraints, unresolved tool results, and artifact references.
  • Trim: repeated chat history, stale scratchpad text, verbose retrieved documents, and intermediate worker chatter.
  • Move: durable preferences, reusable facts, and project memory into long-term storage instead of copying them through every node.

Next experiments after the trace is clean

A clean LangGraph trace is the starting point for experiments, not proof that handoffs are worth keeping. The next step is to compare cheaper and more complex paths under the same task set, token budget, and success rubric, because Google reported in January 2026 that multi-agent coordination helped parallelizable tasks but degraded sequential ones across 180 configurations and five architectures .

  • Test whether parallel branches improve value-weighted task success, not just trace activity. Google found centralized coordination improved Finance-Agent performance by 80.9%, while multi-agent variants degraded PlanCraft by 39-70% .
  • Run a fixed-token-budget comparison against a single-agent baseline. Tran and Kiela’s 2026 preprint argues that some multi-agent gains disappear when extra test-time compute is controlled .
  • Replace copied subagent transcripts with artifact references, compact findings, or structured fields. Anthropic’s June 2025 research-system writeup describes subagents writing results to external memory so the lead agent can coordinate without carrying every intermediate detail through chat history .

Promote the handoff path only when the measured gain justifies its added tokens, tool calls, retries, and latency. Anthropic reported a 90.2% improvement for its internal multi-agent research evaluation, but also said ordinary agents used about 4x more tokens than chats and multi-agent systems used about 15x more tokens than chats . The practical takeaway: keep the graph shape that buys measurable task quality, and delete the handoff that only buys coordination overhead.

Frequently asked questions

How do I measure token amplification in LangGraph?

Measure token amplification in LangGraph by dividing total prompt-plus-completion tokens across the LangSmith trace by a simpler baseline for the same task. LangSmith can track input tokens, output tokens, total tokens, and cost metadata for traced LLM runs . A second useful ratio is total graph tokens divided by final delivered output tokens, because it shows how much spend went into coordination rather than user-visible output.

Are handoffs always more expensive than subagents?

No. Handoffs are not always more expensive than subagents. LangChain’s multi-agent guidance frames cost in terms of model calls and tokens processed, and its examples show that pattern choice depends on task shape, especially whether work is repeated, sequential, or parallel . Handoffs can become inefficient when each receiving agent inherits a growing conversation history instead of a narrow task payload.

What should be removed from LangGraph state first?

Remove stale retrieved text, duplicated tool outputs, old scratchpad content, and full transcripts that can be replaced by summaries or artifact references. LangGraph memory guidance supports trimming messages, deleting messages, summarizing older messages, and filtering state as conversations approach context limits . Keep provider message history valid when tool calls are involved, because deleting only one side of an assistant-tool exchange can break downstream calls.

When is a multi-agent LangGraph design worth the cost?

A multi-agent LangGraph design is worth the cost when parallel search breadth, specialized tools, or durable state improves task success enough to justify extra tokens, latency, and debugging work. Anthropic reported that its multi-agent research system beat a single-agent baseline by 90.2% on an internal research evaluation, while also reporting about 15x token use versus chat interactions . Treat that as a budgeting rule: keep the graph when measurable quality rises, and simplify it when the trace only shows coordination spend.

Enjoyed this article? Subscribe to get new stories by email whenever they're published.

Subscribe

AI developer tools and ecosystem news for developers and technical founders

Sign up for insights and ideas

Subscribe for the latest news, stories, tips, and updates.

Subscribe