Claude Code data privacy, retention and zero data retention

Claude Code data privacy depends on plan, account type and deployment route: commercial plans keep data 30 days by default, and zero data retention on Enterprise is enabled per organization by Anthropic. Local transcripts and feedback flows need separate controls.

On this page

Does Claude Code meet our data retention requirement on Team and Enterprise?

Team and Enterprise commercial terms exclude training on code or prompts sent to Claude Code by default, and the standard retention period is 30 days for commercial users. Zero data retention is a different tier: it is available only on Claude for Enterprise, Anthropic enables it per organization for qualified accounts, and it does not apply automatically to a new organization. If your requirement is shorter or stricter than 30 days, do not assume it is met by the plan name. Ask Anthropic in writing whether your organization has ZDR enabled, and keep that confirmation in your approval file.

Meeting the requirement takes three decisions. First, confirm ZDR status for the exact organization that holds your developers' seats. Second, choose the route, because ZDR covers only Anthropic's direct platform. Claude Code reached through Amazon Bedrock, Google Cloud's Agent Platform or Microsoft Foundry is not covered, so those routes need their own retention review with the cloud provider. Third, control the data that sits outside Anthropic's retention controls: session transcripts are stored in plaintext under ~/.claude/projects/ for 30 days by default, adjustable with cleanupPeriodDays, and transcripts shared through /feedback, /bug or /share are kept for 5 years.

Under ZDR, cloud sessions, Remote Control, artifacts and /feedback submission are disabled, and chat on claude.ai, Cowork and third-party MCP integrations are outside its scope, so a team that relies on those features needs a separate decision. Also note that a session flagged for a Usage Policy violation may be retained for up to 2 years even under ZDR. Set DISABLE_FEEDBACK_COMMAND=1, DISABLE_TELEMETRY=1 or CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC through managed settings if your policy requires it, and test them on a managed machine. Read the Claude Code zero data retention documentation before you sign off, and confirm each exception with the vendor.

Retention and training terms by plan and route

This table compares how Claude Code data is retained and used for training across plans, cloud routes and local storage. Read each row against the edition or route your organization would actually buy, because retention terms differ by account type. The main takeaway is that the 30 day default applies to commercial plans, while zero data retention is a separate, per-organization arrangement on the Enterprise direct platform only.

Data pathRetention or training positionAvailability and what to confirm
Standard 30 day retention on Team, Enterprise and APIBuilt in: commercial data is kept for a standard 30 day periodBuilt in for Team, Enterprise and API accounts. Source: Claude Code data usage docs
Consumer accounts that allow model improvement5 year retention for Claude Code dataNot suitable for company use. Personal accounts must be blocked through managed settings. Source: Claude Code data usage docs
Zero data retention on Enterprise direct platformPrompts and responses are not stored after the response is returned, except where needed for law or misuse checksPaid edition only (Enterprise). Enabled per organization by Anthropic for qualified accounts, not automatic. Source: Claude Code zero data retention docs
Amazon Bedrock, Google Cloud Agent Platform and Microsoft Foundry routesZero data retention from Anthropic's direct platform does not cover these routesNeeds an outside component: confirm retention and encryption terms with each cloud provider. Source: Claude Code zero data retention docs
Local transcript storageSession transcripts stored in plaintext under ~/.claude/projects/ for 30 days by defaultBuilt in on the developer machine. Adjust with cleanupPeriodDays. Source: Claude Code data usage docs
Shared transcripts via /feedback, /bug or /shareRetained for 5 yearsNot available once disabled: DISABLE_FEEDBACK_COMMAND=1, DISABLE_TELEMETRY=1 or CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC turn these flows off. Source: Claude Code data usage docs
Cloud sessions, Remote Control and artifacts under zero data retentionDisabled at the backend when zero data retention appliesNot available under zero data retention. Source: Claude Code zero data retention docs

Where a Claude Code request and its transcript actually go

