← 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.

Bleeding money on Claude Code or OpenClaw?

We apply the full cost checklist live and set up monitoring. See training and cost-audit options →

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.

Need help?

If you want every fix applied and verified with monitoring, we do the whole checklist live in one session. See training and cost-audit options →

Need OpenClaw fixed live?

Remote rescue sessions for gateway, auth, tunnel, VPS, and model access problems.

See Rescue Session

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 Burn Your Usage Limit Faster? (2026)
How subagent and agent team token mechanics actually work, why parallel agents drain a weekly limit, and the levers that cut the cost.