{"name":"CLAUDE_CODE_MAX_MCP_DESCRIPTION_LENGTH","slug":"claude-code-max-mcp-description-length","family":"env","title":"Environment variables","noun":"environment variable","description":"Maximum length in characters of each MCP tool description and each MCP server's instructions that Claude Code sends to the model (default: 2048). Claude Code [truncates longer text](\/docs\/en\/mcp#for-mcp-server-authors). Accepts a positive whole number in plain digits. Anything else is ignored and the default applies. Requires Claude Code v2.1.280 or later","description_source":"docs","described_by":{"doc":"claude-code\/env-vars","title":"Environment variables"},"presence":{"first_seen":"2.1.280","removed_in":null,"in_current_build":true,"newest_mined":"2.1.280","builds":1,"mined_builds":123,"first_cited":{"version":"2.1.280","released_at":"2026-09-22 15:44:39","spans":1}},"aliases":[],"entries":[{"version":"2.1.280","anchor":"mcp-outputdescription-truncation-length-now-overridable-via","heading":"MCP output\/description truncation length now overridable via env var","line":"MCP output and description truncation length is now configurable via CLAUDE_CODE_MAX_MCP_DESCRIPTION_LENGTH","released_at":"2026-09-22 15:44:39","reason":"found in this entry's text, named in this entry"}],"entries_total":1,"docs":[{"source":"claude-code","path":"env-vars","title":"Environment variables","documented":true},{"source":"claude-code","path":"changelog","title":"Claude Code changelog","documented":false},{"source":"claude-code","path":"mcp","title":"Connect Claude Code to tools via MCP","documented":false}],"docs_total":3,"gates":[],"related":[{"name":"CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS","slug":"claude-code-max-concurrent-subagents","description":"How many [subagents](\/docs\/en\/sub-agents#concurrent-subagent-limit) can be running in one session before the Agent tool refuses to spawn another (default: 20). Accepts a positive whole number in plain digits; anything else is ignored, so the variable can adjust the cap but can't disable it. Requires Claude Code v2.1.217 or later"},{"name":"CLAUDE_CODE_MAX_CONTEXT_TOKENS","slug":"claude-code-max-context-tokens","description":"Override the context window size Claude Code assumes for the active model. As of v2.1.193, how it applies depends on how Claude Code resolves the model ID; see [Correct the window for a gateway or custom model ID](\/docs\/en\/model-config#correct-the-window-for-a-gateway-or-custom-model-id). Use this when routing to a model through `ANTHROPIC_BASE_URL` whose context window does not match the built-in size for its name"},{"name":"CLAUDE_CODE_MAX_EFFORT_REMINDER","slug":"claude-code-max-effort-reminder","description":"A new reminder can appear in the status line when effort is set to max, pointing you to \/effort to change it"},{"name":"CLAUDE_CODE_MAX_OUTPUT_TOKENS","slug":"claude-code-max-output-tokens","description":"Set the maximum number of output tokens for most requests. Defaults and caps vary by model; see [max output tokens](https:\/\/platform.claude.com\/docs\/en\/about-claude\/models\/overview#latest-models-comparison). Claude Code defaults to 32000 for model IDs it doesn't recognize, such as gateway-specific names, and lowers values above a model's cap to the cap. Increasing this value reduces the effective context window available before [auto-compaction](\/docs\/en\/costs#reduce-token-usage) triggers"},{"name":"CLAUDE_CODE_MAX_RETRIES","slug":"claude-code-max-retries","description":"Override the number of times to retry failed API requests (default: 10). Capped at 15 as of v2.1.186; as of v2.1.199, `CLAUDE_CODE_RETRY_WATCHDOG` raises the default and removes the cap. For unattended sessions that need to wait through longer outages, set `CLAUDE_CODE_RETRY_WATCHDOG` instead"},{"name":"CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH","slug":"claude-code-max-subagent-spawn-depth","description":"Number of [subagent layers](\/docs\/en\/sub-agents#let-subagents-spawn-their-own-subagents) allowed below the main conversation (default: 3). At the default, subagents can spawn their own subagents, and a subagent at the third layer can't spawn further; set `1` to turn nesting off. In v2.1.217 through v2.1.218, the default was 1, so a subagent couldn't spawn its own unless you raised the limit; v2.1.219 raised the default to 3. Accepts a positive whole number in plain digits; anything else is ignored, so the limit can be adjusted but not removed. Requires Claude Code v2.1.217 or later"},{"name":"CLAUDE_CODE_MAX_SUBAGENTS_PER_SESSION","slug":"claude-code-max-subagents-per-session","description":"Removed in v2.1.224 and now a no-op. Previously capped the total number of [subagents](\/docs\/en\/sub-agents) Claude could spawn with the Agent tool in one session (default: 200); spawning past the cap failed with `Subagent spawn limit reached`. The [concurrent subagent limit](\/docs\/en\/sub-agents#concurrent-subagent-limit) and the [depth limit](\/docs\/en\/sub-agents#let-subagents-spawn-their-own-subagents) still apply"},{"name":"CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY","slug":"claude-code-max-tool-use-concurrency","description":"Maximum number of read-only tools and subagents that can execute in parallel (default: 10). Higher values increase parallelism but consume more resources"},{"name":"CLAUDE_CODE_MAX_TURNS","slug":"claude-code-max-turns","description":"Cap the number of agentic turns when no explicit limit is passed. Equivalent to passing [`--max-turns`](\/docs\/en\/cli-reference#cli-flags), which takes precedence when both are set. A value that is not a positive integer is rejected at startup with an error rather than treated as no cap"},{"name":"CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION","slug":"claude-code-max-web-searches-per-session","description":"Cap on the total number of [WebSearch](\/docs\/en\/tools-reference#websearch-tool-behavior) calls one session can make (default: 200). When Claude reaches the cap, further WebSearch calls return a notice telling it to continue with the information it already gathered. Accepts a positive whole number with no upper bound. Anything else is ignored and the default applies, so the cap can be raised but not turned off. Requires Claude Code v2.1.212 or later"}],"url":"https:\/\/changelogs.core-directive.com\/reference\/env\/claude-code-max-mcp-description-length","family_url":"https:\/\/changelogs.core-directive.com\/reference\/env.json"}