Claude Code data sits in three places, and each needs its own decision. The first is the inference request: the prompt, context and tool output that Claude Code sends to whichever provider the organization has configured. Prompts and outputs are encrypted in transit with TLS 1.2 or later. The second is provider-side retention, which depends on the plan or route and the applicable terms. On Team, Enterprise and API terms, the standard retention period for Claude Code data is 30 days, while zero data retention on Enterprise changes what is stored after the response is returned. The third is the local transcript: the Claude Code client writes session transcripts in plaintext under ~/.claude/projects/ on the developer machine. Those files stay for 30 days by default, and cleanupPeriodDays adjusts that period. A review of data flows should account for all three, not only the provider contract.

Encryption at rest differs by route, so the provider choice is also a storage choice. The Anthropic API uses AES-256 disk encryption. Amazon Bedrock offers customer-managed keys through AWS KMS, which lets the organization control the key material protecting its data. Confirm with the provider which key model applies to the route in use, and whether the organization's key management policy requires customer-managed keys. Zero data retention is also route-specific: it covers Anthropic's direct platform only, so requests routed to Bedrock, Google Cloud's Agent Platform or Microsoft Foundry follow those platforms' own retention and encryption terms.

The local transcript is the control most often missed in a review, because it lives on the endpoint and not in a vendor console. Plaintext transcripts mean that disk encryption, endpoint management and retention settings on developer laptops become part of the data protection design. Decide whether the 30 day default is acceptable for your risk profile and, if not, set cleanupPeriodDays through managed settings so developers cannot override it. Ask the vendor to confirm how the transcript location and retention behave on each installation method your teams use.

Where Claude Code data is kept by route

The diagram starts on the developer machine, where Claude Code writes session transcripts in plaintext under the local projects folder. A request then leaves for one of two routes: the Anthropic direct platform, where the retention period depends on the account and whether zero data retention is enabled, or a cloud provider route such as Amazon Bedrock, where Anthropic's zero data retention does not apply. A separate branch shows that transcripts sent through the feedback, bug or share commands are kept for 5 years. Check which route your developers use and whether that feedback path is disabled.

Data paths from a developer machine, by route and retention outcome.

What zero data retention disables and what it does not cover

Zero data retention on Claude Code changes what Anthropic stores for Enterprise sessions on its direct platform, but it switches off some features and leaves other Claude surfaces outside its scope. The cards below separate what is disabled, what stays out of scope, and the two exceptions that can still retain data.

Cloud sessions disabled at the backend

Under zero data retention, cloud sessions are turned off at the backend, so developers cannot run Claude Code tasks on Anthropic-hosted infrastructure while the setting is active. Confirm with your Anthropic account team which features are affected in your organization, and check whether developers have been relying on cloud sessions for work that must now run locally or on your own runners.

ZDR docs

Remote Control disabled

Remote Control is also disabled at the backend when zero data retention is enabled. Developers who expect to drive a session from another device should be told before rollout, since the feature will not work for that organization. Ask Anthropic to confirm the exact behavior for your account before you publish guidance to engineering teams.

Artifacts and feedback submission disabled

Artifacts are disabled, and so is /feedback submission, which means transcripts cannot be sent to Anthropic through that command. This matters for incident response: if a developer hits a defect, the normal route for sharing the session is closed, so your support process should name an internal channel instead. Note that the /feedback, /bug and /share flows also carry a 5 year retention rule when used outside zero data retention.

Claude.ai chat and Cowork not covered

Zero data retention does not cover chat on claude.ai or Cowork. A developer who uses the same Enterprise identity for a browser chat about the same repository gets no zero data retention protection for that conversation. Your acceptable use policy should state which Claude surfaces are covered, and your reviewers should not assume that one setting governs every Claude product.

Third-party MCP integrations not covered

Third-party MCP integrations are outside the zero data retention scope, so data a developer sends to an external MCP server is governed by that server's own terms. Inventory the MCP servers your developers connect to, and confirm each vendor's retention and training terms before you allow it. Your MCP allowlist is the practical control here.

Usage Policy flag keeps data up to 2 years

Even with zero data retention, inputs and outputs from a session flagged for a Usage Policy violation may be kept for up to 2 years. This is the retention exception most likely to surprise a privacy reviewer, because the flag is triggered by the content of the session rather than by a setting you control. Ask Anthropic how flagged sessions are identified and whether your organization is notified.

