Skip to content

All posts

AI

How to turn off Claude Code telemetry and nonessential network traffic

Ritesh Patel

AI: How to turn off Claude Code telemetry and nonessential network traffic

Set CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC to 1 to stop Claude Code’s optional network traffic in one step. It covers auto-updates, telemetry, error reports and the /feedback command. Model requests still go out, and the WebFetch domain check runs unless you set skipWebFetchPreflight. Put the variable in your settings file so it applies to every session.

What the nonessential traffic switch covers

The environment variables reference lists what the switch turns off. It covers auto-updates, telemetry, error reporting, the /feedback command, Claude-drafted feedback, release notes, the PR and MR status badge checks, and availability checks such as the fast mode check. It also stops feature-flag fetching.

Three things stay outside the switch. The WebFetch domain check has its own key, skipWebFetchPreflight. Official plugin marketplace registration has its own variable, CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL. Gateway model discovery has its own opt-in, so the switch does not change it.

The switch also covers background auto-updates. The reference does not say whether it stops a manual claude update, so test that on one machine before you rely on it.

What is on by default, by provider

Defaults depend on how developers connect. The data usage page gives the defaults for each provider in one table.

Traffic Claude API (direct) Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, Claude Platform on AWS Turn off with
Metrics On Off DISABLE_TELEMETRY=1
Error reports On for Pro, Max and Ultra sign-ins on v2.1.198 or later Off DISABLE_ERROR_REPORTING=1
/feedback reports On Off, written to a local archive instead DISABLE_FEEDBACK_COMMAND=1
Session quality surveys On On CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY=1
WebFetch domain check On On skipWebFetchPreflight: true in settings

On the third-party platforms, metrics, error reports and /feedback are off by default. Surveys and the WebFetch check run everywhere. A team on the direct Claude API should expect metrics to be on unless it sets a switch, so the steps below matter most there.

Turn off nonessential traffic in one step

  1. Choose the scope. User settings in ~/.claude/settings.json apply to every project on one machine. Managed settings apply to every machine your organization deploys them to, and they take precedence over user, shared project and local settings. For a team-wide control, use managed settings.
  2. Add the variable to the env block of the file you chose.
{
  "env": {
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
  }
}
  1. Start a new Claude Code session after the change. The network configuration page describes environment variables as read at startup, so an open session may keep the old value.
  2. Confirm the file loaded. Run /status and read the Setting sources line, which lists each settings file Claude Code loaded for the session.

The variable has no status output of its own, so confirm the effect on a test machine by checking its network traffic.

Turn off each source separately

If you want to keep one source on, for example error reports for your own triage, use the separate variables. Each row below is a single switch.

Variable What it turns off Notes
DISABLE_TELEMETRY=1 Usage metrics: latency, reliability and usage patterns Also turns off feature-flag evaluation, which can make Remote Control unavailable
DISABLE_ERROR_REPORTING=1 Error messages and stack traces from Claude Code internals Does not affect feature flags
DISABLE_FEEDBACK_COMMAND=1 Submissions from /feedback, /bug and /share Those submissions include a copy of the conversation
CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY=1 The “How is Claude doing this session?” prompt Also off when the telemetry or nonessential switches are set
DO_NOT_TRACK Telemetry intake, and the feedback survey The network page lists it next to DISABLE_TELEMETRY
DISABLE_AUTOUPDATER=1 Background auto-updates only Leaves a manual claude update working

Most of these switches read whether the variable is set, not what value it holds. The environment variables reference says that any non-empty value, including 0, counts as set. Setting DISABLE_TELEMETRY=0 therefore does not turn telemetry back on. To restore the default, unset the variable.

Turn off the WebFetch check and marketplace registration

The WebFetch domain check sends the hostname of each fetched URL to api.anthropic.com before the fetch. To turn it off, set skipWebFetchPreflight in a settings file.

{
  "skipWebFetchPreflight": true
}

The data usage page warns that without the check, WebFetch retrieves any URL without consulting the blocklist. Pair the setting with WebFetch permission rules if Claude must stay within certain domains.

Block the telemetry hosts at your proxy

