{"name":"ANTHROPIC_CUSTOM_HEADERS","slug":"anthropic-custom-headers","family":"env","title":"Environment variables","noun":"environment variable","description":"Custom headers to add to requests (`Name: Value` format, newline-separated for multiple headers). If a name or value contains a character an HTTP header can't carry, such as a curly quote or a zero-width space, the request fails with an error that identifies the pair by position. Requires Claude Code v2.1.227 or later. [Invalid request header value](\/docs\/en\/errors#invalid-request-header-value) lists the exact character set and where the check runs. A value that sets a credential, org or tenant, routing, or API-behavior header, such as `Authorization` or `Host`, counts as a [setting that needs approval](\/docs\/en\/server-managed-settings#environment-variables-and-the-approval-dialog) when server-managed settings deliver it. From project or local settings, such a value follows the [rules for when `env` values apply](\/docs\/en\/settings-reference#when-claude-code-applies-env-values)","description_source":"docs","described_by":{"doc":"claude-code\/env-vars","title":"Environment variables"},"presence":{"first_seen":"2.1.138","removed_in":null,"in_current_build":true,"newest_mined":"2.1.308","builds":149,"mined_builds":149,"first_cited":{"version":"2.1.227","released_at":"2026-08-10 20:56:57","spans":6}},"aliases":[],"entries":[{"version":"2.1.296","anchor":"custom-headers-check-function-replaced-and-git-subprocess-e","heading":"Git commands run by Claude Code no longer inherit GIT_CONFIG","line":"Claude Code clears any `GIT_CONFIG` variable before running git, and now compares `ANTHROPIC_CUSTOM_HEADERS` with a value from another source","released_at":"2026-10-09 16:58:10","reason":"found in this entry's text"},{"version":"2.1.296","anchor":"api-client-adds-per-request-extra-headers-and-awaits-a-heade","heading":"Claude Code now gathers extra request headers when it sets up its API connection","line":"When Claude Code sets up its connection to the API, it now fetches extra headers and adds them to every kind of connection it makes","released_at":"2026-10-09 16:58:10","reason":"found in this entry's text"},{"version":"2.1.296","anchor":"new-x-claude-code-wiggly-dove-request-header-off-by-default","heading":"Claude Code can send a new header describing the client and its setup","line":"A new `x-claude-code-wiggly-dove` request header can carry client version, permission mode, sandbox and git details, and is off by default","released_at":"2026-10-09 16:58:10","reason":"found in this entry's text"},{"version":"2.1.287","anchor":"custom-headers-parsing-moved-to-shared-helper","heading":"ANTHROPIC_CUSTOM_HEADERS is read by a shared helper","line":"Claude Code now reads `ANTHROPIC_CUSTOM_HEADERS` through a single shared function instead of separate inline code","released_at":"2026-10-01 16:59:25","reason":"found in this entry's text, named in this entry"},{"version":"2.1.287","anchor":"self-hosted-remote-environment-and-custom-header-auth-parsin","heading":"Custom Authorization headers read through a shared parser; a self-hosted remote type","line":"An Authorization header set in ANTHROPIC_CUSTOM_HEADERS is now read by a shared parser, and a self_hosted remote environment type is recognised","released_at":"2026-10-01 16:59:25","reason":"found in this entry's text, named in this entry"},{"version":"2.1.284","anchor":"bedrockvertex-model-access-probe-results-are-cached-on-disk","heading":"Bedrock and Vertex model-access checks are remembered for 15 minutes","line":"A successful check that your cloud provider gives you access to a model is now saved on disk and reused for 15 minutes","released_at":"2026-09-28 17:11:59","reason":"found in this entry's text"},{"version":"2.1.277","anchor":"a-custom-header-spread-in-the-api-client-now-includes-an-ine","heading":"A custom-header spread in the API client now includes an inert no-op spread","line":"A no-op false value was added to the API client's custom-header spread, with no apparent effect","released_at":"2026-09-18 16:22:26","reason":"found in this entry's text"},{"version":"2.1.267","anchor":"org-policy-beta-block-message-reworded","heading":"Org-policy beta-block message reworded","line":"The message shown when an org policy blocks experimental beta headers was reworded","released_at":"2026-09-09 18:25:42","reason":"found in this entry's text"},{"version":"2.1.260","anchor":"api-client-now-sends-anthropic-beta-custom-header-value-only","heading":"API client now sends anthropic-beta custom header value only when a flag is on","line":"A custom anthropic-beta header can be forwarded, but only once a gate is enabled.","released_at":"2026-09-03 22:32:02","reason":"found in this entry's text, named in this entry"},{"version":"2.1.260","anchor":"org-compliance-policy-can-silently-drop-custom-anthropic-bet","heading":"Org compliance policy can silently drop custom anthropic-beta headers","line":"HIPAA compliance mode now silently drops custom anthropic-beta headers and disables 1M-context.","released_at":"2026-09-03 22:32:02","reason":"found in this entry's text, named in this entry"}],"entries_total":18,"docs":[{"source":"claude-code","path":"env-vars","title":"Environment variables","documented":true},{"source":"claude-code","path":"agent-view","title":"Manage multiple agents with agent view","documented":false},{"source":"claude-code","path":"amazon-bedrock","title":"Claude Code on Amazon Bedrock","documented":false},{"source":"claude-code","path":"changelog","title":"Claude Code changelog","documented":false},{"source":"claude-code","path":"errors","title":"Error reference","documented":false},{"source":"claude-code","path":"llm-gateway-connect","title":"Connect Claude Code to an LLM gateway","documented":false},{"source":"claude-code","path":"llm-gateway-protocol","title":"Claude Code gateway compatibility guide","documented":false},{"source":"claude-code","path":"llm-gateway-rollout","title":"Roll out an LLM gateway for your organization","documented":false},{"source":"claude-code","path":"mcp","title":"Connect Claude Code to tools via MCP","documented":false},{"source":"claude-code","path":"server-managed-settings","title":"Configure server-managed settings","documented":false}],"docs_total":12,"gates":[],"related":[{"name":"ANTHROPIC_CUSTOM_MODEL_OPTION","slug":"anthropic-custom-model-option","description":"Model ID to add as a custom entry in the `\/model` picker. Use this to make a non-standard or gateway-specific model selectable without replacing built-in aliases. See [Model configuration](\/docs\/en\/model-config#add-a-custom-model-option)"},{"name":"ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION","slug":"anthropic-custom-model-option-description","description":"Display description for the custom model entry in the `\/model` picker. Defaults to `Custom model (<model-id>)` when not set"},{"name":"ANTHROPIC_CUSTOM_MODEL_OPTION_NAME","slug":"anthropic-custom-model-option-name","description":"Display name for the custom model entry in the `\/model` picker. When not set, the entry shows the model's name if Claude Code [recognizes the ID](\/docs\/en\/model-config#customize-pinned-model-display-and-capabilities), and the model ID otherwise"}],"url":"https:\/\/changelogs.core-directive.com\/reference\/env\/anthropic-custom-headers","family_url":"https:\/\/changelogs.core-directive.com\/reference\/env.json"}