Legal and misuse exception

Prompts and responses are not stored after the response is returned, except where retention is needed to comply with law or to combat misuse. The legal exception applies regardless of your configuration, so your counsel should review it alongside your contract terms. Confirm with Anthropic what categories of request fall under this exception and how long data is kept when it applies.

How the answer changes by route, edition and data sensitivity

This is the narrowest case. Claude Code runs on Anthropic's direct platform under an Enterprise agreement, and Anthropic has enabled zero data retention for your organization. Zero data retention is switched on per organization by Anthropic for qualified accounts, so confirm it in writing rather than assuming it from the plan name. Under this setting, prompts and responses from Claude Code sessions are not stored after the response is returned, except where needed to comply with law or to combat misuse.

  • Stored: prompts and responses are not kept after the response returns, subject to the legal and misuse exceptions.
  • Misuse-flagged sessions: inputs and outputs from a session flagged for a Usage Policy violation may be retained for up to 2 years.
  • Disabled features: cloud sessions, Remote Control, artifacts and /feedback submission are turned off at the backend.
  • Not covered: chat on claude.ai, Cowork and third-party MCP integrations fall outside zero data retention.
  • Local copies: session transcripts still sit in plaintext under ~/.claude/projects/ for 30 days by default.

Ask Anthropic to confirm in writing that zero data retention is active for your organization ID before you rely on it. Then check the disabled features against the workflows your developers actually use.

Gaps that remain after zero data retention is confirmed

Zero data retention on Enterprise limits what Anthropic stores after a response, but it sits on top of several other places where Claude Code data can persist or leave the organization. Each card below names one of those gaps, the usual way to close it, and what to confirm before approving the rollout.

Local plaintext transcripts on laptops

Claude Code clients write session transcripts in plaintext under ~/.claude/projects/, and the default local retention is 30 days. ZDR does not change anything on the developer's disk, so a lost or shared laptop can expose source code and prompts. Cover this with endpoint disk encryption and a managed value for cleanupPeriodDays where your device management tooling allows it, and confirm that the policy applies to the machines in scope.

Data usage docs

Feedback and bug-report sharing

Transcripts sent through /feedback, /bug or /share are kept for 5 years, which is far longer than the standard commercial window. Under ZDR, the feedback submission is disabled at the backend, but users can still share transcripts through the client flows. Set DISABLE_FEEDBACK_COMMAND=1 in managed settings so these commands are unavailable, and check that no developer has a copy of a shared transcript stored outside your control.

Telemetry and nonessential traffic

Telemetry and other nonessential traffic are separate from prompt processing, and they can be sent even when inference terms are strict. Decide which of these flows your policy allows, then set DISABLE_TELEMETRY=1 or CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC in managed settings to match that decision. Ask Anthropic which data each remaining flow carries before you rely on the setting for a regulated workload.

Consumer accounts used outside the organization

A developer who signs in with a personal consumer account falls under consumer terms, where users who allow model improvement have 5 year retention. ZDR and the Enterprise terms do not reach that session at all. Restrict sign-in to your organization through managed settings and SSO, and confirm that personal accounts and stray API keys are blocked on managed machines.

Consumer retention with model improvement
5 years

Third-party MCP servers and chat surfaces

ZDR does not cover third-party MCP integrations, chat on claude.ai, or Cowork. Data an agent sends to an external MCP server is governed by that server's terms, not Anthropic's. Maintain an approved MCP server list in managed settings, and ask each MCP vendor for its own retention and training commitments before adding it.

Usage Policy flagged sessions

Even with ZDR, inputs and outputs from a session flagged for a Usage Policy violation may be retained for up to 2 years. This is a legal and abuse-handling exception, not a setting you control. Ask Anthropic how flagged sessions are notified to your organization, and make sure your incident process covers the retained copy when a flag occurs.

ZDR docs

Which environment settings turn off feedback and telemetry flows

