[BUG] "CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1" does not suppress anthropic-beta "advanced-tool-use-2025-11-20"

Status Fixed / completed
Reported on v2.1.19
Maintainer reply ✓ Yes — ashwin-ant
Activity 13 comments · opened Feb 3, 2026 · closed Apr 18, 2026
💡 Likely answer: A maintainer (ashwin-ant, collaborator) responded on this thread — see the highlighted reply below.

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

  1. Set up a basic LiteLLM instance according to https://docs.litellm.ai/docs/proxy/docker_quick_start
  2. Add an Anthropic model to LiteLLM offered through Vertex AI.
  3. Set up Claude Code to use a LiteLLM LLM Gateway Configuration using Anthropic's recommendation of "Unified endpoint".
  4. Ensure environment variable CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 is set properly.
  5. Install Claude Code 2.1.19.
  6. Run "claude" and prompt it a few times. (the first succeeds, the remaining fail with the above error.)
  7. Install Claude Code 2.1.18
  8. Run "claude" and prompt it a few times. (all prompts succeed)
  9. Install latest Claude Code (as of writing, 2.1.30)
  10. 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.

View original on GitHub ↗

13 Comments

github-actions[bot] · 6 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/21644
  2. https://github.com/anthropics/claude-code/issues/11154
  3. https://github.com/anthropics/claude-code/issues/21625

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

robert-hencke · 6 months ago
Found 3 possible duplicate issues: 1. [[BUG] prompt-caching-scope-2026-01-05 beta header sent even when enablePromptCaching and useAnthropicBetaHeaders are set to false #21644](https://github.com/anthropics/claude-code/issues/21644) 2. [[BUG] claude code is setting anthropic-beta header on requests to vertexai count-tokens #11154](https://github.com/anthropics/claude-code/issues/11154) 3. [[BUG] Claude Code with Vertex AI (Unexpected value(s) prompt-caching-scope-2026-01-05) #21625](https://github.com/anthropics/claude-code/issues/21625) This issue will be automatically closed as a duplicate in 3 days. If your issue is a duplicate, please close it and 👍 the existing issue instead To prevent auto-closure, add a comment or 👎 this comment 🤖 Generated with Claude Code

None of these are the same issue.

robert-hencke · 6 months ago

As a workaround, setting ENABLE_TOOL_SEARCH=0 seems to work.

cphoward · 6 months ago

Another unsuppressed header: tool-search-tool-2025-10-19

Same issue here on Vertex AI. The tool-search-tool-2025-10-19 beta header (deferred tool loading / ToolSearch) is sent even with CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 in some code paths.

Reproduction: Using Claude Code with CLAUDE_CODE_USE_VERTEX=1 and 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:

API Error: 400 {"type":"error","error":{"type":"invalid_request_error",
"message":"Unexpected value(s) tool-search-tool-2025-10-19 for the
anthropic-beta header."}, "request_id":"req_vrtx_011CXs58p3Bf62CBQ2EMXYET"}

Workaround: CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 does 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-20 still leaks through).

Environment: Claude Code on macOS, Vertex AI (global region), claude-opus-4-6.

markusroessler · 5 months ago

~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-code

simone-viozzi · 5 months ago

I've updated to v2.1.81 and looks like it's working.

Nikhilagrawalcoder · 4 months ago

yaa i've upgrade the claude-code with brew and now its working fine . Thanks @markusroessler

ashwin-ant collaborator · 4 months ago

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.

abdul-jabbar01 · 4 months ago
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 set CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 as workaround to solve this error.

Clara-liu · 4 months ago

Version: 2.1.119 still an issue. CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 does not work either.

keyboard2005 · 4 months ago

+1

powderluv · 4 months ago

seeing the issue on 2.1.119

github-actions[bot] · 3 months ago

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.