This repository has been archived on 2026-04-02. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
claude-code-2026-04-02/docs-site/docs/appendix/environment-variables.md
2026-03-31 15:38:58 +05:00

42 lines
3.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Environment variables (code references)
!!! warning "Unofficial and incomplete"
This list is **not** a substitute for the official [Environment variables](https://code.claude.com/docs/en/env-vars) reference. It only shows names that appear in the recovered `src/` tree as `process.env.*` (or standard vars like `HOME`). Behavior and stability are defined by Anthropics product, not this mirror.
## User-facing and integration (examples found in source)
| Variable | Where used (indicative) |
| ---------------------------------- | ------------------------------------------------------------------------------------------- |
| `ANTHROPIC_BASE_URL` | API client / proxy routing (`toolSearch.ts`, auth paths) |
| `CLAUDE_CODE_GIT_BASH_PATH` | Windows Git Bash resolution (`windowsPaths.ts`) |
| `CLAUDE_DEBUG` | Debug logging (`warningHandler.ts`) |
| `CLAUDE_CODE_ENABLE_TELEMETRY` | OpenTelemetry enable (`telemetry/instrumentation.ts`) |
| `CLAUDE_CODE_ENABLE_TASKS` | Tasks mode (`tasks.ts`) |
| `CLAUDE_CODE_TASK_LIST_ID` | Default task list id (`tasks.ts`) |
| `CLAUDE_CODE_PLAN_MODE_REQUIRED` | Plan mode gate (`teammate.ts`) |
| `CLAUDE_CODE_WORKSPACE_HOST_PATHS` | Telemetry workspace mapping (`telemetry/events.ts`) |
| `ENABLE_TOOL_SEARCH` | Tool search beta (`toolSearch.ts`) |
| `GITHUB_ACTIONS` / `GITHUB_*` | CI metadata in analytics (`user.ts`) |
| `HOME` | XDG / paths (`xdg.ts`) |
| `MAX_THINKING_TOKENS` | Thinking toggle (`thinking.ts`) |
| `NODE_ENV` | Dev/test branches |
| `OTEL_*` | OpenTelemetry exporters and endpoints (`telemetry/instrumentation.ts`, `sessionTracing.ts`) |
| `SHELL` | Shell spawning (`terminalPanel.ts`, `windowsPaths.ts`) |
| `TMUX` / `TMUX_PANE` | Worktree / swarm backends (`worktree.ts`, `swarm/backends/detection.ts`) |
| `TMPDIR` | Temp paths (`tmuxSocket.ts`) |
| `USER_TYPE` | Internal Anthropic gating (`undercover.ts`, many modules) |
## Internal / experimental (often `USER_TYPE === 'ant'`)
Variables such as `CLAUDE_CODE_UNDERCOVER`, `ANT_OTEL_*`, `ANT_CLAUDE_CODE_METRICS_ENDPOINT`, `BETA_TRACING_ENDPOINT`, `CCR_FORCE_BUNDLE`, `CCR_ENABLE_BUNDLE`, and similar appear for **employee or beta** builds. Treat them as undocumented implementation details.
## Regenerate a full grep index
From the repo root:
```bash
rg -o 'process\.env\.[A-Za-z0-9_]+' src --glob '*.ts' --glob '*.tsx' | sort -u
```
The script `scripts/gen-appendices.sh` can write the output to `docs-site/docs/appendix/_generated-env-vars.txt` (gitignored) for local analysis.