Three environment settings decide whether Claude Code sends data outside the session itself: DISABLE_FEEDBACK_COMMAND=1, DISABLE_TELEMETRY=1 and CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC. Each one switches off a different flow. The feedback setting removes the /feedback command, which is one of the three routes (with /bug and /share) through which a session transcript can be sent to Anthropic and kept for 5 years. The telemetry setting stops usage telemetry, and the nonessential traffic setting cuts the wider group of background connections that are not needed for the agent to work. Because the flows differ, a reviewer should confirm each one separately rather than assuming that one switch covers the others.

These settings only protect the organization if developers cannot change them. A value set in a personal shell profile is under the developer's control, so on company laptops the controls belong in managed settings enforced by the organization, not in instructions asking staff to export variables. Confirm with your Claude Code administrator which mechanism delivers these keys on each managed device class, and test that a developer session on a managed machine honors them. The precedence rules, caching behavior and the way endpoint-managed settings differ from server-managed settings are covered on the admin controls page, so this section does not repeat them.

Two effects deserve explicit sign-off before rollout. Turning off the feedback command removes a channel that engineers may use to report bugs to Anthropic, so your security team should agree on a different internal path for reporting defects in the tool. Turning off telemetry and nonessential traffic reduces what the vendor sees, but it also reduces the vendor-side signals that support teams use when diagnosing problems. Record the decision, the affected flows and the owner of the exception process. Also confirm with Anthropic whether these settings interact with zero data retention on your account, because that setting disables several backend flows of its own and the two controls should be reviewed together.

Order of work to confirm data handling before rollout

This sequence settles which account and route each developer uses, what retention and zero data retention status the organization actually has, and how transcripts and feedback flows are configured, so the approval decision rests on evidence from your own environment rather than on assumptions about the product.

  1. Confirm the route and account type for every developer

    Inventory how each developer reaches Claude Code: Claude for Teams or Enterprise, the Claude Console with API billing, Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry, or a self-hosted gateway. Data retention, training terms and zero data retention depend on this route, so a single account type cannot be assumed for the whole organization. Done when every developer or group is mapped to one route and any personal or consumer accounts are identified for blocking. The Claude Code authentication documentation is the starting reference for the route options.

  2. Request written confirmation of zero data retention status

    If your policy requires zero data retention, ask Anthropic in writing whether your organization has it enabled, since it is set per organization for qualified accounts and does not apply automatically to new organizations. Also confirm in writing that it covers only Anthropic's direct platform, so any Bedrock, Agent Platform or Foundry usage is assessed separately. Ask which features are disabled under it, including cloud sessions, Remote Control, artifacts and /feedback, and which surfaces such as claude.ai chat fall outside it. Done when the written answer is filed with the approval record and mapped to each route from step one.

  3. Decide the transcript retention period and cleanupPeriodDays value

    Clients store session transcripts locally in plaintext under the projects folder in the user's Claude configuration directory for 30 days by default. Decide with security and legal whether that period fits your policy, then set cleanupPeriodDays in managed settings so the value is the same on every endpoint rather than left to individual developers. Record the chosen value and who approved it. Done when the setting is documented, assigned through your managed configuration, and the reason for the retention period is written down for auditors.

  4. Enforce feedback and telemetry opt-outs on managed endpoints

    Transcripts shared through the feedback, bug and share commands are retained for 5 years, so decide whether those flows are permitted. To disable them, set DISABLE_FEEDBACK_COMMAND=1, DISABLE_TELEMETRY=1 or CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC through your endpoint management or managed settings, and do not rely on developers to set them. Done when a sample of managed machines shows the variables in effect and the feedback commands are confirmed as blocked or documented as approved.

  5. Verify with a test session that transcripts land where expected

    Run a test session on a managed machine using an approved test account and no production code. Confirm that the transcript appears under the local projects folder, that it is stored in plaintext as the documentation describes, and that the retention setting you chose is the one applied. Confirm also that the feedback and sharing commands behave as your configuration requires. Keep the test record as evidence. Done when the test result matches your written retention and opt-out decisions, and any mismatch is fixed before wider rollout.

  6. Re-check data handling after each Claude Code update

    Claude Code is distributed as an npm package and as a native installer, and the vendor publishes security advisories against specific versions. Set a recurring review that re-reads the data usage and zero data retention documentation, checks the security advisories page, and confirms that the environment variables and cleanup setting still behave as recorded. Users on standard auto-update receive fixes automatically, while manual updaters must upgrade themselves, so check the installed version on each endpoint. Done when the review record shows the version reviewed, the documentation date checked and any changes assigned to an owner.

