Zehn nützliche Umgebungsvariablen für Claude Code im Überblick
Ein Entwickler zeigt zehn Environment Variables, die sich beim Arbeiten mit Claude Code lohnen. Darunter auch der Hinweis, dass DISABLE_TELEMETRY=0 Telemetrie dennoch deaktiviert.

Ihr Agent startet die Integrationssuite. Die Suite braucht vier Minuten. Nach zwei Minuten läuft das Bash-Tool in einen Timeout, der Agent liest einen fehlgeschlagenen Befehl und jagt möglicherweise einem Bug hinterher, der gar nicht existiert.
Dieses Zwei-Minuten-Limit ist kein CLI-Flag. Es ist BASH_DEFAULT_TIMEOUT_MS, eine der Variablen auf der Seite zu den Claude Code Umgebungsvariablen. Ein Großteil der Konfiguration, die das Verhalten von Claude Code verändert, findet sich auf dieser Seite.
Zehn dieser Variablen folgen im Einzelnen. Jeder Name und jeder Standardwert stammt von dieser Seite und aus den Modellkonfigurations-Dokumentationen, Stand 15. Oktober 2026. Claude Code erscheint häufig in neuen Versionen, prüfen Sie die Seite also erneut, bevor Sie einen Wert in eine Team-Konfiguration übernehmen.
Wo sie hin gehören: Exportieren Sie eine Variable in Ihrer Shell, gilt sie für die jeweilige Terminal-Sitzung. Setzen Sie sie unter env in einer Settings-Datei, gilt sie, so die Dokumentation, "bei jedem Aufruf von claude":
{ "env": { "BASH_DEFAULT_TIMEOUT_MS": "300000" } } Enter fullscreen mode Exit fullscreen mode ~/.claude/settings.json gilt für alle Projekte, und.claude/settings.json innerhalb eines Repos wird mit Ihrem Team geteilt (Settings-Dokumentation). Eine Überraschung: Wenn Shell und Settings-Datei dieselbe Variable setzen, gewinnt normalerweise die Settings-Datei, weil Claude Code jeden env-Eintrag in seine eigene Umgebung schreibt und damit den geerbten Wert überschreibt.
Das Timeout für einen Bash-Befehl im Vordergrund, in Millisekunden. Standard: 120000, also zwei Minuten.
export BASH_DEFAULT_TIMEOUT_MS = 300000 # 5 Minuten Enter fullscreen mode Exit fullscreen mode Nützlich, wenn Ihre Testsuite, ein Container-Build oder eine Datenbankmigration länger als zwei Minuten läuft und der Agent immer wieder an das Limit stößt. Sein Geschwister BASH_MAX_TIMEOUT_MS (Standard 600000, zehn Minuten) ist das Maximum, das das Modell für einen einzelnen Befehl anfordern kann. Die effektive Obergrenze ist der größere der beiden Werte.
Wie viele Zeichen der Ausgabe eines Befehls Claude Code zurück ins Ergebnis liest. Standard 30000, Maximum 150000.
export BASH_MAX_OUTPUT_LENGTH = 80000 Enter fullscreen mode Exit fullscreen mode Die Zeile, die Sie brauchen, steht oft am Ende eines langen Build-Logs, und genau dort erfolgt der Abschnitt. Jedes zusätzliche Zeichen landet im Kontextfenster, erhöhen Sie den Wert also nur für den Job, der es braucht. Wenn Sie die Einstellung bashOutputMaxChars setzen, ignoriert Claude Code diese Variable.
Zwei Grenzen gelten für jeden Shell-Befehl, den der Agent ausführt: wie lange er dauern darf und wie viel seiner Ausgabe zurückkommt.
Das zu verwendende Modell, als Alias (opus, sonnet, haiku, fable) oder als vollständiger Modellname. Über die Anthropic API löst sich opus zu Opus 5.5 und sonnet zu Sonnet 5.5 auf.
export ANTHROPIC_MODEL = sonnet Enter fullscreen mode Exit fullscreen mode Praktisch für ein Terminal, einen CI-Job oder ein Skript, das immer mit demselben Modell starten soll. Wissen Sie, wo es in der Rangfolge steht: /model in einer Sitzung und claude --model beim Start schlagen es, und es schlägt den model-Schlüssel in Ihren Einstellungen.
Das Standardmodell für Subagents, Agent-Team-Mitglieder und Workflow-Agents, denen auf keine andere Weise ein Modell zugewiesen wird.
export CLAUDE_CODE_SUBAGENT_MODEL = haiku Enter fullscreen mode Exit fullscreen mode Damit können Sie die Hauptsitzung auf einem großen Modell lassen, während die Helfer auf einem günstigeren laufen. Zwei Dinge schlagen es dennoch: ein Modell, das Claude beim Starten des Agents übergibt, und ein model-Feld in der Definition des Agents. Zusätzlich gibt es CLAUDE_CODE_SUBAGENT_MODEL_FORCE, falls alle Subagents unabhängig davon auf einem Modell laufen sollen.
Die Effort-Stufe für unterstützte Modelle: low, medium, high, xhigh, max oder auto für den Standard des Modells. Opus 5.5, Sonnet 5.5 und Haiku 5.5 stehen standardmäßig auf medium, die meisten anderen Modelle mit Effort-Unterstützung auf high.
export CLAUDE_CODE_EFFORT_LEVEL = high Enter fullscreen mode Exit fullscreen mode Nützlich, wenn Sie sich auf eine Stufe festgelegt haben und sie überall gelten lassen wollen. Beachten Sie die Vorrangregel, die entgegengesetzt zur Modellvariablen funktioniert: Diese Variable schlägt --effort, /effort und die Effort-Einstellungen. Sie ist zudem der einzige Weg, max dauerhaft zu setzen. Auf andere Weise gesetzt, gilt max nur für die aktuelle Sitzung. In Ihr Shell-Profil eingetragen, überschreibt sie jede spätere Effort-Auswahl pro Sitzung.
Ein festes Token-Budget für extended thinking. Lesen Sie diese Zeile genau, denn bei aktuellen Modellen leistet sie weniger, als der Name verspricht. Modelle mit adaptive reasoning ignorieren einen positiven Wert und wählen ihre eigene Tiefe. 0 schaltet thinking über die Anthropic API aus, außer bei Opus 5.5, Sonnet 5.5, Haiku 5.5 und den Fable-Modellen, bei denen sich thinking nicht abschalten lässt.
export MAX_THINKING_TOKENS = 0 Enter fullscreen mode Exit fullscreen mode Seinen Platz wert ist die Variable nur bei einem Modell, bei dem sich thinking abschalten lässt, wenn Sie kurze, schnelle Antworten wollen. Opus 4.6 und Sonnet 4.6 kehren mit CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1 zum festen Budget zurück. Bei den 5.5-Modellen ist Punkt 5 die Steuerung, die tatsächlich etwas bewirkt.
Die maximale Anzahl an Output-Tokens für die meisten Anfragen. Standardwerte und Obergrenzen variieren je nach Modell, und Claude Code senkt einen Wert über der Obergrenze eines Modells auf diese Grenze. Für eine Modell-ID, die es nicht auflösen kann, sind der Standardwert 32000 und die Obergrenze 128000.
export CLAUDE_CODE_MAX_OUTPUT_TOKENS = 64000 Enter fullscreen mode Exit fullscreen mode Lange Einzelantworten, etwa eine große generierte Datei, sind der Punkt, an dem das zuschlägt: Sie werden abgeschnitten. Relevant ist es auch, wenn Sie Claude Code auf ein Modell lenken, das es nicht kennt. Der Kompromiss laut der Dokumentation: Ein höherer Wert verkleinert den Kontext, der vor dem Lauf der automatischen Komprimierung zur Verfügung steht.
Überschreibt das Konfigurationsverzeichnis, standardmäßig ~/.claude. Einstellungen, Sitzungsverlauf und Plugins liegen alle unter diesem Pfad.
alias claude-work = 'CLAUDE_CONFIG_DIR=~/.claude-work claude' Enter fullscreen mode Exit fullscreen mode Dieser Alias ist das eigene Beispiel der Dokumentation, um mehrere Konten parallel zu betreiben. Ein Arbeitskonto neben einem privaten ist der naheliegende Fall, ebenso ein sauberes Profil, um ein Plugin zu testen. Zugangsdaten folgen ihren eigenen Regeln, die unter credential management behandelt werden. Setzen Sie die Variable in Ihrer Shell oder in den Benutzereinstellungen, mit absolutem Pfad in einer Settings-Datei. Projekt- und lokale Einstellungen ignorieren sie.
Ein Konfigurationsverzeichnis pro Konto: getrennte Einstellungen, Verlauf und Plugins.
Auf 1 gesetzt, stoppt die Variable automatische Updates im Hintergrund. Ein manuell ausgeführtes claude update funktioniert weiterhin.
export DISABLE_AUTOUPDATER = 1 Enter fullscreen mode Exit fullscreen mode Release-Wochen sind der übliche Grund: Die Version wechselt nur, wenn Sie es anordnen. Die strengere Variable DISABLE_UPDATES=1 blockiert zusätzlich manuelles claude update und claude install und richtet sich an Teams, die Claude Code über eigene Kanäle verteilen.
Ein Schalter für nicht wesentlichen Netzwerkverkehr: Auto-Updates, Telemetrie, Fehlerberichte, den /feedback-Befehl, Release Notes, PR-Status-Badge-Prüfungen und Verfügbarkeitschecks. Er schaltet auch das Abrufen von Feature-Flags ab, wodurch Remote Control und andere über Flags gesteuerte Funktionen nicht mehr verfügbar sind.
export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC = 1 Enter fullscreen mode Exit fullscreen mode Nützlich in einem eingeschränkten Netzwerk oder unter einer Richtlinie, die Modell-API-Aufrufe und wenig sonstiges erlaubt. Wenn nur ein einzelner Bestandteil abgeschaltet werden soll, deaktiviert DISABLE_ERROR_REPORTING nur die Fehlerberichte. DISABLE_TELEMETRY schaltet die Telemetrie und, laut seiner Zeile, ebenfalls das Abrufen von Feature-Flags ab. Telemetrie-Events enthalten keinen Code, keine Dateipfade und keine Bash-Befehle.
Die Falle aus dem Titel: "Die meisten An/Aus-Variablen akzeptieren 1, true, yes, on sowie 0, false, no, off, aber CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC, DISABLE_TELEMETRY und DISABLE_ERROR_REPORTING, dazu einige weitere auf der Seite, tun das nicht. Sie prüfen nur, ob die Variable gesetzt ist, also aktiviert jeder nicht-leere Wert das Verhalten, auch 0:"
export DISABLE_TELEMETRY = 0 # opt-out bleibt aktiv unset DISABLE_TELEMETRY # zurück zum Standard Enter fullscreen mode Exit fullscreen mode Die Dokumentation weist in allen drei Zeilen fett auf diesen Umstand hin. Um eine Variable zurückzunehmen, heben Sie sie mit unset auf oder setzen sie auf einen leeren String.
Punkt 1, 9 und 10 sind einmal setzen und vergessen (Punkt 10 nur, wenn Sie Remote Control nicht nutzen). Tragen Sie sie in ~/.claude/settings.json ein und denken Sie nicht mehr daran. Punkt 2 und 7 kosten Kontext, erhöhen Sie sie also nur für den Job, der es braucht. Punkt 3, 5 und 8 sind anders: Modell, Effort und Konto sind das, was Sie von Aufgabe zu Aufgabe wechseln, und genau sie gehen schief, wenn Sie sie einmal in einem Shell-Profil exportieren und dann vergessen.
Ich baue Hermes IDE, wägen Sie das also entsprechend mit ab. Hermes betreibt Claude Code und andere Agents jeweils in einem echten Terminal. Das ⌘N-Task-Sheet (Strg+Umschalt+N unter Windows und Linux) erlaubt es, pro Task Agent, Modell, Effort und Konto zu wählen und häufig genutzte Kombinationen als Presets zu speichern. Sie können mehrere Konten pro Agent hinterlegen.
Das ⌘N New task sheet in Hermes: Agent, Projekt, Worktree, Approval Mode, Modell- und Effort-Chips, mit der Vorschau "Hermes will run" für den claude-Befehl.
Zwei Lehren aus der Liste gelten für jeden Launcher. Ein exportiertes CLAUDE_CODE_EFFORT_LEVEL schlägt --effort, ein globaler Export überschreibt also jeden Effort-Wert, den ein Launcher auf der Kommandozeile übergibt. Wenn Sie den Effort pro Task wählen, lassen Sie Punkt 5 unexportiert. ANTHROPIC_MODEL funktioniert umgekehrt, hier schlägt --model die Variable. env-Einträge aus Settings-Dateien gelten dennoch, weil Claude Code sie selbst liest, "egal wie claude gestartet wurde".
Hermes ist kostenlos, unter BSL 1.1 als Quellcode verfuegbar und laeuft auf macOS, Windows und Linux. Es steht in keiner Verbindung zu Anthropic oder einem anderen Agent-Anbieter. Sie können es herunterladen oder den Quellcode auf GitHub lesen.
Die vollstaendige Seite listet deutlich mehr als zehn auf, darunter API_TIMEOUT_MS fuer langsame Netzwerke und MCP_TIMEOUT fuer MCP-Server, die langsam starten. Welche Variable setzen Sie auf jedem Rechner? Schreiben Sie es in die Kommentare.
Zwei dieser Variablen laufen auf ein einziges Budget hinaus: jedes Zeichen des Build-Logs und jedes Ausgabe-Token, das Sie erlauben, ist Kontext, den das Modell nicht auf Ihre Anweisungen verwenden kann. Der Prompt Engineering Pocket Guide dreht sich genau um diese Seite der Arbeit, von System-Prompts und Anweisungen im CLAUDE.md-Stil bis hin zu Context Engineering und strukturierten Ausgaben. Wenn Sie mehr als einen Agenten pro Tag betreiben, haelt Hermes IDE Agent, Modell und Aufwand jeder Aufgabe an einem Ort fest.
Automatisch übersetzt. Das Original auf Englisch ist unten aufklappbar.
Original (Englisch) anzeigen
Your agent starts the integration suite. The suite needs four minutes. At the two-minute mark the Bash tool times out, the agent reads a failed command, and it may go hunting for a bug that isn't there.
That two-minute limit isn't a CLI flag. It's BASH_DEFAULT_TIMEOUT_MS, one of the variables on the Claude Code environment variables page. A lot of the tuning that changes how Claude Code behaves lives on that page.
Ten of those variables follow. Every name and default comes from that page and the model configuration docs, as read on October 15, 2026. Claude Code ships often, so check the page again before you copy a value into a team config.
Where to put them: export a variable in your shell and it lasts for that terminal session. Put it under env in a settings file and, in the docs' words, it "applies every time claude runs":
{ "env": { "BASH_DEFAULT_TIMEOUT_MS": "300000" } } Enter fullscreen mode Exit fullscreen mode ~/.claude/settings.json covers every project, and.claude/settings.json inside a repo is shared with your team ( settings docs ). One surprise: when your shell and a settings file set the same variable, the settings file usually wins, because Claude Code writes each env entry into its own environment over the inherited value.
The timeout for a foreground Bash command, in milliseconds. Default: 120000, two minutes.
export BASH_DEFAULT_TIMEOUT_MS = 300000 # 5 minutes Enter fullscreen mode Exit fullscreen mode Want it when your test suite, a container build or a database migration runs longer than two minutes and the agent keeps hitting the limit. Its sibling BASH_MAX_TIMEOUT_MS (default 600000, ten minutes) is the most the model can request for a single command. The effective ceiling is the larger of the two.
How many characters of a command's output Claude Code reads back into the result. Default 30000, maximum 150000.
export BASH_MAX_OUTPUT_LENGTH = 80000 Enter fullscreen mode Exit fullscreen mode The line you need often sits at the bottom of a long build log, and that's where the cut lands. Every extra character ends up in the context window, so raise it for the job that needs it. If you set the bashOutputMaxChars setting, Claude Code ignores this variable.
Two limits on every shell command the agent runs: how long it may take, and how much of its output comes back.
The model to use, as an alias ( opus, sonnet, haiku, fable ) or a full model name. On the Anthropic API, opus resolves to Opus 5.5 and sonnet to Sonnet 5.5.
export ANTHROPIC_MODEL = sonnet Enter fullscreen mode Exit fullscreen mode Handy for a terminal, CI job or script that should always start on the same model. Know where it ranks: /model in a session and claude --model at startup both beat it, and it beats the model key in your settings.
The default model for subagents, agent-team teammates and workflow agents that aren't given a model another way.
export CLAUDE_CODE_SUBAGENT_MODEL = haiku Enter fullscreen mode Exit fullscreen mode Use it to keep the main session on a large model while the helpers run on a cheaper one. Two things still beat it: a model Claude passes when it spawns the agent, and a model field in the agent's definition. There's also CLAUDE_CODE_SUBAGENT_MODEL_FORCE if you want every subagent on one model regardless.
The effort level for supported models: low, medium, high, xhigh, max, or auto for the model's default. Opus 5.5, Sonnet 5.5 and Haiku 5.5 default to medium, and most other models that support effort default to high.
export CLAUDE_CODE_EFFORT_LEVEL = high Enter fullscreen mode Exit fullscreen mode Want it when you've settled on one level and want it everywhere. Mind the precedence, which is the opposite of the model variable: this one beats --effort, /effort and the effort settings. It's also the only way to make max stick. Set any other way, max lasts for the current session only. Put it in your shell profile and it overrides every per-session effort choice you make later.
A fixed token budget for extended thinking. Read its row carefully, because on current models it does less than the name suggests. Models with adaptive reasoning ignore a positive value and pick their own depth. 0 turns thinking off on the Anthropic API, except on Opus 5.5, Sonnet 5.5, Haiku 5.5 and the Fable models, which can't have thinking turned off.
export MAX_THINKING_TOKENS = 0 Enter fullscreen mode Exit fullscreen mode It earns its place only on a model that can have thinking turned off, when you want short, fast answers. Opus 4.6 and Sonnet 4.6 can go back to the fixed budget with CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1. On the 5.5 models, item 5 is the control that does something.
The maximum output tokens for most requests. Defaults and caps vary by model, and Claude Code lowers a value above a model's cap to the cap. For a model ID it can't resolve, the default is 32000 and the cap is 128000.
export CLAUDE_CODE_MAX_OUTPUT_TOKENS = 64000 Enter fullscreen mode Exit fullscreen mode Long single responses, such as a large generated file, are where this bites: they get cut off. It also matters when you route Claude Code to a model it doesn't know. The trade-off, from the docs: a higher value shrinks the context available before auto-compaction runs.
Overrides the configuration directory, ~/.claude by default. Settings, session history and plugins all live under that path.
alias claude-work = 'CLAUDE_CONFIG_DIR=~/.claude-work claude' Enter fullscreen mode Exit fullscreen mode That alias is the docs' own example for running several accounts side by side. A work account next to a personal one is the obvious case, and so is a clean profile to test a plugin in. Credentials follow their own rules, covered under credential management. Set it in your shell or user settings, with an absolute path in a settings file. Project and local settings ignore it.
One configuration directory per account: separate settings, history and plugins.
Set to 1 to stop automatic background updates. Running claude update yourself still works.
export DISABLE_AUTOUPDATER = 1 Enter fullscreen mode Exit fullscreen mode Release weeks are the usual reason: the version changes when you say so. The stricter DISABLE_UPDATES=1 also blocks manual claude update and claude install, and is aimed at teams that distribute Claude Code through their own channels.
One switch for nonessential network traffic: auto-updates, telemetry, error reporting, the /feedback command, release notes, PR status badge checks and availability checks. It also turns off feature-flag fetching, so Remote Control and other flag-gated features become unavailable.
export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC = 1 Enter fullscreen mode Exit fullscreen mode Want it on a restricted network, or under a policy that allows model API calls and little else. If you only want one piece gone, DISABLE_ERROR_REPORTING turns off just error reporting. DISABLE_TELEMETRY turns off telemetry and, per its row, feature-flag fetching too. Telemetry events don't include code, file paths or Bash commands.
The trap from the title: "most on/off variables accept 1, true, yes, on and 0, false, no, off, but CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC, DISABLE_TELEMETRY and DISABLE_ERROR_REPORTING, plus a few others on the page, don't. They check only whether the variable is set, so any non-empty value turns the behavior on, 0 included:"
export DISABLE_TELEMETRY = 0 # still opts out unset DISABLE_TELEMETRY # back to the default Enter fullscreen mode Exit fullscreen mode The docs flag this in bold on each of the three rows. To undo one, unset it or set it to an empty string.
Items 1, 9 and 10 are set-and-forget (10 only if you don't use Remote Control). Put them in ~/.claude/settings.json and stop thinking about them. Items 2 and 7 cost context, so raise them for the job that needs it. Items 3, 5 and 8 are different: the model, the effort and the account are what you change from one task to the next, and they're the ones that go wrong when you export them once in a shell profile and forget.
I build Hermes IDE, so weigh this with that in mind. Hermes runs Claude Code and other agents each in a real terminal. Its ⌘N task sheet (Ctrl+Shift+N on Windows and Linux) lets you pick the agent, model, effort and account per task, and save the combinations you use often as presets. You can add several accounts per agent.
The ⌘N New task sheet in Hermes: agent, project, worktree, approval mode, model and effort chips, with the "Hermes will run" preview of the claude command.
Two lessons from the list carry over to any launcher. An exported CLAUDE_CODE_EFFORT_LEVEL beats --effort, so a global export overrides whatever effort a launcher passes on the command line. If you pick effort per task, leave item 5 unexported. ANTHROPIC_MODEL works the other way round, and --model beats it. Settings-file env entries still apply, because Claude Code reads them itself "no matter how claude was launched."
Hermes is free, source-available under BSL 1.1, and runs on macOS, Windows and Linux. It isn't affiliated with Anthropic or any other agent vendor. Download it or read the source on GitHub.
The full page lists far more than ten, including API_TIMEOUT_MS for slow networks and MCP_TIMEOUT for MCP servers that start slowly. Which one do you set on every machine? Tell me in the comments.
Two of these variables come down to one budget: every character of build log and every output token you allow is context the model can't spend on your instructions. The Prompt Engineering Pocket Guide is about that side of the work, from system prompts and CLAUDE.md-style instructions to context engineering and structured output. If you run more than one agent a day, Hermes IDE keeps each task's agent, model and effort in one place.