How to Disable Claude Code Telemetry and Error Reporting

How to Disable Claude Code Telemetry and Error Reporting

To make Claude Code disable telemetry, set the environment variable DISABLE_TELEMETRY=1. To turn off error reporting, set DISABLE_ERROR_REPORTING=1. Put both in the env block of a settings.json file, or export them in your shell before you start claude.

If you want everything optional switched off in one move, set CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 instead. That single variable covers telemetry, error reports, the /feedback command and auto-updates, but it also makes a few features unavailable. Your prompts and Claude’s replies still travel to your model provider either way, because that is how the tool works.

We set each switch in a real session below, checked that Claude Code picked it up, and noted what changed on screen.

Browse all our Claude Code tutorials for more fixes and how-tos.

Tested with Claude Code v2.1.332 on macOS on December 2, 2026. We used a throwaway demo project called notes-app with two tiny files, and started Claude Code with project and local settings only so nothing outside the demo was changed.

We tested on macOS; the Windows and Linux steps follow Anthropic’s official instructions.

Quick Summary: Every Claude Code Telemetry Off Switch

What you want to stopVariable to setSide effects
Usage metricsDISABLE_TELEMETRY=1 or DO_NOT_TRACK=1Also stops feature-flag fetching and session surveys
Error reportsDISABLE_ERROR_REPORTING=1None listed in the docs
Feedback reportsDISABLE_FEEDBACK_COMMAND=1/feedback, /bug and /share stop working
Session quality surveysCLAUDE_CODE_DISABLE_FEEDBACK_SURVEY=1None
All of the above at onceCLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1Also stops auto-updates, release notes and Remote Control

What Claude Code Telemetry Is and What It Sends

Claude Code is Anthropic’s coding agent for the terminal, part of the Claude AI family. Like most developer tools, it sends some operational data home so the team can see how the product behaves in the wild. Anthropic’s data usage page splits this into two kinds: usage metrics and error reports.

Usage metrics cover latency, reliability and usage patterns. The docs say metrics never include your code, prompts or file paths. They go to Anthropic and to third-party logging infrastructure over TLS.

Error reports are error messages and stack traces from Claude Code’s own internals. They go to a third-party error tracking service over TLS. Before anything leaves your machine, Claude Code redacts known patterns of secrets, file paths, email addresses and other personal information.

Anthropic's Claude Code data usage docs with the Metrics paragraph and the DISABLE_TELEMETRY=1 opt-out highlighted
The official docs describe two kinds of telemetry and give each its own opt-out variable.

Error reporting is not on for everyone. According to the docs, it only runs when all four of these are true:

  • You sign in with a Claude Pro, Max or Ultra subscription
  • You are on Claude Code v2.1.198 or later
  • You connect directly to the Claude API
  • Your organization has no zero data retention or HIPAA agreement

There are two more optional channels worth knowing. The /feedback command sends a copy of your conversation history, including code, when you choose to submit a report. Session quality surveys, the “How is Claude doing this session?” prompt, record only your rating.

Telemetry is the optional layer. Your prompts and Claude’s answers are the product itself, and no opt-out variable changes that.

Diagram of what Claude Code sends: prompts and replies always, plus optional usage metrics, error reports, feedback and update checks with their off switches
Only the top row is required. Every row below it has an off switch.

What We Tested: Telemetry Opt-Outs in a Real Session

We wanted to see more than a list of variable names. So we ran Claude Code four times in the demo project: once with no opt-outs, once with four switches in a settings file, once with the single lockdown switch, and once with shell exports.

One honest limit first. The on-screen checks below prove that Claude Code read each variable and changed its behavior. We did not inspect network traffic, so the statements about what stops being sent come from Anthropic’s documentation.

Step 1: See the default behavior

With no opt-outs set, we typed /feedback. Claude Code opened its feedback panel, ready to write a report. This is the default on the Claude API.

Claude Code session with no opt-outs where the /feedback command opens the Feedback drafts panel
By default, /feedback opens a panel where you can write and send a report.

Step 2: Add the opt-outs to a settings file

Next we created .claude/settings.local.json in the project with four variables in its env block. Then we started Claude Code again and typed /feedback.

