Writing

claudecliconfigprivacytelemetrytools

Disabling Telemetry in Claude Code

What Claude Code's telemetry environment variables actually control, how to switch them off, and what changes when you do.

1. What it is

Claude Code sends telemetry from your machine to Anthropic. Telemetry here means usage and operational analytics: which features run, how often, and similar usage signals. It does not include the contents of your files.

Telemetry is one of several outbound channels. The others are error reporting (operational error logging) and the feedback/bug command. These are controlled separately.

Telemetry is not the same as model training. Whether your coding sessions can be used to train Anthropic’s models is governed by an account-level privacy setting, not by the telemetry environment variables described here. Disabling telemetry does not change your training preference, and changing your training preference does not disable telemetry.

On Bedrock, Vertex, Foundry, and Claude Platform on AWS, telemetry, error reporting, and bug reporting are off by default.

The relevant environment variables are:

  • DISABLE_TELEMETRY — opts out of usage analytics.
  • DISABLE_ERROR_REPORTING — opts out of operational error logging.
  • DISABLE_BUG_COMMAND — disables the bug-report command.
  • CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC — an aggregate switch that bundles DISABLE_AUTOUPDATER, DISABLE_BUG_COMMAND, DISABLE_ERROR_REPORTING, and DISABLE_TELEMETRY.

2. What you should do

To disable telemetry for the current shell:

export DISABLE_TELEMETRY=1

To persist it, add it to settings.json. Use the user-level file at ~/.claude/settings.json to apply it to all your projects, or a project-level .claude/settings.json to apply it to one repository:

{
  "env": {
    "DISABLE_TELEMETRY": "1"
  }
}

To disable telemetry, error reporting, the bug command, and the auto-updater together, use the aggregate switch instead:

{
  "env": {
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
  }
}

Notes:

  • A project-level .claude/settings.json checked into a repository applies the setting to everyone who works in that repository.
  • A shell environment variable takes precedence over the same key in settings.json. A pre-existing DISABLE_TELEMETRY=0 in a user’s shell will override a repository default of 1.

3. Impact of doing it

Setting DISABLE_TELEMETRY=1:

  • Stops usage analytics from leaving the machine.
  • Also stops Claude Code from fetching remote experiment gates. When gates are not fetched, Claude Code uses built-in default values for any behavior those gates control. This can change feature availability or defaults, not only analytics.

Setting CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 additionally:

  • Disables the auto-updater. Updates become a manual task.
  • Disables error reporting and the bug command.

What it does not do:

  • It does not change your model-training preference. That remains controlled by the account-level privacy setting.
  • It does not disable the WebFetch domain safety check. Before fetching a URL, the WebFetch tool sends the requested hostname (hostname only, not the full URL or page contents) to api.anthropic.com to check it against a safety blocklist. This runs regardless of provider and is not affected by the non-essential-traffic switch. If your network blocks api.anthropic.com, WebFetch requests fail until you allowlist the domain or set skipWebFetchPreflight: true in settings.

Operational logging is separate from training. These variables reduce what leaves the machine operationally; they do not retroactively affect data already sent or sessions you resume.