ThinkFacility Sign in
  1. Home
  2. Security
  3. Claude Code
HighClaude Code

Claude Code before 2.1.251 on macOS: a race in the Edit tool lets sandboxed code write outside your project

Anyone using Claude Code on a Mac, especially with repositories or dependencies you didn't write yourself.

How to fix it

You haveUpdate to
< 2.1.251→2.1.251

Check your version

Your Claude Code version
claude --version

Update

Built-in updater
claude update
npm install
npm install -g @anthropic-ai/claude-code@latest

It only works on macOS, and an attacker first needs code running in Claude Code's Bash sandbox, say from a malicious repository or dependency script. That code swaps a folder for a symlink at the right moment, and the Edit tool overwrites a file of yours outside the project. If Claude Code updates itself, you already have the fix.

Sources