From 11be196415af3facbf5240eef891b4e4cba8725c Mon Sep 17 00:00:00 2001 From: David Karlsson <35727626+dvdksn@users.noreply.github.com> Date: Tue, 2 Jun 2026 12:55:46 +0200 Subject: [PATCH] docs: document WSL --clone safe.directory workaround Clone mode fails on \\wsl.localhost\... paths because Git's dubious ownership check makes sbx's repo detection fail. Add a troubleshooting section with the safe.directory workaround. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../manuals/ai/sandboxes/troubleshooting.md | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/content/manuals/ai/sandboxes/troubleshooting.md b/content/manuals/ai/sandboxes/troubleshooting.md index e4b0fc8e4b2..aaa32840abf 100644 --- a/content/manuals/ai/sandboxes/troubleshooting.md +++ b/content/manuals/ai/sandboxes/troubleshooting.md @@ -143,6 +143,35 @@ The setting is persisted in the sandbox spec and applies for the lifetime of that sandbox. If you experience Git index corruption or unexpected file content after enabling the cache, remove the sandbox and recreate it without the flag. +## Clone mode reports "not in a Git repository" on WSL + +On Windows, running [`sbx run --clone`](usage.md#clone-mode) against a +repository on a WSL filesystem (a `\\wsl.localhost\...` path) can fail even +though the directory is a valid Git repository: + +```console +> sbx run --clone claude \\wsl.localhost\Ubuntu\home\you\repo +ERROR: --clone requires a Git repository, but \\wsl.localhost\Ubuntu\home\you\repo is not in a Git repository +``` + +The cause is Git's dubious ownership check. When Git on Windows accesses a +repository owned by a different user across the WSL boundary, it refuses to +operate on it, so the underlying repository detection fails: + +```console +> git -C \\wsl.localhost\Ubuntu\home\you\repo rev-parse --show-toplevel +fatal: detected dubious ownership in repository at '//wsl.localhost/Ubuntu/home/you/repo' +``` + +Add the repository to Git's `safe.directory` list to allow access, then run +the command again: + +```console +> git config --global --add safe.directory '%(prefix)///wsl.localhost/Ubuntu/home/you/repo' +> sbx run --clone claude \\wsl.localhost\Ubuntu\home\you\repo +✓ Git repository detected: \\wsl.localhost\Ubuntu\home\you\repo +``` + ## Stale Git worktree after removing a sandbox If you used `--branch`, worktree cleanup during `sbx rm` is best-effort. If