{"version":"2.1.304","anchor":"sandbox-now-also-protects-a-git-file-as-in-worktrees","canonical_anchor":"sandbox-now-also-protects-a-git-file-as-in-worktrees","heading":"The sandbox now protects a .git file as well as a .git folder","tier":"notice","area":"Sandbox","scope":"individual","heads_up":true,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.304\/e\/sandbox-now-also-protects-a-git-file-as-in-worktrees","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.304","markdown":"### The sandbox now protects a .git file as well as a .git folder\n\nThe sandbox now blocks changes to a .git file, as used in git worktrees, not only to a .git folder\n\n**What**\n\nThe sandbox is a restricted space where Claude Code runs commands with limited access to your files. It already stopped commands from changing a `.git` folder, including its hooks and config.\n\nIn a git worktree, which is an extra checkout of the same repository in another folder, `.git` is a small file that points back to the main repository instead of a folder. Claude Code now checks whether `.git` is a file or a folder, and protects a `.git` file too.\n\n**Why**\n\nBefore, a command running in the sandbox could rewrite the `.git` pointer file in a worktree. That gap is now closed.\n\n- Area: Sandbox\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 1\/5\n- Scope: individual\n- Heads-up: yes"}