Black Friday week: local AI hardware on sale. See the list.
← All guides

ENABLE_TOOL_SEARCH: Cut Claude Code's 45K-Token Tool Tax (2026)

By default Claude Code injects every registered tool definition into every turn — averaging about 45,000 tokens per turn just for tool descriptions. ENABLE_TOOL_SEARCH lazy-loads them instead.

Jump to 4 sections
  1. The one-line settings change
  2. Enabling it for OpenClaw
  3. Stack it with the other fixes
  4. Related cost guides

The fix: add "ENABLE_TOOL_SEARCH": "true" to the env block in ~/.claude/settings.json. Tool definitions then lazy-load — the model searches for the tools it needs instead of injecting every schema each turn. Per-turn context drops from ~45K to ~20K tokens, a 55% cut on the tool-schema portion of your prompt, typically $50-100/month at Sonnet rates, with no downside.

The one-line settings change

{
  "env": {
    "ENABLE_TOOL_SEARCH": "true"
  }
}

Add that to ~/.claude/settings.json. A 926-session audit over 33 days totaled $1,619 — most of it was this tool-schema tax injected on every single turn.

Enabling it for OpenClaw

OpenClaw does not yet expose an identical flag under its own config, but any agent you wire to Claude through the OpenClaw gateway inherits the underlying Claude Code settings. Edit ~/.claude/settings.json, add the env block, then restart the gateway:

openclaw gateway restart

Check the next session’s token count to confirm the per-turn context dropped.

Stack it with the other fixes

ENABLE_TOOL_SEARCH cuts the input side of the bill (tool schemas). Pair it with Caveman Mode on the output side and you have recovered most of what a fresh session costs. Add compactThreshold and subagentModel in settings.json for another 30-50% on top. Auditing your MCP servers helps too — each enabled server adds 2-5K tokens per turn even when unused.

Was this guide useful?

Read next

Caveman Mode for Claude Code: Cut Output Tokens 61-75% (2026)
Caveman Mode is a CLAUDE.md snippet that strips preambles, summaries, and filler to cut Claude Code output tokens 61-75% — about $100-140/month saved with no loss of code quality.
Stop Hitting Claude Code Usage Limits: Best Tools and Settings (2026)
How Claude Code limits actually work, the free habits that cut token burn, and 8 verified open-source tools that stretch a Pro plan.
Claude Code Hooks That Cut Token Burn: 5 Real Configs (2026)
Most people use Claude Code hooks for desktop notifications. Here are five verified hook configs that block expensive tool calls before they run and pay for themselves.
Do Claude Code Subagents Use More Tokens? (2026): Yes
Yes. Each subagent pays its own startup context and counts toward your limit. Claude Code runs 20 at once, 3 levels deep. The levers that cut it.