CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS
Updated by Alex Sorokoletov
CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS strips pre-release anthropic-beta headers, their paired body fields and beta tool-schema fields from API requests, for gateways that reject them. Default: off. Values: 1, true, yes or on (case-insensitive) turns it on; 0 or any other value leaves betas on. Present since v2.1.69 or earlier and still present in v2.1.332. It is listed in the official reference.
| Status | Present in v2.1.332 |
|---|---|
| Added | Present since v2.1.69 or earlier |
| Default | off |
| Values | 1, true, yes or on (case-insensitive) turns it on; 0 or any other value leaves betas on |
| Category | Feature toggles |
| Official docs | Listed |
| Checked against | v2.1.330 |
How to set it
For one session, export it in the shell that starts Claude Code:
export CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1
claude1 stops 400 errors such as 'Unexpected value(s) for the anthropic-beta header' or 'Extra inputs are not permitted' from a gateway.
To apply it to every session, add it to the env object of a settings file:
// ~/.claude/settings.json
{
"env": {
"CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS": "1"
}
}Known issues
- It does not strip every beta: extended context, interleaved thinking, effort, mid-conversation system messages and the OAuth beta stay. A report shows the mid-conversation system message still breaking an Ollama backend with the variable set. Source: issue #74226.
- It turns off MCP tool search, so every MCP tool definition loads upfront and uses context, unless managed settings keep tool search on (v2.1.227+). Source: docs: gateway protocol.
- With CLAUDE_CODE_AUTO_MODE_SERVER unset it also stops auto mode's server review, and on some providers auto mode then cannot check actions. Set CLAUDE_CODE_AUTO_MODE_SERVER=1 to keep the review where it is supported. Source: docs: permission modes.
Release notes that mention it
- Claude Code v2.1.123 — Background Daemons, Agent Fleets, and CoWork Memory
- Claude Code v2.1.81 — 1 New Environment Variable: The --bare Flag and a Bug Fix Marathon
Related variables
CLAUDE_CODE_DISABLE_ADMIN_ENV_UNION: When set to true, uses only the leading admin tier's environment settings instead of merging (unioning) the environment across all admin tiers.CLAUDE_CODE_DISABLE_ARTIFACTCLAUDE_CODE_DISABLE_ATTACHMENTS: File/image attachments.CLAUDE_CODE_DISABLE_AWAITING_USER_IDLE: When set, stops the session from being treated as idle while it waits for user input, so time parked on the user is not counted as idle.CLAUDE_CODE_DISABLE_CFC_PROMPTCLAUDE_CODE_DISABLE_COMMAND_INJECTION_CHECK: Previously allowed disabling command injection detection.CLAUDE_CODE_DISABLE_CRON: Disable cron/scheduled task functionality.CLAUDE_CODE_DISABLE_DIR_SYNC: Turns off the background directory-sync worker on a remote session.
Frequently asked questions
What does CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS do?
Strips pre-release anthropic-beta headers, their paired body fields and beta tool-schema fields from API requests, for gateways that reject them.
What is the default value of CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS?
Off.
What values does CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS accept?
1, true, yes or on (case-insensitive) turns it on; 0 or any other value leaves betas on.
Which Claude Code version has CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS?
Present since v2.1.69 or earlier and still present in v2.1.332.
How do I set CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS?
Export it before starting Claude Code (export CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1), or add it to the "env" object in ~/.claude/settings.json to apply it to every session. 1 stops 400 errors such as 'Unexpected value(s) for the anthropic-beta header' or 'Extra inputs are not permitted' from a gateway.
All variables, searchable: Claude Code environment variables.