# Reduce token usage in Claude Code

> Claude Code already does 3 of the fixes for you, and 8 settings cut more. Agent type: using a coding agent. From Use Fewer Tokens, by StackOne.

Last checked: 30 Nov 2026, against the vendor's own pages.

## What Claude Code already does
- **Load tools when needed**: Tool search defers MCP tools (ENABLE_TOOL_SEARCH, auto:N to tune). ([source](https://code.claude.com/docs/en/mcp#scale-with-mcp-tool-search), read 30 Nov 2026)
- **Prompt caching**: The prompt is cached for you; ENABLE_PROMPT_CACHING_1H=1 keeps it an hour on API keys. ([source](https://code.claude.com/docs/en/prompt-caching), read 30 Nov 2026)
- **Clear old tool results**: Auto-compaction summarises old turns; CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=50 makes it compact earlier. ([source](https://code.claude.com/docs/en/env-vars), read 30 Nov 2026)

## Settings that cut more in Claude Code
- **Measure what fills the window**: /context, /usage, /skill-doctor, /doctor prompt-audit. ([source](https://code.claude.com/docs/en/commands), read 30 Nov 2026)
- **Turn off tools you don't use**: /mcp to switch off servers you don't use; prefer CLIs such as gh over an MCP server. ([source](https://code.claude.com/docs/en/costs#reduce-mcp-server-overhead), read 30 Nov 2026)
- **Let the agent run code over results** (experimental): CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 (v2.1.323 or later, interactive terminal). ([source](https://code.claude.com/docs/en/code-mode), read 30 Nov 2026)
- **Cap tool output**: MAX_MCP_OUTPUT_TOKENS (default 25,000) and BASH_MAX_OUTPUT_LENGTH (default 30,000 characters). ([source](https://code.claude.com/docs/en/env-vars), read 30 Nov 2026)
- **Read web pages as text**: npm i -g agent-browser, then npx skills add vercel-labs/agent-browser. ([source](https://github.com/vercel-labs/agent-browser), read 30 Nov 2026)
- **Keep instruction files short**: Keep CLAUDE.md under 200 lines; move detail into skills. ([source](https://code.claude.com/docs/en/memory), read 30 Nov 2026)
- **Run side tasks on a smaller model**: model: haiku in the subagent's file, or CLAUDE_CODE_SUBAGENT_MODEL=haiku for all. ([source](https://code.claude.com/docs/en/env-vars), read 30 Nov 2026)
- **Lower the effort setting**: /effort low for lookups, or CLAUDE_CODE_EFFORT_LEVEL=low. ([source](https://code.claude.com/docs/en/env-vars), read 30 Nov 2026)

## With StackOne
- **Deep Query**: Add https://mcp.stackone.com/mcp, then ask in plain words
- **Load tools when needed**: Add https://mcp.stackone.com/mcp; Advanced Tool Search is on by default
- **Ask for fewer fields**: source on any _s1query call
- **Keep live questions live**: Keep the live action next to the _s1query tool
- **Tool Policies**: Tool Policies on the project

## Other techniques for coding agents
- [Batch scheduled jobs](https://usefewertokens.com/techniques/batch/): not available. Interactive.

## Links
- Optimizer set to Claude Code: https://usefewertokens.com/harnesses/claude-code/
- Claude Code on the MCP clients scorecard: https://mcpclients.dev/clients/claude-code/
- Connect Claude Code to StackOne: https://www.stackone.com/platform/mcp/ai-agent/claude-code/
- How to reduce AI agent token usage: https://www.stackone.com/blog/reduce-ai-agent-token-usage/
