Current state
Claude Code's configuration is split across two mechanisms, so no single file answers "how is Claude Code configured?" — and eight of its settings leak into every process in the shell rather than applying only to Claude Code. tools/claude/shell.zsh exports ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_MODEL, CLAUDE_CODE_DISABLE_BACKGROUND_TASKS, CLAUDE_CODE_ENABLE_TELEMETRY, CLAUDE_CODE_ENABLE_TASKS, DISABLE_ERROR_REPORTING, and DISABLE_TELEMETRY into the shell environment. All eight are read only by Claude Code. Meanwhile tools/claude/config/settings.json has no env block, even though the schema it declares on line 2 supports one.
Documentation:
Ideal state
tools/claude/config/settings.json has an env block holding the eight Claude-Code-only variables
- None of those eight variables are exported from
tools/claude/shell.zsh
- A new shell has none of the eight in its environment; a Claude Code session has all eight
- Claude Code behaves identically to before — same default models, same telemetry and error reporting state, same background-task and task-tracking behavior
- The work-machine Vertex routing still applies on the work machine and still does not apply elsewhere
- Reading
settings.json alone tells you how Claude Code is configured, apart from machine-specific routing
Out of scope
- The
is_work Vertex block (ANTHROPIC_VERTEX_PROJECT_ID, CLAUDE_CODE_USE_VERTEX, CLOUD_ML_REGION) — it is conditional on which machine this is, and a static JSON file cannot express that branch. It stays a shell export.
- The
cc and ccy aliases — shell ergonomics, not agent configuration
tools/codex/shell.zsh, tools/gemini/, and tools/pi/shell.zsh — this issue covers Claude Code only
- Changing any variable's value — relocation only
Starting points
tools/claude/shell.zsh — the eight exports, plus the is_work block that stays
tools/claude/config/settings.json — the destination; currently has no env key
tools/zsh/config/tools.zsh — how shell.zsh files get sourced, if the loading order turns out to matter
QA plan
- Before changing anything, open a new shell and run
env | grep -E '^(ANTHROPIC_|CLAUDE_CODE_|DISABLE_)' — expect the eight variables, so you have a baseline to compare against
- After the change, open a new shell and run the same command — expect none of the eight, and on the work machine expect only the three Vertex variables
- Run
claude -p 'Run this bash command and report its raw output: env | grep -E "^(ANTHROPIC_|CLAUDE_CODE_|DISABLE_)"' — expect all eight present inside the session with their original values
- Start an interactive session and run
/status — expect the same model configuration as before the change
- Export one of the eight to a different value in the shell, then launch Claude Code and re-run step 3 — observe whether the shell value or the
settings.json value wins, and confirm the result matches the precedence described in the settings documentation. If the shell wins, note it, since it means a stray export can silently override the config file
- On the work machine, start a session and send any prompt — expect it to succeed via Vertex, confirming the conditional block still applies
- On a personal machine, run
env | grep VERTEX — expect no output
Done when
Claude Code's non-conditional configuration is readable from settings.json alone, with no Claude-Code-only exports left in tools/claude/shell.zsh.
Current state
Claude Code's configuration is split across two mechanisms, so no single file answers "how is Claude Code configured?" — and eight of its settings leak into every process in the shell rather than applying only to Claude Code.
tools/claude/shell.zshexportsANTHROPIC_DEFAULT_OPUS_MODEL,ANTHROPIC_DEFAULT_SONNET_MODEL,ANTHROPIC_MODEL,CLAUDE_CODE_DISABLE_BACKGROUND_TASKS,CLAUDE_CODE_ENABLE_TELEMETRY,CLAUDE_CODE_ENABLE_TASKS,DISABLE_ERROR_REPORTING, andDISABLE_TELEMETRYinto the shell environment. All eight are read only by Claude Code. Meanwhiletools/claude/config/settings.jsonhas noenvblock, even though the schema it declares on line 2 supports one.Documentation:
envis a documented top-level property: "Environment variables to set for Claude Code sessions") — https://json.schemastore.org/claude-code-settings.jsonIdeal state
tools/claude/config/settings.jsonhas anenvblock holding the eight Claude-Code-only variablestools/claude/shell.zshsettings.jsonalone tells you how Claude Code is configured, apart from machine-specific routingOut of scope
is_workVertex block (ANTHROPIC_VERTEX_PROJECT_ID,CLAUDE_CODE_USE_VERTEX,CLOUD_ML_REGION) — it is conditional on which machine this is, and a static JSON file cannot express that branch. It stays a shell export.ccandccyaliases — shell ergonomics, not agent configurationtools/codex/shell.zsh,tools/gemini/, andtools/pi/shell.zsh— this issue covers Claude Code onlyStarting points
tools/claude/shell.zsh— the eight exports, plus theis_workblock that staystools/claude/config/settings.json— the destination; currently has noenvkeytools/zsh/config/tools.zsh— howshell.zshfiles get sourced, if the loading order turns out to matterQA plan
env | grep -E '^(ANTHROPIC_|CLAUDE_CODE_|DISABLE_)'— expect the eight variables, so you have a baseline to compare againstclaude -p 'Run this bash command and report its raw output: env | grep -E "^(ANTHROPIC_|CLAUDE_CODE_|DISABLE_)"'— expect all eight present inside the session with their original values/status— expect the same model configuration as before the changesettings.jsonvalue wins, and confirm the result matches the precedence described in the settings documentation. If the shell wins, note it, since it means a stray export can silently override the config fileenv | grep VERTEX— expect no outputDone when
Claude Code's non-conditional configuration is readable from
settings.jsonalone, with no Claude-Code-only exports left intools/claude/shell.zsh.