How to turn off Claude Code telemetry
Short answer
Set DISABLE_TELEMETRY=1 to turn off Claude Code’s usage metrics and DISABLE_ERROR_REPORTING=1 to turn off its error reports, in your shell or in the env block of ~/.claude/settings.json.
- Usage metrics hold latency, reliability and usage patterns, never your code, prompts or file paths.
- Error reports hold Claude Code’s own errors, with known patterns of secrets and paths redacted.
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1turns both off at once, with auto-updates, release notes and/feedback.- OpenTelemetry sends nothing until
CLAUDE_CODE_ENABLE_TELEMETRY=1, and then only where you point it. - ccdeck’s Telemetry Radar shows which OpenTelemetry flags your settings turn on, and can capture what reaches your collector.
What Claude Code sends on its own
- Metrics go to Anthropic and to third-party logging infrastructure over TLS. They hold “latency, reliability, and usage patterns,” and “never include your code, prompts, or file paths.”
- Error reports hold error messages and stack traces from Claude Code’s own internals, and go to a third-party error tracking service. Claude Code first redacts known patterns of secrets, file paths, e-mail addresses and other personal information. They are on only if you sign in with Pro, Max or Ultra, run version 2.1.198 or later, connect straight to the Claude API, and your organization has no zero data retention or HIPAA agreement.
On Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry and Claude Platform on AWS, both start off. To turn them off, set these variables in your shell or in the env block of ~/.claude/settings.json:
{
"env": {
"DISABLE_TELEMETRY": "1",
"DISABLE_ERROR_REPORTING": "1"
}
}
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 turns both off at once, with auto-updates, release notes and /feedback. It and DISABLE_TELEMETRY also stop feature-flag fetching, which can make Remote Control unavailable.
Writing 0 does not turn them back on. These three variables read only whether they are set, so "0" still opts out. To turn one back on, delete it.
More about what else leaves your machine
- To talk to the model, Claude Code sends data that “includes all user prompts and model outputs, encrypted in transit via TLS 1.2+.”
- On the Claude API,
/feedback,/bugand/sharesend “a copy of your conversation history including code” when you run them.DISABLE_FEEDBACK_COMMAND=1turns them off. - The “How is Claude doing this session?” survey records only your rating. A transcript goes only if you answer Yes to the question after it.
CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY=1turns the survey off. - Before WebFetch reads a page, it sends the hostname alone to
api.anthropic.comfor a safety check, on every provider."skipWebFetchPreflight": truein your settings turns it off;CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFICdoes not.
OpenTelemetry, only where you send it
Claude Code can also export metrics, events and traces through OpenTelemetry, for your own monitoring. In Anthropic’s words, this export “is opt-in and requires explicit configuration,” starting with CLAUDE_CODE_ENABLE_TELEMETRY=1, and its data is “sent only to the OTel endpoint you configure, never to Anthropic.”
By default an event records the length of a prompt or a response, not its text. Each kind of content has its own flag, off by default:
OTEL_LOG_USER_PROMPTS: your prompts.OTEL_LOG_ASSISTANT_RESPONSES: Claude’s responses. Left unset, it followsOTEL_LOG_USER_PROMPTS.OTEL_LOG_TOOL_DETAILS: tool input, such as Bash commands, file paths and URLs, and MCP server and tool names.OTEL_LOG_TOOL_CONTENT: file contents and command output that tools return, in trace spans.OTEL_LOG_RAW_API_BODIES: every API request and response, which “include the entire conversation history.”
Signed in with OAuth, the exports also carry your e-mail address, as user.email. Since version 2.1.282, a repository’s .claude/settings.json cannot turn any of this on or choose where it goes, only switch it off. To read the exports without a collector, use the console exporter.
ccdeck’s Telemetry Radar, to see what is on
ccdeck is a free, open-source dashboard for Claude Code and Codex sessions that runs on your machine. Its Telemetry Radar opens from Radar, the last door on the stripe on the right.
npx ccdeck --ref=claude-code-telemetry
- Configuration lists the OpenTelemetry destinations and flags in your user, cached organization and managed settings, and which file set each; on Linux, also those running sessions were started with. Credentials and endpoint paths stay hidden.
- Each flag gets a switch, for new sessions. It writes
"1"or"0"underenvin~/.claude/settings.json. Flags from managed or organization settings, or from a session’s launch, are locked. - Monitor finds Claude Code’s collector and captures what reaches it while ccdeck runs, on macOS, Linux and Windows, showing each export as an overview and as JSON.
- Captured messages stay in ccdeck’s memory, up to 24 hours of them, and are sent nowhere.
What it misses. It decodes only plaintext OTLP over gRPC on IPv4: an HTTPS export shows as a connection it cannot read, and model API calls and Anthropic’s own metrics and error reports are out of its reach. A connection does not prove an export was sent; an empty list does not mean telemetry is off. It reads only settings files on macOS and Windows, never another user’s sessions, and neither shows nor switches DISABLE_TELEMETRY or DISABLE_ERROR_REPORTING. Claude Code only.
Its switches outlast ccdeck. Switching a flag off writes "0" rather than removing it, and npx ccdeck --uninstall takes only ccdeck’s hooks out of ~/.claude/settings.json, so the flag stays there.
ccdeck sends usage reports of its own, on by default: its version, language and install method, your system, your IP address and a device fingerprint, rough counts such as how many sessions ran in a day, which trackers you connected and how many, and the errors it hits. Start it with AGENTS_DECK_NO_REPORTS=1 to send none.
More about capture permissions
Capture needs an administrator once. On macOS and Linux, Radar shows Allow capture…, which asks for your password. On macOS it adds a ccdeck helper that runs at every startup and puts your user in the access_bpf group, as Wireshark’s ChmodBPF does. On Linux it installs tcpdump if it is missing, gives it capture rights, and lets only your group run it. On Windows, install Wireshark with Npcap yourself. These changes stay after npx ccdeck --uninstall; ccdeck’s README says how to undo them. Configuration works without any of them.
Step by step
Sources
Read on . What ccdeck does is checked against ccdeck 4.0.1, and what another tool does against its own documentation.
- Claude Code docs: Data usage, Telemetry services
- Claude Code docs: Data usage, Default behaviors by API provider
- Claude Code docs: Monitoring, Common configuration variables
- Claude Code docs: Monitoring, Security and privacy
- Claude Code docs: Environment variables
- Claude Code docs: Settings reference, Variables Claude Code ignores in env
- Claude Code docs: Settings reference, Privacy and telemetry
- The ccdeck README at 4.0.1