Issue 00 · Autumn 2026日本語 · RSS
AgentKoji

Claude Code Telemetry and Data Privacy

What Claude Code sends to Anthropic, whether it trains on it, how long it is kept, and the environment variables that turn telemetry off. Checked 2026-11-10.

TL;DR

  • On Free, Pro, Max and Ultra, your data trains future models only while the training setting is on. Under commercial terms (Team, Enterprise, API, third-party platforms), Anthropic does not train on Claude Code code or prompts unless the customer opts in.
  • Anthropic's operational telemetry is usage metrics and error reports. DISABLE_TELEMETRY=1 and DISABLE_ERROR_REPORTING=1 turn them off one at a time; CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC turns off all non-essential traffic.
  • On Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry and Claude Platform on AWS, telemetry, error reporting and /feedback reports are off by default. Session quality surveys and the WebFetch domain check still run.

Claude Code sends your prompts and the model’s outputs to the model provider, and by default it also sends Anthropic usage metrics and, on some sign-ins, error reports. Whether that data trains models and how long it is kept depends on whether your account is consumer (Free, Pro, Max, Ultra) or commercial (Team, Enterprise, API, third-party platforms). This article sorts out what the official docs say about each, lists the environment variables that turn telemetry off, and ends with a checklist for rolling Claude Code out to a team.

Everything below comes from the official docs as checked on 2026-11-10, when the latest Claude Code on npm was 2.1.322. We did not run any of the commands or settings shown here for this article. This is not legal advice; for contract questions, read the terms themselves or ask your legal team.

What leaves your machine

Claude Code runs locally, but to talk to the model it sends data over the network: all user prompts and model outputs, encrypted in transit with TLS 1.2 or later. The docs say it works with most popular VPNs and LLM proxies.

Encryption at rest depends on the provider:

ProviderEncryption at rest
Anthropic APIInfrastructure-level disk encryption (AES-256). Zero Data Retention means no server-side persistence
Amazon BedrockAES-256 with AWS-managed keys; customer-managed keys via AWS KMS
Google Cloud’s Agent PlatformGoogle-managed keys; CMEK available
Microsoft FoundryDepends on the hosting option. Hosted on Azure keeps prompts and completions within Azure; Hosted on Anthropic routes to Anthropic infrastructure with AES-256

Cloud sessions are different. They run in Anthropic-managed VMs by default: your repository is cloned into the VM, and Anthropic stores the session transcript so you can come back to it.