What a security reviewer asks for on data retention

This table lists the data retention questions a reviewer should put to Claude Code, the evidence to request for each, and where in the product or account that evidence lives. Read it as a checklist: confirm each row for the specific plan, route and organization before approving use, because retention and zero data retention differ by plan and by how Claude Code is reached.

QuestionEvidence to requestWhere it comes from in the tool
Which retention terms apply?Written confirmation of the retention period for the plan in use, and whether the organization is on Team, Enterprise, the API or a third-party platformCommercial terms for the plan, and the Claude Code data usage documentation
Is zero data retention enabled for our organization?Written confirmation from Anthropic that zero data retention is enabled for our organization ID, not just that the feature existsAnthropic account team; ZDR does not apply automatically to new organizations
Does ZDR cover our route?Confirmation of whether we use Anthropic's direct platform or Bedrock, Agent Platform or Foundry, since ZDR covers only the direct platformDeployment route chosen in the organization setup
Are training opt-in settings off?Written statement that no code or prompts are used for model training unless we opt in, plus confirmation no Development Partner Program enrollment existsCommercial terms and the Claude Code data usage documentation
How is data encrypted in transit and at rest?Confirmation of TLS 1.2 or later in transit and AES-256 disk encryption at rest for the direct API; for Bedrock, whether customer-managed keys through AWS KMS are configuredClaude Code data usage documentation, and the cloud provider console for KMS settings
Where are local transcripts kept and for how long?Documented location of plaintext transcripts under the user profile, the 30 day default, and the chosen cleanupPeriodDays value enforced through managed settingsThe ~/.claude/projects/ directory on each managed machine, and the cleanupPeriodDays setting
Are feedback and telemetry flows disabled?Managed settings or policy showing DISABLE_FEEDBACK_COMMAND, DISABLE_TELEMETRY and CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC set as the policy requiresEndpoint or server-managed settings, and the Claude Code data usage documentation
Where are the SOC 2 Type 2 report and ISO 27001 certificate?The current SOC 2 Type 2 report and ISO 27001 certificate, obtained from the Trust Center under our own access termsThe Anthropic Trust Center at trust.anthropic.com

Questions buyers ask before approving Claude Code data handling

Does Anthropic train its models on our Claude Code code and prompts?

Not by default. Under commercial terms for Team, Enterprise, the API, third-party platforms and Claude Gov, Anthropic does not train generative models on code or prompts sent to Claude Code unless the customer opts in, for example through the Development Partner Program. Confirm the terms that apply to your contract in writing, and make sure no staff account or consumer plan is used for company work, because consumer terms differ. The Claude Code data usage documentation sets out the training policy by plan and is the right document to attach to your review.

Is zero data retention available on our Claude Code plan?

Zero data retention is available only on Claude for Enterprise, and only for Anthropic's direct platform. Anthropic enables it per organization for qualified accounts, so it does not apply automatically when you sign up. Usage through Amazon Bedrock, Google Cloud's Agent Platform or Microsoft Foundry is not covered. Under zero data retention, prompts and responses from Claude Code sessions are not stored after the response is returned, except where needed to comply with law or combat misuse. Cloud sessions, Remote Control, artifacts and /feedback submission are also disabled, so check whether your teams rely on them before you ask for enablement. Ask Anthropic to confirm your eligibility in writing.

What does zero data retention cost, and what should we ask for in a quote?

Anthropic sets the pricing for zero data retention and does not publish a figure in the materials reviewed for this page, so confirm the cost with Anthropic in writing before you budget for it. Ask whether it is included in your Enterprise agreement or carries an additional charge, whether it applies to all seats or only specified workspaces, and what happens to the feature if your contract renews or changes. Your total cost also includes internal time for the policy review, endpoint configuration and evidence collection, which scales with the number of teams and machines in scope.

