What
The sandbox is a restricted environment that Claude Code can run shell commands in. On Windows, the instructions Claude reads about the sandbox for its Bash tool (the tool it uses to run shell commands) now include git guidance:
- Do not run
git init,git cloneorgh repo clonein the sandbox. Your own git would then refuse the repository with a "detected dubious ownership" error. - Do not run
git worktree addin the sandbox, even when you ask for a worktree. - Sandboxed git cannot use your saved sign-in over HTTPS or SSH.
- When Claude Code is started in a subfolder of a repository, sandboxed commands cannot write to the
.gitfolder above the working directory.
Before this, the list only covered empty placeholder files.
Why
On Windows, Claude will now decline to create or clone repositories inside the sandbox and will ask you to do it yourself. This avoids leaving you with a repository your own git will not open.