Short answer: Claude Code runs on your machine but sends your prompts and the model's outputs, including any file contents or query results it reads, to Anthropic over TLS 1.2+. On Team, Enterprise and the API, Anthropic does not train on that data and keeps it 30 days by default, with zero data retention available per organization on Enterprise. On Free, Pro, Max and Ultra, data is used for training when that setting is on (kept 5 years) and kept 30 days when it is off. Session transcripts also stay on your machine under ~/.claude/projects/ for 30 days.
For a data team the question is concrete: if Claude reads a sample of the customer table to write a query, those rows are part of the conversation. Knowing where they go decides which account to use and what to keep out.
What happens to the data on each plan?
| Account | Used for training? | Kept on Anthropic's side |
|---|---|---|
| Free, Pro, Max, Ultra, setting on | Yes | 5 years |
| Free, Pro, Max, Ultra, setting off | No | 30 days |
| Team, Enterprise, API | No, unless the customer opts in | 30 days |
| Enterprise with zero data retention | No | No server-side persistence |
What leaves your machine, and what stays?
Telemetry metrics never include your code, prompts or file paths, and can be turned off with DISABLE_TELEMETRY=1.
What should a data team do?
- Use a commercial account (Team, Enterprise or the API) for company work, not personal plans.
- Point Claude at samples or test data, not production tables with personal information.
- Keep secrets out: connection strings and passwords in environment variables, never in files Claude reads.
- Shorten local history with
cleanupPeriodDaysif transcripts on laptops are a concern.
Where can you check this?
- Claude Code docs: Data usage, training policy, retention, local caching, TLS and telemetry
This is a summary of Anthropic's published policy, not legal advice; check your own contract.
Where do you start?
Give Claude only a safe database login with connect Claude Code to a database, and write the "never touch" rules into a CLAUDE.md for a data repository.