Claude Code's tool search defers 40,000+ tokens of MCP definitions by default

A developer tested Claude Code v2.1.263 and found that its default 'tool search' feature withholds 88 MCP tool definitions from the initial prompt, cutting first-request input tokens from roughly 61,000 to around 21,000. The feature, enabled by default via the ENABLE_TOOL_SEARCH environment variable, loads only tool names and server instructions at session start, pulling full schemas only when Claude explicitly requests a tool. This explains why users who added multiple MCP servers in recent months noticed little to no context window shrinkage compared to earlier behavior. However, the auto:5 threshold mode — which defers tools only after they exceed 5% of the context window — loaded all 88 definitions anyway in testing, resulting in even more tokens than the fully upfront setting. The feature requires a Claude 4.5-generation model or later and is automatically disabled when a non-Anthropic base URL is detected, as most proxies cannot handle the tool_reference blocks it depends on.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in