{
  "env": {
    "DISABLE_TELEMETRY": "1",
    "DISABLE_ERROR_REPORTING": "1",
    "DISABLE_FEEDBACK_COMMAND": "1",
    "CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY": "1"
  }
}

This time the command refused to open. Claude Code printed “/feedback has been disabled via the DISABLE_FEEDBACK_COMMAND environment variable”. The /bug command gave the same message, which matches the docs: both report through the same path.

Terminal showing four opt-out variables in settings.local.json and Claude Code reporting that /feedback has been disabled
With the env block in place, Claude Code names the variable that switched the command off.

Step 3: Confirm the variables are live in the session

The feedback message proves one variable. To check all four, we ran a shell command from inside the session by starting the line with !.

! env | grep -E 'TELEMETRY|ERROR_REPORTING|FEEDBACK|NONESSENTIAL|DO_NOT_TRACK'

All four variables came back with the value 1. That confirms the env block in a settings file reaches the running session, with no shell export needed.

Claude Code session listing DISABLE_TELEMETRY, DISABLE_ERROR_REPORTING, DISABLE_FEEDBACK_COMMAND and CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY all set to 1
The four opt-outs from the settings file are set inside the session.

Step 4: Try the single lockdown switch

We replaced the four lines with one: CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC set to 1. After a restart, /feedback was blocked again, and the message named the new variable instead.

Terminal with only CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC set and Claude Code reporting /feedback disabled by that variable
One variable was enough to switch feedback off, and Claude Code says which one did it.

Step 5: Use shell exports for one terminal

Last, we removed the settings file and exported only DISABLE_TELEMETRY and DISABLE_ERROR_REPORTING in the shell. Here /feedback still opened, which shows each switch is separate. Turning off metrics does not turn off feedback.

We did notice one difference. In this run the command went straight to the report form and skipped the drafts panel from Step 1.

That fits the docs, which say Claude-drafted feedback depends on a fetched feature flag and DISABLE_TELEMETRY stops that fetch. It is one run, so treat it as a hint and not a rule.

Shell with DISABLE_TELEMETRY and DISABLE_ERROR_REPORTING exported and Claude Code still opening the Submit feedback form
Exports last for one terminal. With only these two set, /feedback still works.

How to Disable Claude Code Telemetry: Every Method

All of these switches are environment variables, not settings keys. Anthropic’s settings reference says so directly: you set them in the env key of a settings file or in your shell. Pick the place based on how far you want the change to reach.

Method 1: Your user settings file (every project)

Open ~/.claude/settings.json, creating it if it does not exist, and add an env block. This applies every time claude runs, no matter how it was launched.

{
  "env": {
    "DISABLE_TELEMETRY": "1",
    "DISABLE_ERROR_REPORTING": "1"
  }
}

If the file already has content, add the env key next to the existing keys and keep the JSON valid. Our guide on settings.json locations shows where each file lives on macOS, Windows and Linux.

Method 2: A project settings file (one repo)

Use .claude/settings.local.json for yourself in one project, as we did in the test. Use .claude/settings.json if the whole team should get the same opt-outs, since that file is checked into source control.

The docs note that project and local files cannot turn telemetry export on, but values that turn something off are still honored. The opt-out variables in this guide worked from our local settings file. For more on how these layers combine, see our walkthrough of settings file scopes.

Method 3: Shell exports (one terminal or every terminal)

For a single terminal session on macOS, Linux or WSL, export the variables before launching Claude Code:

export DISABLE_TELEMETRY=1
export DISABLE_ERROR_REPORTING=1
claude

To make that permanent, add the export lines to ~/.zshrc or ~/.bashrc. On Windows, the official docs give these equivalents:

# PowerShell, current session
$env:DISABLE_TELEMETRY = "1"

# PowerShell, every session
[Environment]::SetEnvironmentVariable("DISABLE_TELEMETRY", "1", "User")

:: CMD, every session
setx DISABLE_TELEMETRY "1"

Shell variables are read at startup, so restart Claude Code after changing them. Our list of useful environment variables covers other switches you can set the same way.

Method 4: Managed settings (a whole organization)

