How to reduce Claude Code token usage: 9 settings that work

Updated

Nine changes that reduce Claude Code token usage, ordered by how much context they remove. Each one is a documented Claude Code setting or command. Put the settings in ~/.claude/settings.json; the env block applies to every new session.

1. Clear between tasks

Type /clear when you start something new. Every later call stops re-reading the old task.

2. Compact at a size you choose

CLAUDE_CODE_AUTO_COMPACT_WINDOW (or the autoCompactWindow setting) takes a value from 100000 to 1000000. On 1M-context models, the default lets a chat grow very large first. A smaller window compacts sooner, so each call re-reads less.

3. Cap MCP tool output

MAX_MCP_OUTPUT_TOKENS sets the largest MCP result Claude Code keeps. The default is 25000 tokens.

4. Cap Bash output

BASH_MAX_OUTPUT_LENGTH is in characters. The default is 30000 and the maximum is 150000. The bashOutputMaxChars setting does the same.

5. Run subagents on a cheaper model

CLAUDE_CODE_SUBAGENT_MODEL sets the default model for subagents. Search and read work rarely needs the largest model.

6. Lower effort for routine work

Use /effort, or the effortLevel setting (low, medium, high, xhigh,max). modelSettings sets it per model. The CLAUDE_CODE_EFFORT_LEVEL variable overrides both.

7. Keep MCP tools deferred

Claude Code can load MCP tool definitions only when they are needed. This is on by default, but not when ANTHROPIC_BASE_URL points to a non-Anthropic host. In that case set ENABLE_TOOL_SEARCH=true.

8. Remove tools you never use

A bare tool name in permissions.deny removes that tool from what the model sees, so its schema stops riding along in every request.

9. Ask for shorter answers

An output style with keep-coding-instructions: true adds instructions without replacing Claude Code's own. “No preamble, no recap, code over prose” cuts reply tokens. Output is priced five times higher than input.

Want to know which of these matters for you first? See what a real week spends its tokens on.

More guides