CLAUDE_CODE_ATTRIBUTION_HEADER

Updated by

CLAUDE_CODE_ATTRIBUTION_HEADER controls the attribution block (client version and prompt fingerprint) that Claude Code puts at the start of the system prompt; 0 omits it. Default: on, the block is sent. Values: 0, false, no or off (case-insensitive) omits the block; any other value, or unset, keeps it. Present since v2.1.69 or earlier and still present in v2.1.332. It is listed in the official reference.

Full guide: CLAUDE_CODE_ATTRIBUTION_HEADER: Fix Bedrock 400 Errors & Prompt Caching Issues

StatusPresent in v2.1.332
AddedPresent since v2.1.69 or earlier
Defaulton, the block is sent
Values0, false, no or off (case-insensitive) omits the block; any other value, or unset, keeps it
CategoryOther
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_ATTRIBUTION_HEADER=0
claude

0 keeps the block out of the prompt when a gateway reshapes system content or sends requests to a third-party provider.

To apply it to every session, add it to the env object of a settings file:

// ~/.claude/settings.json
{
  "env": {
    "CLAUDE_CODE_ATTRIBUTION_HEADER": "0"
  }
}

Known issues

  • On a direct connection to api.anthropic.com the variable does not change caching, because the API strips the block when it arrives first and unchanged. It matters when a gateway reorders, merges or converts the system array, or forwards to another upstream. Source: docs: gateway protocol.
  • Claude Code keeps the block on auto mode classifier requests to api.anthropic.com even with 0 set. Before v2.1.229, setting 0 on a direct connection made auto mode fail on every tool call. Source: issue #64585.
  • Bedrock rejected the block with a 400 reserved keyword error in v2.1.37, and 0 was the workaround. Before v2.1.181 the block also held a per-request token on custom base URLs, which broke gateway caching; current versions do not add it there. Source: issue #24168.

Release notes that mention it

Related variables

Frequently asked questions

What does CLAUDE_CODE_ATTRIBUTION_HEADER do?

Controls the attribution block (client version and prompt fingerprint) that Claude Code puts at the start of the system prompt; 0 omits it.

What is the default value of CLAUDE_CODE_ATTRIBUTION_HEADER?

On, the block is sent.

What values does CLAUDE_CODE_ATTRIBUTION_HEADER accept?

0, false, no or off (case-insensitive) omits the block; any other value, or unset, keeps it.

Which Claude Code version has CLAUDE_CODE_ATTRIBUTION_HEADER?

Present since v2.1.69 or earlier and still present in v2.1.332.

How do I set CLAUDE_CODE_ATTRIBUTION_HEADER?

Export it before starting Claude Code (export CLAUDE_CODE_ATTRIBUTION_HEADER=0), or add it to the "env" object in ~/.claude/settings.json to apply it to every session. 0 keeps the block out of the prompt when a gateway reshapes system content or sends requests to a third-party provider.

All variables, searchable: Claude Code environment variables.