Rescue OpenClaw stuck? Gateway, auth, tunnel, and VPS troubleshooting. Get help →
← Back to Blog

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 →

Get guides like this in your inbox every Wednesday.

No spam. Unsubscribe anytime.

You'll probably need this again.

Press Cmd+D (Mac) or Ctrl+D (Windows) to bookmark this page.

Need OpenClaw fixed live?

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

See Rescue Session

Next useful step

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.
Restart Claude Code Sessions at 200K Tokens (Save Up to 80%) (2026)
Every Claude Code message resends the full conversation. Past 200K tokens the cost per message balloons. Restarting with a handoff doc cut one developer's bill from $1,600 to $320.
Fix the claude -p $1,800 API Bill Trap (2026)
The claude -p print-mode flag bills via API even on a paid Max plan — one overnight run hit $1,800. Here is how to check your auth mode and never get burned.