How long does it take to get zero data retention enabled?

The timing is set by Anthropic's account process, and no duration has been published for this page, so confirm it with your Anthropic account team. Because enablement is per organization and requires a qualified account, start the conversation early and ask for the steps, the owner on each side and the date the setting takes effect. Plan your rollout so that developers on the standard 30 day retention period are not moved onto Claude Code sessions that depend on features zero data retention disables until the change is confirmed.

Can our own administrators configure the data handling settings, or does Anthropic have to do it?

Your administrators can set many of the controls themselves, but zero data retention is the exception because Anthropic enables it per organization. Your team can manage local and policy settings, including the cleanup period for local transcripts (cleanupPeriodDays), and can turn off the feedback, bug and share flows and telemetry through environment variables such as DISABLE_FEEDBACK_COMMAND=1, DISABLE_TELEMETRY=1 and CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC. Enforcing these settings consistently across developer machines requires managed configuration, which your IT team should confirm against the current documentation for your deployment.

What can an outside implementation partner add to this review?

A partner can help with the parts that are your responsibility under your own environment: mapping which connections, plans and features each team uses, deciding which data handling settings to enforce, configuring endpoints so the choices hold on managed machines, and collecting evidence that shows the settings were applied. DeployOpen plans, implements, hardens and documents self-hosted open-source platforms in your infrastructure, and runs security testing of AI systems and agents. It does not issue audit reports or certifications, and it does not enable zero data retention, which only Anthropic can do. Work is typically fixed-scope, with scope, deliverables and timelines agreed in writing before work begins.

What this page leaves to the other Claude Code pages

This page covers where Claude Code data goes, how long it is kept and what zero data retention changes. Several decisions that sit next to data handling belong on other pages, and reviewers should read them before approving the rollout. Plan and seat pricing, including which security features only Enterprise adds, is covered on the plan and pricing page. Whether a developer can sign in with a personal account, how SSO and SCIM apply and how to block stray API keys is covered on the SSO and login restriction page, and the managed settings that enforce those blocks are covered on the managed settings page.

Compliance questions are handled separately. The HIPAA configuration, whether a business associate agreement applies to local Claude Code use, which connection routes are eligible and what the Compliance API returns for sessions are all on the compliance page. Do not assume that a retention figure on this page answers a HIPAA question. Confirm the eligibility of your exact connection route there before any regulated data reaches a session.

Routing is the last boundary. If your organization wants inference to run through your own cloud provider, the decision about what still reaches Anthropic depends on the self-hosted gateways page, not on the retention settings described here. Read that page before you assume the retention and zero data retention rules apply to your traffic, because zero data retention covers only Anthropic's direct platform.

How DeployOpen helps you confirm Claude Code data handling before rollout

DeployOpen plans, implements, documents and supports self-hosted open-source platforms inside your own infrastructure, and runs security testing for AI systems and agents. For Claude Code, we help you turn retention, training and telemetry settings into a written, testable configuration and evidence pack that your security and compliance reviewers can check.

How we scope

  • We agree in writing which Claude Code plan, sign-in route and data path each developer group will use.
  • We list which retention, zero data retention and telemetry settings your organization needs to confirm with Anthropic.
  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.

How we build

  • We set up local settings such as cleanupPeriodDays and telemetry variables in a controlled, repeatable way.
  • We test which data flows leave the workstation, including transcripts saved under ~/.claude/projects/.
  • We test feedback, bug and share flows so developers cannot send transcripts outside the agreed path.

How we hand over

  • You receive a written data map showing which flows go to Anthropic, which stay local and which are disabled.
  • You receive the test results, configuration records and open questions for your vendor contact.
  • You receive the evidence your independent auditor will need, and we do not issue audit reports or attestations.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers when Anthropic changes its settings or documentation.
  • We can re-test data flows after new Claude Code versions or plan changes, as set out in the retainer scope.
  • We confirm changes to retention or training terms with you in writing before updating your configuration.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.