Lower the MCP Tool Search Threshold to Save Tokens
Every MCP server you configure adds tool definitions to your context window, even when you're not using them. When those definitions exceed 10% of your context, Claude Code automatically defers them and loads tools on-demand via tool search. But you can trigger this earlier.
export ENABLE_TOOL_SEARCH=auto:5
Setting the threshold to auto:5 means tool search kicks in when MCP tool descriptions exceed just 5% of your context window. Deferred tools only enter context when actually used, so a lower threshold means fewer idle definitions eating your tokens.
This is especially useful if you have several MCP servers configured but only use one or two in a given session. Instead of paying for all those tool definitions on every message, only the tools Claude actually calls get loaded.
You can check what's consuming your context space at any time:
> /context
This shows you exactly how much space tool definitions, system prompts, and conversation history are taking up.
For maximum savings, combine this with disabling unused MCP servers via /mcp and preferring CLI tools like gh or aws that don't add persistent tool definitions at all.
Set a lower tool search threshold and stop paying for tools you're not using.
Log in to leave a comment.
When Claude starts referencing files you've since deleted, remembering old code you've already changed, or getting confused by contradictory instructions from a long session — type /clear to wipe the slate clean. Unlike /compact which preserves context, /clear gives you a true fresh start without restarting the CLI.
Not every task needs deep reasoning. Type /fast to switch Claude Code into fast mode — same model, faster output — for quick edits, simple questions, and routine changes. Toggle it off when you need Claude to think harder on complex problems.
Long sessions eat through your context window as conversation history piles up. Type /compact to summarize the conversation so far and reclaim space — keeping Claude's understanding of what you're working on while freeing up room for more work.