[BUG] "CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1" does not suppress anthropic-beta "advanced-tool-use-2025-11-20"
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
The latest versions of Claude Code (everything post-2.1.18) do not always honor the environment variable CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 which is documented as: "Set to 1 to disable Anthropic API-specific anthropic-beta headers. Use this if experiencing issues like “Unexpected value(s) for the anthropic-beta header” when using an LLM gateway with third-party providers"
Even if you set CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1, Claude will pass the following additional anthropic-beta header of advanced-tool-use-2025-11-20. This breaks setups using the recommended configuration from Claude through an LLM gateway when consuming Anthropic models through Bedrock or Vertex AI, as this beta header is not yet supported by either provider.
What Should Happen?
CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 should disable Anthropic API-specific anthropic-beta headers as the documentation states.
Error Messages/Logs
An example (wrapped) Vertex AI error response through LiteLLM looks like:
API Error: 400 {"error":{"message":"{\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"Unexpected value(s) `advanced-tool-use-2025-11-20` for the
`anthropic-beta` header. Please consult our documentation at docs.anthropic.com or try again without the header.\"},\"request_id\":\"req_vrtx_011CXWC8PWHg6fQyb7LXBcEs\"}. Received Model
Group=claude-opus-4-5\nAvailable Model Group Fallbacks=None","type":"None","param":"None","code":"400"}}
Steps to Reproduce
- Set up a basic LiteLLM instance according to https://docs.litellm.ai/docs/proxy/docker_quick_start
- Add an Anthropic model to LiteLLM offered through Vertex AI.
- Set up Claude Code to use a LiteLLM LLM Gateway Configuration using Anthropic's recommendation of "Unified endpoint".
- Ensure environment variable
CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1is set properly. - Install Claude Code 2.1.19.
- Run "claude" and prompt it a few times. (the first succeeds, the remaining fail with the above error.)
- Install Claude Code 2.1.18
- Run "claude" and prompt it a few times. (all prompts succeed)
- Install latest Claude Code (as of writing, 2.1.30)
- Run "claude" and prompt it a few times. (all prompts fail with the above error.)
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.18
Claude Code Version
2.1.19 through 2.1.30
Platform
Other
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
This is using a LiteLLM Gateway configured as recommended by Anthropic with a backend provider of Vertex AI and the recommended frontend unified (Anthropic-compatible) LiteLLM endpoint.
13 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
None of these are the same issue.
As a workaround, setting
ENABLE_TOOL_SEARCH=0seems to work.Another unsuppressed header:
tool-search-tool-2025-10-19Same issue here on Vertex AI. The
tool-search-tool-2025-10-19beta header (deferred tool loading / ToolSearch) is sent even withCLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1in some code paths.Reproduction: Using Claude Code with
CLAUDE_CODE_USE_VERTEX=1and the oh-my-claudecode plugin, which registers MCP servers via the Claude Agent SDK (@anthropic-ai/claude-agent-sdk). When the plugin spawns sub-agents, the SDK sends the header unconditionally and Vertex AI returns 400:Workaround:
CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1does suppress this particular header and resolves the issue. But per this issue's description, the flag doesn't catch all headers (advanced-tool-use-2025-11-20still leaks through).Environment: Claude Code on macOS, Vertex AI (
globalregion), claude-opus-4-6.~i get this error since 2.1.69 - works again after a rollback to 2.1.68~
never mind - i didn't know that Claude Code has to be updated separately via
brew upgrade claude-codeI've updated to
v2.1.81and looks like it's working.yaa i've upgrade the claude-code with brew and now its working fine . Thanks @markusroessler
This was fixed in v2.1.77 — CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 now also disables tool-search mode and its associated beta header. If you're still seeing this in the latest version, please comment with your version and repro and we'll reopen.
Issue still appears at
Version: 2.1.104. I had to specifically setCLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1as workaround to solve this error.Version: 2.1.119 still an issue.
CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1does not work either.+1
seeing the issue on 2.1.119
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.