Admins can deliver DISABLE_TELEMETRY through the env block of managed settings, so it applies to every developer without relying on each person’s shell. The managed settings docs warn about one trade-off: with telemetry off, Claude Code stops sending the usage data that feeds the organization’s analytics dashboard.

What CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC Turns Off

This is the broadest switch. The environment variables reference lists what it disables:

  • Auto-updates
  • Telemetry and error reporting
  • The /feedback command and Claude-drafted feedback
  • Release notes
  • PR and MR status badge checks
  • Availability checks, such as the fast mode check
  • Session quality surveys and the transcript-share follow-up
Claude Code environment variables reference with the CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC row highlighted
The official reference row for the lockdown switch, including the warning that 0 and false still disable traffic.

It also turns off feature-flag fetching, and that has a cost. With fetching off, Remote Control is unavailable, along with commands such as /restart on subscription plans, /skill-doctor, /ship and /steward. If you rely on Remote Control, use the individual switches instead.

Two things are not covered. The WebFetch domain safety check still sends each requested hostname to api.anthropic.com; its own opt-out is skipWebFetchPreflight in settings, explained in our WebFetch fix guide. Official plugin marketplace auto-install has a separate variable too, CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL.

Because this switch stops auto-updates, you will need to run claude update by hand. If stopping updates is all you want, our guide on how to disable auto-update covers the narrower options.

Which Telemetry Switch Should You Use?

Most people only need the first two. The lockdown switch suits strict networks where any non-essential call is a problem.

Decision ladder for choosing between DISABLE_TELEMETRY, DISABLE_ERROR_REPORTING, the feedback switches and CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC
Pick the narrowest switch that covers what you want to stop.
Your situationRecommended setup
You want metrics and crash reports off, nothing else changedDISABLE_TELEMETRY=1 and DISABLE_ERROR_REPORTING=1 in user settings
You never want a transcript sent by accidentAdd DISABLE_FEEDBACK_COMMAND=1
The rating prompt annoys youCLAUDE_CODE_DISABLE_FEEDBACK_SURVEY=1, or "feedbackSurveyRate": 0 in settings
Locked-down or air-gapped style networkCLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1
You use Amazon Bedrock, Google Cloud’s Agent Platform or Microsoft FoundryMetrics, error reports and feedback are already off by default

Keep in mind that DISABLE_TELEMETRY has a smaller version of the same side effect. It stops feature-flag fetching as well, so some flag-gated features can go missing. The docs say Remote Control stays available with only this variable set, unless your organization requires Trusted Devices.

Telemetry Is Not the Same as Model Training or OpenTelemetry

Three things get mixed up under the word telemetry, and the switches above only handle one of them.

  • Operational telemetry: the metrics and error reports in this guide. Controlled by the variables above.
  • Model training: whether your conversations may be used to improve future models. On Free, Pro, Max and Ultra plans this is a privacy setting in your Claude account, not an environment variable.
  • OpenTelemetry export: an opt-in feature that sends data to a collector you run yourself. It stays off unless you set CLAUDE_CODE_ENABLE_TELEMETRY=1 and configure an exporter, as the monitoring docs explain.

So DISABLE_TELEMETRY=1 does not change your training preference, and it does not change how long Anthropic retains your conversations. For that side of the story, read our full breakdown of Claude Code data and privacy.

Opt-out variables control what Claude Code reports about itself. Your account’s privacy settings control what happens to your conversations.

Try It Yourself

You can repeat our check in two minutes without touching your main setup. Make an empty folder, add a local settings file, and see the result.

mkdir -p telemetry-test/.claude && cd telemetry-test
cat > .claude/settings.local.json <<'EOF'
{
  "env": {
    "DISABLE_TELEMETRY": "1",
    "DISABLE_ERROR_REPORTING": "1",
    "DISABLE_FEEDBACK_COMMAND": "1"
  }
}
EOF
claude

Inside the session, type /feedback. You should see the “has been disabled” message. Then run this line to list the variables:

! env | grep -E 'TELEMETRY|ERROR_REPORTING|FEEDBACK'

Once you are happy with the result, move the same env block into ~/.claude/settings.json to apply it everywhere.