(source: https://code.claude.com/docs/en/data-usage, checked 2026-11-10)

Is it used for training?

The data-usage page splits accounts in two:

An organization admin can opt in to the Development Partner Program. The docs say it is available only on the Anthropic first-party API, not for Amazon Bedrock or Google Cloud’s Agent Platform users.

Two feedback paths are separate from this setting. Transcripts sent with /feedback (and /bug and /share, which use the same path) are kept for 5 years. After a session quality survey, you may be asked whether Anthropic can look at the transcript. Choosing Yes uploads it, with known API key and token patterns redacted, and keeps it for up to 6 months. The docs say survey responses cannot be used to train models.

(source: https://code.claude.com/docs/en/data-usage, checked 2026-11-10)

How long it is kept

AccountRetention
Consumer, model improvement on5 years
Consumer, model improvement off30 days
Commercial (Team, Enterprise, API), standard30 days
Commercial, Zero Data RetentionFor qualified Claude for Enterprise accounts. Not in the standard Enterprise plan; enabled per organization by the account team
Local transcripts on your machinePlaintext under ~/.claude/projects/, 30 days by default. Change with cleanupPeriodDays

Consumer users can change the privacy setting at any time at claude.ai/settings/data-privacy-controls. Cloud sessions can be deleted one at a time, which permanently removes the session’s event data.

(source: https://code.claude.com/docs/en/data-usage, checked 2026-11-10)

Anthropic’s telemetry and how to turn it off

The docs describe two kinds of operational telemetry:

VariableWhat it turns off
DISABLE_TELEMETRY=1Usage metrics. Also disables feature-flag fetching
DO_NOT_TRACK=1Same effect as DISABLE_TELEMETRY
DISABLE_ERROR_REPORTING=1Error reports
DISABLE_FEEDBACK_COMMAND=1/feedback, /bug, /share and Claude-drafted feedback
CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY=1Session quality surveys
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1All non-essential traffic: auto-updates, telemetry, error reporting, /feedback, release notes, surveys and more

Two details are easy to miss. For DISABLE_TELEMETRY, DISABLE_ERROR_REPORTING and CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC, the env-vars page says setting 0 or false still opts out; you unset the variable to turn the feature back on. DO_NOT_TRACK is read as a normal boolean, so 0 leaves telemetry on. Second, turning off feature flags (through DISABLE_TELEMETRY or the non-essential traffic switch) can make Remote Control unavailable.

The WebFetch domain safety check is not covered by any of these. Before fetching a URL, WebFetch sends only the hostname to api.anthropic.com to check a blocklist. It runs on every provider. To turn it off, set skipWebFetchPreflight: true in settings; the docs suggest pairing that with WebFetch permission rules.

(source: https://code.claude.com/docs/en/data-usage, checked 2026-11-10) (source: https://code.claude.com/docs/en/env-vars, checked 2026-11-10)

Bedrock, Agent Platform and Foundry

On Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry and Claude Platform on AWS, error reporting, telemetry and bug reporting are off by default. Session quality surveys and the WebFetch domain check are the exceptions; they run regardless of provider.

ServiceClaude APIBedrock / Agent Platform / Foundry / Claude Platform on AWS
MetricsOn by defaultOff by default
Error reportsOn for Pro, Max and Ultra sign-ins on v2.1.198+Off by default
/feedback reportsOn by defaultOff by default
Session quality surveysOn by defaultOn by default
WebFetch domain checkOn by defaultOn by default

On a third-party provider, /feedback and a Yes on the transcript follow-up write the report to a local archive under ~/.claude/feedback-bundles/ instead of uploading it. Nothing leaves the machine until you send that file yourself. If a host platform sets CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST, metrics default to on for these providers.

Contracts follow the same split. The legal page says that whether you use the Claude API directly or through Amazon Bedrock or Google Cloud’s Agent Platform, your existing commercial agreement applies to Claude Code unless agreed otherwise.

(source: https://code.claude.com/docs/en/data-usage, checked 2026-11-10) (source: https://code.claude.com/docs/en/legal-and-compliance, checked 2026-11-10)

Your own monitoring with OpenTelemetry

Separately from Anthropic’s telemetry, Claude Code can export metrics, events and (in beta) traces to your own collector over OpenTelemetry. It is opt-in. The quick start on the monitoring page:

export CLAUDE_CODE_ENABLE_TELEMETRY=1
export OTEL_METRICS_EXPORTER=otlp
export OTEL_LOGS_EXPORTER=otlp
export OTEL_EXPORTER_OTLP_PROTOCOL=grpc
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
claude

The docs say a working metrics setup shows claude_code.session.count in your backend. Other metrics include tokens, cost in USD, lines of code modified, commits, pull requests and active time.

Points that matter when a team turns this on:

(source: https://code.claude.com/docs/en/monitoring-usage, checked 2026-11-10) (source: https://code.claude.com/docs/en/env-vars, checked 2026-11-10)

Team rollout checklist

Built only from the pages above. Your contract and policies decide the actual answers.

Summary

FAQ

Does Claude Code use my code to train models?
It depends on the account. On Free, Pro, Max and Ultra, Anthropic trains on your data when the model-improvement setting is on. Under commercial terms (Team, Enterprise, API, third-party platforms), it does not train on code or prompts sent to Claude Code unless the customer opts in, for example through the Development Partner Program.
How do I turn off Claude Code telemetry?
Set DISABLE_TELEMETRY=1 for usage metrics and DISABLE_ERROR_REPORTING=1 for error reports. CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC turns off all non-essential traffic at once, including surveys. For these three, the docs say 0 or false still opts out; unset the variable to turn it back on.
How long does Anthropic keep Claude Code data?
Consumer accounts: 5 years with the model-improvement setting on, 30 days with it off. Commercial accounts: 30 days by default, with zero data retention available to qualified Claude for Enterprise accounts. Locally, transcripts stay under ~/.claude/projects/ for 30 days by default.
Is telemetry different on Amazon Bedrock or Google Cloud?
Yes. Metrics, error reports and /feedback reports are off by default on Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry and Claude Platform on AWS. Session quality surveys and the WebFetch domain safety check run on every provider.
Do OpenTelemetry logs include prompts and code?
Not by default. Prompt content, response text and tool arguments are off unless you set OTEL_LOG_USER_PROMPTS, OTEL_LOG_ASSISTANT_RESPONSES or OTEL_LOG_TOOL_DETAILS. When signed in with OAuth, user.email is included, sent only to the endpoint you configure.