{"name":"CLAUDE_CODE_EXTRA_BODY","slug":"claude-code-extra-body","family":"env","title":"Environment variables","noun":"environment variable","description":"JSON object to merge into the top level of every API request body. Useful for passing provider-specific parameters that Claude Code doesn't expose directly. A value exported in your shell also applies to the [background sessions](\/docs\/en\/agent-view) you dispatch with `claude agents` or `--bg`. Before v2.1.206, background sessions ignored a shell-exported value and used whatever copy the background supervisor process inherited","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.232","released_at":"2026-08-13 21:30:53","spans":2}},"aliases":[],"entries":[{"version":"2.1.302","anchor":"claude-code-auto-mode-model-added-to-a-list-that-includes-cl","heading":"CLAUDE_CODE_AUTO_MODE_MODEL now sits on a list of environment variables","line":"Claude Code now lists `CLAUDE_CODE_AUTO_MODE_MODEL` with `PATH`, `CLAUDE_CODE_EXTRA_BODY` and `CLAUDE_CODE_HOST_CREDS_FILE`, and refers to it in more places","released_at":"2026-10-16 16:48:28","reason":"found in this entry's text"},{"version":"2.1.300","anchor":"claude-code-extra-body-replay-recording-now-refuses-unrecord","heading":"Requests are no longer recorded when CLAUDE_CODE_EXTRA_BODY would leak into the transcript","line":"If a key added through CLAUDE_CODE_EXTRA_BODY would end up in the session file, Claude Code now skips recording that request and says why","released_at":"2026-10-14 14:27:26","reason":"found in this entry's text, named in this entry"},{"version":"2.1.300","anchor":"tengu-elegant-meadow-fallback-flipped-to-true-controls-tran","heading":"Recording API requests into session transcripts now defaults to on","line":"Recording each API request into the session transcript is now on by default unless the server says otherwise; `CLAUDE_CODE_ELEGANT_MEADOW` overrides it","released_at":"2026-10-14 14:27:26","reason":"found in this entry's text"},{"version":"2.1.282","anchor":"new-request-replay-recording-in-transcripts-off-unless-teng","heading":"Claude Code can record the API requests it sends into session transcripts","line":"New, off-by-default recording writes each API request's system prompt, tools and message changes into the session transcript file","released_at":"2026-09-24 15:56:22","reason":"found in this entry's text"},{"version":"2.1.267","anchor":"claude-code-extra-body-can-no-longer-inject-the-afk-mode-a","heading":"CLAUDE_CODE_EXTRA_BODY can no longer inject the 'afk-mode' anthropic-beta","line":"CLAUDE_CODE_EXTRA_BODY can no longer be used to inject the afk-mode beta header; only auto mode itself can send it","released_at":"2026-09-09 18:25:42","reason":"found in this entry's text, named in this entry"},{"version":"2.1.267","anchor":"compliance-policy-wording-replaced-with-organizations-po","heading":"\"Compliance policy\" wording replaced with \"organization's policy\" across several messages","line":"Messages that mentioned \"compliance policy\" now say \"organization's policy\" instead","released_at":"2026-09-09 18:25:42","reason":"found in this entry's text"},{"version":"2.1.232","anchor":"per-turn-attribution-key-sent-as-tk-and-tk-is-now-a-reserved","heading":"Per-turn attribution key sent as tk , and tk is now a reserved metadata name","line":"`tk` is now a reserved metadata name and stripped from your extra metadata or body.","released_at":"2026-08-13 21:30:53","reason":"named in this entry, found in this entry's text"},{"version":"2.1.70","anchor":"bug-fixes","heading":"","line":null,"released_at":"2026-03-06 00:09:06","reason":"found in this entry's text"},{"version":"0.2.45","anchor":"environment-variable-support-for-api-customization","heading":"Environment Variable Support for API Customization","line":null,"released_at":"2025-03-15 03:23:03","reason":"found in this entry's text"}],"entries_total":9,"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":"llm-gateway-protocol","title":"Claude Code gateway compatibility guide","documented":false},{"source":"claude-docs","path":"government\/deploy-claude-code\/configure","title":"Connect Claude Code to Claude for Government","documented":false}],"docs_total":4,"gates":[],"related":[{"name":"CLAUDE_CODE_EXTRA_METADATA","slug":"claude-code-extra-metadata","description":"`tk` is now a reserved metadata name and stripped from your extra metadata or body."}],"url":"https:\/\/changelogs.core-directive.com\/reference\/env\/claude-code-extra-body","family_url":"https:\/\/changelogs.core-directive.com\/reference\/env.json"}