[DOCS] Environment variables reference missing `CLAUDE_CODE_EXTRA_BODY` request-body override documentation
Documentation Type
Missing documentation (feature not documented)
Documentation Location
https://code.claude.com/docs/en/env-vars
Section/Topic
Environment variables table / request customization for model API calls
Current Documentation
The docs currently describe adjacent request-customization settings, but not the extra request-body override mentioned in the changelog.
The environment variables reference says:
ANTHROPIC_CUSTOM_HEADERS| Custom headers to add to requests (Name: Valueformat, newline-separated for multiple headers)
CLAUDE_CODE_EFFORT_LEVEL| Set the effort level for supported models. Values:low,medium,high,max(Opus 4.6 only), orautoto use the model default.
ANTHROPIC_VERTEX_BASE_URL | Override the Vertex AI endpoint URL. Use for custom Vertex endpoints or when routing through an LLM gateway.
The LLM gateway guide says:
3. Vertex rawPredict::rawPredict,:streamRawPredict,/count-tokens:rawPredict* Must forward request headers:anthropic-beta,anthropic-version
No documentation currently exists for CLAUDE_CODE_EXTRA_BODY or for using it to inject request-body fields such as output_config.effort.
What's Wrong or Missing?
Changelog v2.1.113 says:
FixedCLAUDE_CODE_EXTRA_BODYoutput_config.effortcausing 400 errors on subagent calls to models that don't support effort and on Vertex AI
This confirms that Claude Code exposes a user-facing request-body override mechanism through CLAUDE_CODE_EXTRA_BODY, but the docs do not explain it anywhere.
A. The variable itself is undocumented
Users cannot discover that this environment variable exists, what it is for, or where it should be configured.
B. Safe usage constraints are undocumented
The existing docs say effort is only supported on specific models, and subagents can also set effort, but there is no guidance that injecting output_config.effort through an extra request body can cause 400 errors on unsupported models or provider integrations such as Vertex AI.
C. Scope across subagents/provider routes is undocumented
Because the bug affected subagent calls and Vertex AI, users need documentation for whether this override applies to child/subagent requests, provider-specific request shapes, and gateway/third-party deployments.
Suggested Improvement
Add a dedicated CLAUDE_CODE_EXTRA_BODY entry to the environment variables reference and cross-link it from the gateway/provider docs.
The new documentation should cover:
- What
CLAUDE_CODE_EXTRA_BODYdoes and which requests it modifies. - The accepted value format and a minimal example.
- Whether it applies to subagents/background agent calls as well as the main session.
- A warning that
output_config.effortshould only be injected for models/providers that support effort. - Provider-specific caution for Vertex AI / gateway deployments where request-body compatibility differs from Anthropic-hosted requests.
It would also help to add a short cross-reference from the effort and third-party provider docs back to this env var.
Impact
Medium - Makes feature difficult to understand
Additional Context
Affected Pages:
| Page | Context |
|------|---------|
| https://code.claude.com/docs/en/env-vars | Primary reference where CLAUDE_CODE_EXTRA_BODY should be documented |
| https://code.claude.com/docs/en/model-config | Documents that effort is supported only on certain models |
| https://code.claude.com/docs/en/sub-agents | Documents that subagents can inherit or override effort |
| https://code.claude.com/docs/en/google-vertex-ai | Vertex AI setup and provider-specific behavior |
| https://code.claude.com/docs/en/llm-gateway | Gateway request-shape requirements, including Vertex rawPredict |
Total scope: 5 pages affected
Source: Changelog v2.1.113
Exact changelog entry: Fixed CLAUDE_CODE_EXTRA_BODY output_config.effort causing 400 errors on subagent calls to models that don't support effort and on Vertex AI
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