Token efficiency
Programmatic tool calling reduces token consumption in three ways:
- Tool results from programmatic calls are not added to Claude's context - only the final code output is
- Intermediate processing happens in code - filtering, aggregation, and other transformations don't consume model tokens
- Multiple tool calls in one code execution - reduces overhead compared to separate model turns
For example, calling 10 tools directly uses ~10x the tokens of calling them programmatically and returning a summary.
In Anthropic's internal evaluations on a production Claude model:
- On a 75-tool project-management agent benchmark, enabling programmatic tool calling reduced billed input tokens by roughly 38% with no change in task accuracy.
- On τ²-bench (airline, retail, and telecom domains), where each turn makes one or two sequential tool calls, programmatic tool calling left scores unchanged and cost roughly 8% more. Sequential single-call workflows do not benefit.
- Across production API traffic, requests whose
toolsarray contains 10 to 49 tool definitions see typical token savings of 20% to 40% with programmatic tool calling enabled.
Actual savings vary with workload shape. See When to use programmatic calling.