OmniscioGuidesDoes Claude Code train on your code?
Does Claude Code train on your code?
The honest answer is that it depends on which account Claude Code is signed in to, not on Claude Code itself. The same CLI runs either way, and the policy that applies is the one attached to the account that authenticated the request.
This page sets out what Anthropic says for each kind of account, where each control lives, how long data is kept, what leaves your machine as telemetry, what cloud sessions do differently, and what zero data retention does and does not cover.
Last checked against Anthropic's Claude Code documentation on November 21, 2026. By the Omniscio team. Updated .
The answer by plan
Anthropic splits accounts into two groups, and the words it uses are worth quoting rather than paraphrasing.
For consumer users — Free, Pro, Max and Ultra — "we give you the choice to allow your data to be used to improve future Claude models", and training happens when that setting is on, "including when you use Claude Code from these accounts".
For commercial users — Team and Enterprise plans, the API, third-party platforms and Claude Gov — the policies are unchanged: "Anthropic does not train generative models using code or prompts sent to Claude Code under commercial terms", unless the customer has chosen to provide the data, for example through the Development Partner Program.
That program is the opt-in Anthropic names. An organization admin can expressly opt in for their organization, and it is available only for Anthropic's first-party API, not for Amazon Bedrock or Google Cloud's Agent Platform users. If your organization never opted in, you are not in it.
Sources: "Data training policy" and "Development Partner Program" in Anthropic's Data usage page, read November 21, 2026.
Change the setting
On a consumer plan the control is one page: claude.ai/settings/data-privacy-controls. Anthropic says the privacy settings can be changed at any time there.
There is nothing to switch on for a commercial plan, because the policy is the default rather than a toggle. What an admin can do is check that nobody has opted in: the Development Partner Program is an organization-level choice, and Anthropic describes it as an express opt-in by an admin.
One detail catches people out: the survey and feedback controls are separate from the training setting. Answering a session quality survey does not change your data training preference, and Anthropic says the transcripts submitted through that follow-up "do not impact your data training preferences and cannot be used to train our AI models".
Sources: "Data training policy", "Feedback using the /feedback command" and "Session quality surveys" in Anthropic's Data usage page, read November 21, 2026.
How long Anthropic keeps it
Retention follows the same split as training, with one exception for feedback.
- Consumer, model improvement allowed: a 5-year retention period.
- Consumer, model improvement not allowed: 30 days.
- Commercial (Team, Enterprise, API): 30 days by default.
- Zero data retention: available to qualified accounts on Claude for Enterprise; not part of the standard plan.
- Feedback: transcripts shared through
/feedback, or through/bugand/share, which report through the same path, are retained for 5 years.
Two other retention facts matter for a privacy review. Claude Code clients keep session transcripts locally in plaintext under ~/.claude/projects/ for 30 days by default, to make session resumption work, and cleanupPeriodDays changes that: a shorter period clears them sooner, so those sessions can no longer be resumed and their transcripts are gone from the laptop. And cloud sessions can be deleted individually: Anthropic says deleting a session permanently removes its event data.
Transcripts of sessions started or most recently continued in Claude Desktop or Cowork are exempt from that local limit by default.
Sources: "Data retention" in Anthropic's Data usage page, read November 21, 2026.
What stays on your machine
Claude Code runs locally. To reach the model it sends prompts and model outputs over the network, encrypted in transit with TLS 1.2 or later, and Anthropic says it is compatible with most popular VPNs and LLM proxies.
Encryption at rest depends on the provider you point it at: infrastructure-level AES-256 disk encryption on the Anthropic API, AWS-managed keys on Bedrock with customer-managed keys available through KMS, Google-managed keys with CMEK available on Google Cloud's Agent Platform, and the deployment's hosting option on Microsoft Foundry.
Everything else that accumulates — settings, allowed tools, MCP server configuration and session history — sits in ~/.claude and ~/.claude.json in your home folder. That is also why the uninstall guide warns before it deletes anything.
If you want the model request itself not to reach Anthropic, that is a different feature: the sandbox confines what Claude may run on your machine, and a gateway or a Bedrock deployment changes who the request reaches. Anthropic's managed settings page covers the policy an organization can enforce on all three.
Sources: "Local Claude Code: Data flow and dependencies" and "Encryption at rest" in Anthropic's Data usage page, read November 21, 2026.
What leaves as telemetry
Anthropic describes two operational streams, each with its own switch.
Metrics are latency, reliability and usage patterns, sent to Anthropic and third-party logging over TLS. Anthropic states plainly that metrics "never include your code, prompts, or file paths". DISABLE_TELEMETRY=1 turns them off.
Error reports are error messages and stack traces from Claude Code's own internals. Claude Code redacts known patterns of secrets, file paths, email addresses and other personal information before anything leaves the machine. DISABLE_ERROR_REPORTING=1 turns them off. Error reporting only runs for Pro, Max and Ultra sign-ins on v2.1.198 or later, connecting directly to the Claude API, with no zero data retention or HIPAA agreement in place.
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC turns off all of it at once. One consequence is worth knowing before you set it: it also disables feature-flag evaluation, which can make Remote Control unavailable.
On Bedrock, Google Cloud's Agent Platform, Microsoft Foundry and Claude Platform on AWS, telemetry, error reporting and /feedback are off by default. Session quality surveys and the WebFetch domain safety check are the exceptions and run on every provider.
Sources: "Telemetry services" and "Default behaviors by API provider" in Anthropic's Data usage page, read November 21, 2026.
Cloud sessions
A cloud session runs the same Claude Code on an Anthropic-managed virtual machine instead of your computer, which moves the data question rather than answering it.
- Your repository is cloned into the session's isolated VM, and Anthropic stores the session transcript so you can return to it later.
- Code and session data are subject to the retention and usage policies for your account type.
- GitHub credentials are stored encrypted on Anthropic's servers and never enter the VM; GitHub traffic from the VM goes through an Anthropic proxy that attaches them server-side.
- All outbound traffic goes through a security proxy for audit logging and abuse prevention.
Anthropic adds one scoping note that matters for a security review: Claude accesses the repository where you start a session, and not repositories you have connected but never started a session in.
Sources: "Data access" and "Cloud execution: Data flow and dependencies" in Anthropic's Data usage page, read November 21, 2026.
Zero data retention
Zero data retention (ZDR) is the strongest arrangement Anthropic documents for Claude Code, and it is narrow on purpose. When it is enabled, "prompts and model responses generated during Claude Code sessions are processed in real time and not stored by Anthropic after the response is returned", except where the law or abuse prevention requires otherwise.
It is not part of the standard Claude for Enterprise plan, it cannot be switched on from admin settings, and it is enabled per organization by Anthropic's account team after confirming eligibility. A new organization under the same account does not inherit it.
ZDR applies to the request, not to your whole Claude account. A developer who signs in with a personal account or an API key from a different organization is not covered. To require that logins belong to the ZDR organization, Anthropic points at the forceLoginMethod and forceLoginOrgUUID managed settings.
Several features are disabled at the backend when ZDR is on, because each needs Anthropic to store something:
- Cloud sessions, including those started from the desktop app, and the unified Chat and Cowork experience that depends on them.
- Claude Tag, artifacts in Claude Code, and Claude Docs.
- Feedback submission through
/feedback,/bugand/share. - Remote Control, which stores the transcript to sync the conversation across devices.
Model availability is affected too. Fable 5.2, Fable 5.1 and Fable 5 require data retention by default and are governed by Anthropic's Covered Models policy, so a ZDR organization may see them absent or disabled in the model picker. Other models stay available, and the best alias resolves to Opus.
Sources: the introduction, "ZDR scope", "What ZDR does not cover", "Features disabled under ZDR" and "Model availability under ZDR" in Anthropic's Zero data retention page, read November 21, 2026.
If you are the one being asked
Most of the people who read this page are answering a colleague, a client or a security questionnaire. Four answers cover the usual questions, and each names the place to check it rather than asking anyone to take our word.
- "Is our code used to train the model?" If the account is on commercial terms and nobody opted into the Development Partner Program, Anthropic says no. Check the plan and check the opt-in.
- "How long is it kept?" 30 days on commercial terms, unless the organization arranged ZDR.
- "What about the transcripts on developer laptops?" They are in
~/.claude/projects/in plaintext, cleared aftercleanupPeriodDays, 30 days by default. A disk-encryption policy on the laptop is the control that covers them. - "Does the vendor see our telemetry?" Metrics carry no code, prompts or file paths, and error reports are redacted; both can be turned off with one environment variable each.
Anthropic publishes the underlying documents itself, and they are the ones a questionnaire should cite: the Commercial Terms of Service for Team, Enterprise and API accounts, the Consumer Terms for Free, Pro, Max and Ultra, and the Privacy Policy, with the Trust Center for compliance artifacts.
Sources: "Data retention" and the closing legal references in Anthropic's Data usage page, read November 21, 2026.
Running several sessions at once
A privacy review gets harder as a team runs more sessions, because every session is another process holding your code in its context and another transcript in ~/.claude/projects/. Omniscio, the desktop app we make for running many Claude Code sessions at once, puts them in one window with a sidebar, so you can see every session that is running and close the ones nobody is using.
It is free to use with up to 8 projects. Pro is $20/month or $192/year, and neither plan includes an AI allowance: sessions run on your own account or key, billed by that provider, which is also the account whose data policy applies.
The analytics guide covers what a team can measure without anyone reading a transcript, and the managed settings guide covers the policy an organization can push to every machine.
Where these answers come from
- Anthropic, Data usage: the training policy for consumer and commercial users, the Development Partner Program,
/feedbackretention, the session quality survey, retention by account type, the local data flow, telemetry, and the per-provider defaults. Read November 21, 2026. - Anthropic, Zero data retention: what ZDR covers and does not, routing logins to the organization, the disabled features, model availability, and how to request it. Read November 21, 2026.
- Anthropic, Commercial Terms of Service and Consumer Terms: the contract behind each policy. Linked, not quoted.
- Anthropic, Security: the security controls this page points at, including cloud execution security. Read November 21, 2026.
Nothing on this page is legal advice, and none of it is our interpretation of the contract where Anthropic states the rule itself. Where the answer depends on your account, this page says which account and where the setting lives.
Common questions
Does Claude Code train on my code?
It depends on the account. On commercial terms, which covers Team and Enterprise plans, the API, third-party platforms and Claude Gov, Anthropic says it does not train generative models on code or prompts sent to Claude Code unless the customer has chosen to provide the data, for example through the Development Partner Program. On the Free, Pro, Max and Ultra plans, training is a setting the user controls, and it applies to Claude Code use from those accounts too.
How do I stop Claude from training on my code?
On a consumer plan, change the privacy setting at claude.ai/settings/data-privacy-controls, where Anthropic says the choice can be changed at any time. No setting exists to turn on for a commercial plan: Anthropic does not train on that data unless an admin explicitly opts in, for example to the Development Partner Program.
How long does Anthropic keep Claude Code data?
On consumer plans, five years for users who allow model improvement and 30 days for users who do not. On commercial plans, 30 days by default. Transcripts sent through /feedback, /bug or /share are retained for five years on either. Zero data retention is a separate arrangement for qualified Enterprise accounts.
Does Claude Code send my code anywhere else?
Claude Code sends prompts and model outputs to the model provider you configured, encrypted in transit. Anthropic says its usage metrics never include code, prompts or file paths, and that error reports redact known secrets, file paths and email addresses before they leave the machine. Each stream has its own environment variable to turn it off.
What is zero data retention for Claude Code?
It is an arrangement for qualified Claude for Enterprise accounts where prompts and responses are processed in real time and not stored after the response is returned, apart from what the law or abuse prevention requires. It is not included in the standard Enterprise plan, cannot be switched on from admin settings, and requires Anthropic to enable it for the organization.
Do cloud sessions change who can see my code?
They change where it runs. In an Anthropic-hosted cloud session, the repository is cloned into an isolated virtual machine, the transcript is stored so you can return to it, and GitHub credentials stay encrypted on Anthropic's servers and never enter the VM. The data follows the same retention and usage policies as your account type, so a zero data retention organization does not get cloud sessions at all.
Every session in one window, on your own account
Omniscio runs Claude Code sessions side by side and shows you each one. Your account, your key, your data policy. The features page lists what it does today.