Is Claude Code safe to use on company code?

Short answer

Claude Code runs on your machine and sends your prompts, the code it reads and its output to Anthropic over TLS. Under commercial terms (Team, Enterprise, API) Anthropic does not train on that data and keeps it 30 days by default. On Free, Pro, Max and Ultra, training depends on a privacy setting. Safety on the machine itself comes from permissions, deny rules, the sandbox and managed settings.

Two separate questions

“Is it safe” splits into two questions that a security review should keep apart:

  1. What leaves the building? Claude Code runs locally, but to talk to the model it sends data over the network: all prompts and model output, which includes every file and command result Claude reads. That traffic is encrypted with TLS 1.2 or higher.
  2. What can the agent do on the machine? Claude Code edits files and runs shell commands with your user account. That is a different risk from data leaving, and it has its own controls.

What Anthropic does with the data, per plan

As of November 2026, the Claude Code data usage docs say:

Account Training on your code and prompts Retention at Anthropic
Free, Pro, Max, Ultra (consumer terms) Yes, if the model-improvement setting is on 5 years with the setting on, 30 days with it off
Team, Enterprise, API, cloud providers (commercial terms) No, unless the organization opts in 30 days standard
Enterprise with Zero Data Retention No No server-side persistence; enabled per organization by the account team after an eligibility check, not part of the standard plan

A few things sit outside that table:

  • Feedback. /feedback, /bug and /share send the conversation, including code, and those transcripts are kept for 5 years. An optional transcript upload after the session survey is kept up to 6 months and only happens if someone clicks Yes.
  • Telemetry. Usage metrics never include code, prompts or file paths; error reports redact known secret patterns. DISABLE_TELEMETRY, DISABLE_ERROR_REPORTING or CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC switch them off.
  • Your own disk. Session transcripts are stored in plain text under ~/.claude/projects/ for 30 days by default. Sessions started or most recently continued in Claude Desktop or Cowork are exempt from that limit by default.
  • Cloud providers. Through Amazon Bedrock, Google Cloud’s Agent Platform or Microsoft Foundry, encryption at rest follows that provider (customer-managed keys are possible), and metrics, error reports and /feedback are off by default.
  • Cloud sessions. Claude Code on the web clones the repo into an isolated VM managed by Anthropic. GitHub credentials never enter that VM; a proxy adds them server side.

What the agent can do on the machine

The controls, from soft to hard:

  1. Permission mode. Since recent versions, interactive terminal and VS Code sessions start in auto mode: a separate classifier model reviews actions and blocks the ones it judges unsafe, such as curl | bash, production deploys or force pushes. Manual mode starts read-only and asks before every edit or non-read-only command. Shift+Tab switches mode. The organization can turn auto mode off. More on how it decides in Claude Code auto mode.
  2. Deny rules. A rule like "deny": ["Read(./.env)", "Read(./secrets/**)"] holds in every mode, including auto and bypassPermissions. Rules match tool calls, not intent: a script that opens the file is not caught.
  3. Sandbox. /sandbox puts shell commands inside an OS-enforced boundary: writes only in the working directory and a few added paths, network only to domains you allow. It is off by default, and it does not exist on native Windows (use WSL2). By default it still lets commands read most of the machine, including ~/.ssh, unless you restrict reads.
  4. Managed settings. IT can push a policy from the claude.ai admin console, through MDM or as a managed-settings.json file. Nothing in a developer’s own settings overrides a managed key, which is where a security team puts deny rules, a required sandbox and the list of allowed MCP servers.

The misunderstanding: “it asks before it does anything”

That used to be the default. Today a new interactive session starts in auto mode, where a model, not you, approves routine actions. Anthropic’s best-practices page says it plainly: auto mode is a classifier making judgment calls and can be wrong, so “never” rules belong in deny rules or hooks. Even in Manual mode, the working directory boundary is a permission prompt: a Bash command you approve can write anywhere your account can.

Prompt injection

Text Claude reads, in a web page, an issue or a dependency, can contain instructions. The built-in protections: network commands like curl are not auto-approved by default, most web pages reach Claude as a summary from a separate model call, an untrusted folder triggers a trust dialog, and project MCP servers need their own approval. Anthropic’s own advice for untrusted content: review commands before approving, don’t pipe untrusted content straight in, and use a VM for scripts that touch external services. The docs add that no system is immune.

What this means for a team

Commit the shared rules in .claude/settings.json so every clone gets them, and put what nobody may bypass in managed settings. Check that every developer is on a commercial plan: a developer using a personal Pro or Max account on company code falls under consumer terms, where training depends on that person’s own privacy setting. The pricing page lists which plans are which. For the hard rules, see Claude Code hooks; for a broader policy on who may see what, how to give AI agents your company context.

Where Bombos fits

The security settings decide what Claude Code may touch; they do not decide what it knows. Bombos is a plugin that gives Claude Code and the team’s other AI tools one shared memory, and it can run in the cloud or standalone on your own server, which matters when a security review asks where team knowledge is kept. Every answer is traceable to its source. One developer can try it on their own agents first.

Related questions

Does Anthropic train on our code if we use Claude Code?

Not under commercial terms: Team, Enterprise, the API and cloud providers, unless your organization opts in, for example through the Development Partner Program. On Free, Pro, Max and Ultra accounts, Anthropic trains on the data when the user leaves the model-improvement setting on.

Can I stop Claude Code from reading .env files?

Yes. Add deny rules such as Read(./.env) and Read(./.env.*) under permissions in a settings file. Deny rules hold in every permission mode, and Claude Code also applies them to common file-reading commands like cat. A script that opens the file itself is not caught, which is what the sandbox is for.

Does the sandbox work on Windows?

Not natively. On native Windows Claude Code runs shell commands unsandboxed; to use the sandbox there, run Claude Code inside WSL2. On macOS it uses Seatbelt, on Linux and WSL2 bubblewrap.

Where are transcripts stored on my own machine?

In plain text under ~/.claude/projects/, for 30 days by default, so you can resume sessions. The cleanupPeriodDays setting changes that period. Sessions started or most recently continued in Claude Desktop or Cowork are exempt from that limit by default.

Does /feedback send our code to Anthropic?

Yes. /feedback, /bug and /share send a copy of the conversation, including code, and those transcripts are kept for 5 years. Set DISABLE_FEEDBACK_COMMAND=1 to turn the command off.

Sources

  1. Claude Code docs: Security
  2. Claude Code docs: Data usage
  3. Claude Code docs: Sandboxing
  4. Claude Code docs: Settings files and precedence
  5. Claude Code docs: Best practices
The first half hour · free

What does your AI forget?

  1. 01You tell us which AI you use and where it keeps starting over.
  2. 02We show what a shared memory changes there, on your own examples.
  3. 03You keep the plan, with or without Bombos.
Piet Baudoin
Piet BaudoinYou talk to Piet, from the Bombos teamDutch team from Utrecht and Nijmegen · data in Europe
We reply the same working day.