Whether your Claude Code conversations are used to train AI models depends on which plan you're on and which account you're signed in with. On the Free, Pro, and Max consumer plans, your data is used for training only while the "Help improve our AI models" privacy setting on your account is turned on, and you can opt out by turning it off. Under commercial terms (Team, Enterprise, the API, and so on), your data isn't used for training in the first place.
Based on the original text of the Claude Code docs page "Data usage," Anthropic's Privacy Center, and the Claude Platform docs page "API and data retention," this article covers where the opt-out setting lives, what can still be used or kept after you turn it off, how each plan differs, and whether Anthropic trains on API data. Everything here was checked against those sources as of October 4, 2026.
The short answer: does Claude train on your Claude Code data?
Sources: Claude Code docs, "Data usage"; Anthropic Privacy Center (checked October 4, 2026)
Free, Pro, Max
Up to your setting
If the account setting is on, your data is used for training. Turn it off and training stops.
Team, Enterprise, API
Not used by default
Not used for training unless you choose to share it (feedback, for example).
Still kept when off
Ratings, reports, violations
👍👎 ratings, /feedback reports, and conversations flagged by safety systems follow separate rules.
Retention
30 days or 5 years
Separate from training. Consumer plans: 30 days with the setting off, 5 years with it on. Commercial: 30 days (API data is deleted within 30 days).
Contents
- 1. The training setting lives in your account, not on your machine
- 2. How to opt out of training on a consumer plan
- 3. What can still be used after you opt out
- 4. Plan by plan: training and data retention
- 5. Does Anthropic train on API data?
- 6. Sent separately from training: usage metrics and error reports
- 7. Conversation transcripts stored on your own computer
- 8. Choosing a setup for confidential work
- FAQ
1. The training setting lives in your account, not on your machine
The first thing to know is that whether your Claude Code data is used for training is not controlled by Claude Code's settings files or environment variables. For consumer plans (Free, Pro, and Max), the Claude Code "Data usage" page says the following:
- You get to choose whether your data is used to improve future Claude models.
- When this setting is on, data from Free, Pro, and Max accounts is used to train new models, including when you use Claude Code from those accounts.
- You can change your privacy settings at any time at claude.ai/settings/data-privacy-controls.
In other words, if you sign in to Claude Code with a Pro or Max account, training follows that account's privacy setting. You change it on the claude.ai website (or in the app's settings), and there's no need to edit any settings file on the computer running Claude Code. Even on a work laptop where you can't touch the local configuration, you can opt out from your account.
If you use Claude Code under a commercial agreement (Commercial Terms) such as Team, Enterprise, or the API, your data isn't used for training to begin with. Section 4 has a table of the differences.
2. How to opt out of training on a consumer plan
According to the Anthropic Privacy Center article "How do I change my model improvement privacy settings?," the steps are:
| Where | Steps |
|---|---|
| Browser or desktop app on a computer | Click your name (menu) → Settings → Privacy → turn off the "Help improve our AI models" toggle |
| Mobile app | Your name → Settings → Privacy → turn off the same toggle |
The labels above follow Anthropic's help article, so the screen may word things slightly differently over time. If you can't find the toggle, the most reliable route is to open claude.ai/settings/data-privacy-controls directly.
What happens to your past data after you opt out
The Privacy Center describes what happens once the setting is off:
- Future conversations: new chats and coding sessions won't be used for future training.
- Conversations already stored: won't be used for future training.
- Training already underway and models already trained: not removed. If data from before you opted out is part of a training run in progress or a model that has finished training, it stays there.
- Deleted conversations: conversations you delete from your history won't be used for future training.
So turning the setting off stops training from now on, but it doesn't retroactively remove your data from models. That's why it pays to check the setting before you work with anything sensitive.
Claude Code data retention depends on the setting
The setting changes not only training but also how long your data is kept. According to the Claude Code "Data usage" page, consumer plans work like this:
| Setting | Retention period |
|---|---|
| Allow data use for model improvement (on) | 5 years (to support model development and safety improvements) |
| Don't allow it (off) | 30 days |
Per the Privacy Center, the 5-year retention with the setting on means storing data in de-identified form within the training pipeline, and it applies only to chats you start or resume after turning the setting on.
3. What can still be used after you opt out
Even with the setting off, the cases below are handled differently. Combining the Privacy Center with the Claude Code "Data usage" page:
| When | What is sent or kept | Use for training | Retention |
|---|---|---|---|
| You press a 👍👎 rating button | The whole conversation (including settings and styles) | May be used (after being disassociated from your user ID) | Up to 5 years |
You send /feedback, /bug, or /share in Claude Code | The conversation transcript (including code) | May be used to improve products and services | 5 years |
| Safety systems flag the conversation as a Usage Policy violation | Inputs and outputs, plus the classification scores | May be used, for example to improve safety models | Inputs/outputs up to 2 years, scores up to 7 years |
| You opt in to something like the Trusted Tester Program | Depends on the program's terms | May be used | Depends on the terms |
While you use Claude Code, you may be asked "How is Claude doing this session?" According to the official docs, picking a rating records only the rating, and no conversation content is sent. A separate follow-up may then ask whether Anthropic can look at your session transcript, and only if you choose Yes are your conversation transcript, any subagent transcripts, and the session log uploaded (known API key and token patterns are redacted, but source code and file contents go as-is). Those transcripts are kept for up to 6 months, and the docs state explicitly that they cannot be used to train AI models.
Separately, incognito chats on claude.ai (temporary chats that don't stay in your history) aren't used for training even when the setting is on. That is a claude.ai chat feature, though, and the Claude Code "Data usage" page doesn't describe an equivalent in Claude Code.
4. Plan by plan: training and data retention
Putting the Claude Code "Data usage" page and the Privacy Center together, plan by plan:
| How you use Claude Code | Use for training | Kept on servers for (separate from training) | How to opt out / what you can choose |
|---|---|---|---|
| Signed in with a Free, Pro, or Max account | Used if the setting is on | 5 years with it on, 30 days with it off | Turn off the account's privacy setting |
| Signed in with a Team or Enterprise account | Not used by default | 30 days (Enterprise organizations can set their own retention period) | Admins can disable the 👍👎 rating buttons for the organization |
| With an API key (Claude Console) | Not used by default | Deleted within 30 days | Eligible organizations can sign a Zero Data Retention (ZDR) agreement |
| Through Amazon Bedrock, Google Cloud, or Microsoft Foundry | Not used by default | Per each cloud provider's terms | Each cloud provider's settings and contract |
Commercial terms also have an exception when you choose to share. The Privacy Center says that if you explicitly report feedback or bugs, for example with the 👍👎 rating buttons, that conversation or session may be used for training. The API also has the Development Partner Program, where an organization admin opts in to provide data for training (it covers Anthropic's own API only, not Bedrock or Google Cloud).
If my data isn't used for training, why is it retained at all?
"Use for training" and "retention" in the table mean different things. Retention is how long the data stays on Anthropic's servers; training is putting that data into the material used to build new models. Even when data isn't used for training, it is kept for a while for reasons like these:
- To show your history and let you resume conversations: the Privacy Center says that in products where you can save and continue conversations, they're kept so you can keep using them. If you delete a conversation yourself, it disappears from the screen right away and is removed from server storage within 30 days.
- To detect and act on Usage Policy violations: enforcing the Usage Policy and meeting legal requirements are the stated reasons for keeping API inputs and outputs longer than 30 days. Conversations flagged as violations are kept for up to 2 years.
- To catch misuse (Covered Models): for Covered Models such as Fable, some misuse isn't visible in a single request and only shows up across many requests, so at least 30 days of data is kept and reviewed by automated safety systems.
So the 30-day retention isn't "storage for training"; it's temporary storage for the product to work and for safety. Still, the data does sit on a server for that time, so if you want to avoid retention itself, look at ZDR in section 5.
If the only goal is to keep your data out of training, a consumer plan with the setting turned off is enough. Team, Enterprise, or the API become the options when you need shorter retention, or a company-level contract and admin controls. For what each plan costs, see our Claude vs ChatGPT pricing comparison.
5. Does Anthropic train on API data?
Not by default. The Privacy Center's article for commercial products says inputs and outputs from commercial products such as the Claude API aren't used to train models by default. The Claude Platform docs likewise commit that retained data is never used for model training without your express permission.
On retention, the commercial article "How long do you store my organization's data?" says:
- API inputs and outputs are automatically deleted within 30 days of being received or generated.
- The exceptions: when you use a feature where you control storage, such as the Files API; when you have a separate agreement (such as zero data retention); when longer retention is needed to enforce the Usage Policy; or when the law requires it.
- If something is flagged as a Usage Policy violation, inputs and outputs are kept for up to 2 years and the classification scores for up to 7 years.
Zero Data Retention (ZDR)
For organizations that want to keep even less, there's a Zero Data Retention (ZDR) agreement. According to the Claude Platform docs, under ZDR prompts and responses aren't stored after the API response is returned. You have to request it through sales, and it's enabled per organization.
- Claude Code is covered: ZDR applies when you use Claude Code with a commercial organization's API key. However, if you've enabled Claude Code usage metrics, those statistics fall outside ZDR and may be retained.
- What isn't covered: use in the Claude Console (including the playground), consumer plans (Free, Pro, and Max), and use through the Team or Enterprise interfaces, among others (Claude Code on Enterprise has its own ZDR offering).
- Covered Models require 30-day retention: models Anthropic designates as "Covered Models" (as of October 4, 2026: Claude Fable 5 and 5.1, and Claude Mythos 5 and 5.1) need at least 30 days of retention to catch misuse, so as a rule they can't be used under ZDR. ZDR organizations can use them by enabling 30-day retention for individual workspaces.
The retention requirement for Covered Models applies not only on the Claude Platform but also through clouds such as Amazon Bedrock. Per Anthropic's explanation of Covered Models, the retained data is reviewed by automated safety systems, and whether it's used for training follows the Privacy Center policy for your plan.
6. Sent separately from training: usage metrics and error reports
Apart from training, Claude Code sends operational data to Anthropic and others. According to the official docs, each of these is independent of the training setting and can be turned off with its own environment variable.
| What is sent | Contents | Environment variable to turn it off |
|---|---|---|
| Usage metrics | Latency, reliability, and usage patterns (never your code, prompts, or file paths) | DISABLE_TELEMETRY=1 |
| Error reports | Error messages from Claude Code's own internals (known patterns of secrets, file paths, email addresses, and the like are redacted before sending) | DISABLE_ERROR_REPORTING=1 |
/feedback reports | Conversation history including code (only when you send it) | DISABLE_FEEDBACK_COMMAND=1 |
| Session quality survey | Your rating (the transcript is shared only if you say Yes) | CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY=1 |
| All of the above non-essential traffic | — | CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 |
When you use Claude Code through Amazon Bedrock, Google Cloud, or Microsoft Foundry, usage metrics, error reports, and /feedback are off by default. The official docs also warn that setting DISABLE_TELEMETRY or CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC disables feature-flag evaluation too, which can make Remote Control unavailable.
These environment variables do not opt you out of training. To stop training, use the account setting from section 2; to reduce outbound traffic, use the environment variables in this section. If you can't change environment variables or settings files on a work machine, the safe move is to ask your IT team.
7. Conversation transcripts stored on your own computer
An easy one to miss is what stays on your own computer. According to the official docs, Claude Code stores session transcripts under ~/.claude/projects/ in plaintext (unencrypted) so you can resume sessions, and deletes them after 30 days by default. You can change that period with the cleanupPeriodDays setting (sessions started or most recently continued in the Claude desktop app or Cowork are exempt from that limit by default).
Turning off the training setting doesn't touch these local transcripts. If you share a computer that has handled confidential information, or include it in backups, remember that your conversations are sitting in this folder.
8. Choosing a setup for confidential work
Here's how to think about it when confidential information is involved. The right answer depends on your company's policies and contracts, so in the end follow your organization's rules.
- If you use a consumer plan: turn off the privacy setting. Assume that even when it's off, data is kept for 30 days and can be reviewed for safety.
- Don't press the rating buttons or send
/feedback: even with the setting off, those conversations are kept for 5 years and may be used for training or product improvement. - If you're using it as a company: consider Team, Enterprise, or the API (commercial terms). The no-training treatment is set by contract, and admins get controls such as disabling the rating buttons.
- If you also want to avoid retention: consider ZDR on the API. But Covered Models (such as Fable) require 30 days of retention, so check how that fits the models you use.
- Things not to include at all: never put secrets such as passwords or API keys in prompts or conversations, on any plan.
For what's safe to type into AI tools in general, see AI prompt and input precautions, and for setting rules at work, see how to build a corporate AI usage guideline.
Summary
Whether your Claude Code data is used for training comes down to your plan and your account setting. On the Free, Pro, and Max consumer plans, turning off model-improvement use in claude.ai's privacy settings keeps future conversations out of training. The setting is on the website, so there's no need to change settings files on the computer running Claude Code.
Turning it off, however, doesn't remove your data from past training, and conversations sent with 👍👎 ratings or /feedback, or flagged as policy violations, are kept under separate rules. Under commercial terms such as Team, Enterprise, and the API, data isn't used for training in the first place, and API inputs and outputs are deleted within 30 days as standard. Organizations that want to avoid retention can use ZDR, but Covered Models such as Fable require 30 days of retention.
Sending usage metrics and error reports is a separate matter from training, and environment variables turn them off. If you handle confidential information, start by checking your account setting and how you use the rating buttons, and if you're using Claude Code as a company, a commercial agreement is the dependable route.
FAQ
Q. Can I opt out of training with Claude Code's settings files or environment variables?
A. No. Whether your data is used for training is decided by your account's privacy setting (consumer plans) or the type of agreement (commercial). Environment variables such as DISABLE_TELEMETRY stop usage metrics and error reports, which are separate from the training setting.
Q. If I turn the setting off, are my past conversations removed from training?
A. They won't be used for future training, but they aren't removed from training already underway or from models that have finished training. The Privacy Center explains that stored conversations will simply stop being used for future training.
Q. If I switch from a Pro plan to an API key, will my data stay out of training?
A. With an API key (commercial terms), your data isn't used for training by default. But a consumer plan with the setting turned off also keeps your data out of training, so if training is your only concern, there's no need to switch. Note that billing works differently (the API is pay-as-you-go).
Q. If my data isn't used for training, why is it kept for 30 days?
A. Because retention and training are different things. Retention is how long data stays on the server, and it's kept for things like showing and resuming your history, detecting and acting on Usage Policy violations, and legal compliance. Training means using that data as material for new models, which doesn't happen under commercial terms or on a consumer plan with the setting off (section 4).
Q. How long is API data retained?
A. As standard, it's automatically deleted within 30 days of being received or generated. If it's flagged as a Usage Policy violation, inputs and outputs are kept for up to 2 years, and features where you control storage, such as the Files API, follow that feature's own retention. With a ZDR agreement, nothing is stored after the response is returned (except for Covered Models).
Q. How do I opt out of training without changing anything on my work computer?
A. On a consumer plan, you can turn it off in the privacy settings on the claude.ai website (or in the mobile app). The training setting belongs to your account, so you don't need to touch the computer running Claude Code.
Sources
- Claude Code docs: Data usage
- Anthropic Privacy Center: Is my data used for model training? (consumer) and the commercial version
- Anthropic Privacy Center: How do I change my model improvement privacy settings?
- Anthropic Privacy Center: How long do you store my data? and How long do you store my organization's data?
- Claude Platform docs: API and data retention
- Claude Help Center: Covered Models and Use incognito chats
All sources were checked in the original on October 4, 2026. Privacy policies and the list of covered models can change, so check the latest version of each page before signing a contract or making an important decision.
If you also want to check the OpenAI settings, see ChatGPT and Codex training settings and confidential data risks. For the separate setting that controls training on Codex environments, the guide distinguishes what the official documentation says from what we could confirm in the actual settings screens.