Ai Coding 4 min read

How to Control Token Budgets in Claude Code via Effort Levels

Learn how to configure model selection and the new effort parameter in Claude Code to optimize token spend and agentic task thoroughness.

Anthropic’s July 2026 update to Claude Code introduces a new effort parameter that replaces raw token budgets for controlling how deep the agent explores a codebase. You can now define explicit effort levels that govern how many files the agent reads, how many tools it invokes, and how many steps it takes before halting. This guide covers how to configure these limits, choose the right default model for your workload, and configure session security.

Configuring Effort Levels

The effort parameter is a control mechanism that trades response thoroughness for token efficiency. For newer models including Claude Sonnet 5 and Claude Opus 4.6 and above, this parameter entirely replaces the deprecated budget_tokens setting. It manages the total operational budget rather than acting as a simple timer for internal reasoning.

Anthropic recommends pairing the effort parameter with adaptive thinking configurations.

{ “thinking”: { “type”: “adaptive” }, “effort”: “xhigh” }

There are five available effort levels you can assign to your tasks.

LevelDefault ForBest Use Case
low-Routine tasks, fast operations, and answering from memory without extensive file reads.
medium-Standard single-file edits and isolated debugging.
highSonnet 5, Opus 4.8General multi-step coding tasks requiring tool usage.
xhigh-Complex coding and agentic use cases on Opus 4.7 and 4.8.
max-Deep architectural migrations and complex debugging with no token spending constraints.

Using the max effort level allows the model to run exhaustively. This setting consumes significant tokens as the model will repeatedly read files, execute sub-commands, and test assumptions until it reaches a hardware or platform limit.

Model Selection and Pricing

Claude Code now defaults to Claude Sonnet 5. You can switch models based on the required context length and reasoning capability of your immediate task.

Claude Sonnet 5

Sonnet 5 acts as the daily driver for standard development workflows. It includes a 1-million-token context window, making it suitable for large repository ingestion. Through August 31, 2026, Sonnet 5 utilizes introductory pricing of $2 per million input tokens and $10 per million output tokens.

Claude Fable 5

Fable 5 is Anthropic’s most capable model, redeployed to the platform on July 1, 2026. You should select Fable 5 when running long-lived background processes or complex multi-step generation tasks. Its architecture handles extended state management when you need to orchestrate parallel subagents over long periods.

Claude Opus 4.8

Opus 4.8 remains the recommended model for deep causal debugging and multi-file refactoring. It currently holds an 80.9% success rate on the SWE-bench Verified benchmark. Developers dealing with legacy code migrations frequently pair Opus 4.8 with the xhigh effort level to balance cost and resolution accuracy.

Session Security and Dynamic Workflows

The July 2026 CLI updates introduce stricter controls over how Claude Code accesses your local environment.

The /config menu now includes a dynamic workflows setting. This allows you to guide the size of dynamic workflows by specifying whether the system should spawn small, medium, or large agent counts for a given task. This prevents runaway agent generation on unbounded problems.

For security, Claude Code now prominently displays a grey badge in the terminal footer when Manual Permission Mode is active. This ensures you always know when the agent requires explicit approval before executing system commands or writing files.

Administrators can also lock down file access using the new sandbox.credentials setting. Enabling this prevents sandboxed commands from reading dotfiles, .env files, or known secret directories during execution.

Finally, the CLI now applies readable default names to new sessions and displays active warnings for expiring logins. This prevents long-running background tasks from silently failing due to expired authentication tokens.

Review your global /config to ensure your default model and effort levels match your standard token budget. If you regularly build large applications with the CLI, consider setting your default effort to low for routine scaffolding and explicitly requesting xhigh only when diagnosing complex bugs.

Get Insanely Good at AI

Get Insanely Good at AI

The book for developers who want to understand how AI actually works. LLMs, prompt engineering, RAG, AI agents, and production systems.

Keep Reading