If your proxy or firewall controls outbound traffic, the network configuration page lists the hosts that carry optional telemetry. Set the switches first, so Claude Code stops trying to reach these hosts. Blocking them at the proxy is then a second layer.

Host What it carries Turned off by
http-intake.logs.us5.datadoghq.com Operational telemetry events, sent only when the CLI uses the Anthropic API directly DISABLE_TELEMETRY or DO_NOT_TRACK
browser-intake-us5-datadoghq.com Operational error reports, sent when a server-side rollout gate enables them DISABLE_ERROR_REPORTING or DISABLE_TELEMETRY
api.anthropic.com Claude API requests, the WebFetch check, feature-flag fetches and telemetry event logging Not optional. Keep it reachable

Sessions on third-party providers never send to the two Datadog hosts, so the block matters most on direct Claude API installs.

Add OpenTelemetry only if your team uses it

OpenTelemetry export is opt-in. The monitoring page says CLAUDE_CODE_ENABLE_TELEMETRY must be set to 1 before the exporters work. If your team does not run a collector, leave it unset. If it does run one and you want an exporter off, set that exporter to none.

export OTEL_METRICS_EXPORTER=none
export OTEL_LOGS_EXPORTER=none
export OTEL_TRACES_EXPORTER=none

Prompt text is redacted by default, and assistant responses are redacted too. OTEL_LOG_USER_PROMPTS is off by default, so leave it unset unless your review process approves prompt logging. The monitoring page also says that OTEL_* variables in project or local settings files are ignored, so set exporter choices in user or managed settings.

Put the controls where they hold

A user-level setting is a default for one person. If every machine must keep these switches on, use managed settings. The settings page says managed settings take precedence over the command line, user, shared project and local files. Most env values in a shared repository file apply only after each teammate trusts the folder, so do not rely on that file for a team-wide control.

For the wider set of controls on coding agents, start at the coding agents page. The download page describes the product. For the traffic and the routing side, read the gateway post. For the update settings, read the auto-updates post.

Checked against the Claude Code documentation as fetched on 2026-11-21, which describes features up to v2.1.327. Confirm the version on your machines with claude --version before you roll out the change.

Frequently asked questions

Does the nonessential traffic switch stop Claude Code from sending prompts to the model?

No. The switch covers optional traffic: auto-updates, telemetry, error reports, the feedback command, release notes and availability checks. Model requests still go out to your provider or gateway. The WebFetch domain check also still runs unless you set skipWebFetchPreflight to true in settings. Check the list of disabled traffic before you block any host, so you do not stop a request that a developer needs to get an answer.

Will setting DISABLE_TELEMETRY to 0 turn telemetry back on?

No. The environment variables reference says that for these switches any non-empty value counts as set, and 0 is a non-empty value. So DISABLE_TELEMETRY=0 keeps telemetry off. To get the default back, unset the variable or leave it empty. Write the rule into your rollout notes, because a developer who sets 0 to test the change will not see the expected result.

Does turning off telemetry make Remote Control unavailable?

It can. The data usage page says that DISABLE_TELEMETRY and CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC both turn off feature-flag evaluation, which can make Remote Control unavailable. DISABLE_ERROR_REPORTING does not. If your team uses Remote Control, test it with the switches you plan to set before you roll them out to every machine.

What stays on when developers use Bedrock, Google Cloud's Agent Platform or Microsoft Foundry?

Metrics, error reports and /feedback reports are off by default on those platforms. Session quality surveys and the WebFetch domain check run on every provider. Set CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY to 1 to stop the surveys, and skipWebFetchPreflight to true if you also want the WebFetch check off. The WebFetch check sends only the hostname to api.anthropic.com, so a proxy that blocks that host makes WebFetch fail.

Ritesh Patel, Founder & VP Product, Nirmata

Ritesh Patel is a founder of Nirmata and leads its products. He writes about governing AI coding agents, MCP security and Kubernetes policy as code.

LinkedIn

Govern AI agents with AIControlsControl what AI agents do, and prove it.
Share

Stay up-to-date with the latest in AI, governance, and infrastructure

Subscribe to our free monthly newsletter to get industry news, DevOps tips, and articles right to your inbox on Kyverno, containerization, Kubernetes deployment & management and more.