Common Mistakes

  • Setting the value to 0 to turn telemetry back on. For DISABLE_TELEMETRY, DISABLE_ERROR_REPORTING and CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC, the docs say 0 and false still opt out. Remove or unset the variable instead.
  • Treating DO_NOT_TRACK the same way. It is the exception: Claude Code reads it as a normal boolean, so DO_NOT_TRACK=0 leaves telemetry on.
  • Writing the variables as top-level settings keys. They must sit inside the env object, with string values such as "1".
  • Expecting a shell export to stick. An export typed in one terminal is gone when you close it, unless you add it to your shell profile.
  • Using the lockdown switch and then wondering why Claude Code stopped updating. Auto-updates are part of what it disables.
  • Assuming telemetry off means nothing is sent. Prompts, code context and replies still go to your model provider on every request.

If your settings file seems to be ignored, the usual causes are invalid JSON or a higher-priority file. Our guide to settings.json problems walks through each one, and our list of common errors covers other startup issues.

Pro Tips

  • Prefer the settings file over shell exports. The docs say env values in settings apply no matter how claude was launched, which includes editor extensions and scripts.
  • Use /feedback as a quick health check. If you set DISABLE_FEEDBACK_COMMAND, the disabled message confirms your env block is being read.
  • Keep the survey but see it less often with feedbackSurveyRate, a number between 0 and 1 in settings.
  • On a team, commit the opt-outs to .claude/settings.json so every contributor gets them in that repo.
  • Recheck after big upgrades. Variable names can change, as when DISABLE_BUG_COMMAND became DISABLE_FEEDBACK_COMMAND; the older name is still accepted.

Cheat Sheet

Cheat sheet of Claude Code telemetry off switches and the files or shell commands where you set them
Every opt-out variable on the left, every place to set it on the right.

Frequently Asked Questions

Does Claude Code send my code as telemetry?

According to Anthropic’s docs, usage metrics never include your code, prompts or file paths. Error reports are redacted for known secret patterns, file paths and email addresses before they leave your machine. Your code is only sent in full when you submit a /feedback report or agree to share a transcript.

Is error reporting on by default?

Only in some cases. The docs say it runs for Pro, Max and Ultra sign-ins on v2.1.198 or later that connect directly to the Claude API, and not for organizations with a zero data retention or HIPAA agreement. Setting DISABLE_ERROR_REPORTING=1 turns it off regardless.

Will disabling telemetry break Claude Code?

No. In our test, sessions started and answered normally with every switch set. The trade-off is feature-flag fetching: DISABLE_TELEMETRY and the lockdown switch stop it, so some flag-gated features can be unavailable.

How do I turn telemetry back on?

Remove the variable from your env block, or run unset DISABLE_TELEMETRY in your shell, then restart Claude Code. Setting it to 0 does not work for the three main switches.

Does DISABLE_TELEMETRY stop Anthropic from training on my chats?

No. Training use is a separate choice tied to your account type and privacy settings. The variable only controls operational metrics.

Conclusion

To have Claude Code disable telemetry, add DISABLE_TELEMETRY=1 and DISABLE_ERROR_REPORTING=1 to the env block of your settings file, add DISABLE_FEEDBACK_COMMAND=1 and CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY=1 if you want feedback channels closed too, and save CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 for strict networks where losing auto-updates and Remote Control is acceptable. In our session the switches took effect from a local settings file on the next start, and Claude Code named the exact variable that blocked /feedback. Just remember that these switches cover what the tool reports about itself, while your conversations follow your account’s own privacy settings.

Newsletter

New AI tools in your inbox

The best new tools and the AI news that matters, in one short email. Unsubscribe any time.

Free · No spam · Unsubscribe any time

✓ Looks like you’re subscribed

Loading Google’s sign-up form…

Looks like you’re already subscribed

Thanks for reading! New AI tools and the AI news that matters will land in your inbox.

Not subscribed yet? Refresh the page to load the sign-up form.

The sign-up form couldn’t load. If you use an ad or content blocker, allow news.google.com and reload the page.

Free instant check before you pay. Takes a few seconds.

Scroll to Top