CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC
Updated by Alex Sorokoletov
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC turns off auto-updates, telemetry, error reporting, /feedback, release notes and feature-flag fetching in one switch; model API calls are unaffected. Default: unset, so nonessential traffic is allowed. Values: Any non-empty value turns it on, including 0 and false; unset it to turn it off. Present since v2.1.69 or earlier and still present in v2.1.332. It is listed in the official reference.
| Status | Present in v2.1.332 |
|---|---|
| Added | Present since v2.1.69 or earlier |
| Default | unset, so nonessential traffic is allowed |
| Values | Any non-empty value turns it on, including 0 and false; unset it to turn it off |
| Category | Feature toggles |
| Official docs | Listed |
| Checked against | v2.1.330 |
How to set it
For one session, export it in the shell that starts Claude Code:
export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1
claude1 air-gapped or strict-egress machines that should only reach the model API.
To apply it to every session, add it to the env object of a settings file:
// ~/.claude/settings.json
{
"env": {
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
}
}Known issues
- Setting it to 0 or false still disables the traffic. Only removing the variable turns it back on. Source: docs: env vars.
- It also stops feature-flag fetching, so Remote Control and other flag-gated features are unavailable. A user report shows the newest model missing from the /model picker when flags are skipped; /model with the full model ID still works. Source: issue #108726.
- Early 2026 versions dropped subscribers from the 1-hour prompt cache to 5 minutes when telemetry was off. That was fixed in April 2026; to pin the TTL, set CLAUDE_CODE_PROMPT_CACHE_TTL=1h. Source: issue #45381.
Release notes that mention it
- Claude Code "This sign-in cannot read meetings": Why the claude.ai Meetings Connector Fails and /login Does Not Fix It
- /plugin enable cc-plugin-you-should-know@builtin: What Claude Code's You Should Know Mod Does
- How to Install and Update Claude Code: npm install -g @anthropic-ai/claude-code, Native Installer and Windows
- Claude Code Shows Two Answers and Asks Which Is Better: How to Turn Off Response Comparison
Related variables
CLAUDE_CODE_DISABLE_ADMIN_ENV_UNION: When set to true, uses only the leading admin tier's environment settings instead of merging (unioning) the environment across all admin tiers.CLAUDE_CODE_DISABLE_ARTIFACTCLAUDE_CODE_DISABLE_ATTACHMENTS: File/image attachments.CLAUDE_CODE_DISABLE_AWAITING_USER_IDLE: When set, stops the session from being treated as idle while it waits for user input, so time parked on the user is not counted as idle.CLAUDE_CODE_DISABLE_CFC_PROMPTCLAUDE_CODE_DISABLE_COMMAND_INJECTION_CHECK: Previously allowed disabling command injection detection.CLAUDE_CODE_DISABLE_CRON: Disable cron/scheduled task functionality.CLAUDE_CODE_DISABLE_DIR_SYNC: Turns off the background directory-sync worker on a remote session.
Frequently asked questions
What does CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC do?
Turns off auto-updates, telemetry, error reporting, /feedback, release notes and feature-flag fetching in one switch; model API calls are unaffected.
What is the default value of CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC?
Unset, so nonessential traffic is allowed.
What values does CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC accept?
Any non-empty value turns it on, including 0 and false; unset it to turn it off.
Which Claude Code version has CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC?
Present since v2.1.69 or earlier and still present in v2.1.332.
How do I set CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC?
Export it before starting Claude Code (export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1), or add it to the "env" object in ~/.claude/settings.json to apply it to every session. 1 air-gapped or strict-egress machines that should only reach the model API.
All variables, searchable: Claude Code environment variables.