CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS

Updated by

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.

StatusPresent in v2.1.332
AddedPresent since v2.1.69 or earlier
Defaultoff
Values1, true, yes or on (case-insensitive) turns it on; 0 or any other value leaves betas on
CategoryFeature toggles
Official docsListed
Checked againstv2.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
claude

1 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

Related variables

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.