Claude Code and company data: what is sent and kept

Before a data team installs Claude Code, someone asks where the code, the queries and the sample rows go. What Claude Code sends, how long each plan keeps it, which plans are used for training, and what stays on your machine.

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?

AccountUsed for training?Kept on Anthropic's side
Free, Pro, Max, Ultra, setting onYes5 years
Free, Pro, Max, Ultra, setting offNo30 days
Team, Enterprise, APINo, unless the customer opts in30 days
Enterprise with zero data retentionNoNo server-side persistence
Training and retention by account type (Claude Code docs, November 2026)

What leaves your machine, and what stays?

Your sessionprompts, files Claude reads, command output
Sent to the modelprompts and outputs over TLS 1.2+
Kept locallytranscripts in ~/.claude/projects/ for 30 days (cleanupPeriodDays)
Where a Claude Code session's data goes

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 cleanupPeriodDays if transcripts on laptops are a concern.

Where can you check this?

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.

Keep reading

More from the blog.

Every post

Next

Building this? Say hello.

A question about this post, a pattern you would build differently, or the next thing you want written out: Behnia reads every message.