[Bug] macOS sandbox git over SSH fails due to unauthenticated SOCKS5 proxy

Status Open
Reported on v2.1.285
Maintainer reply None cached
Activity 0 comments · opened Sep 30, 2026

Bug Description
Sandbox (macOS): git over SSH always fails. The injected GIT_SSH_COMMAND can't authenticate to the sandbox proxy.

Env: Claude Code 2.1.285, macOS 26.6.2, OpenSSH_10.3p1, Apple git 2.50.1. Default Seatbelt sandbox.

Repro (any SSH remote, run inside the sandbox):
git ls-remote git@github.com:<org>/<repo>.git

Result:
Received disconnect from UNKNOWN port 65535:1: This proxy requires authentication, and this client did not offer an authentication method, so the connection was refused.
fatal: Could not read from remote repository.

Cause: inside the sandbox, Claude Code sets
GIT_SSH_COMMAND=ssh -o ControlMaster=no -o ControlPath=none -o ProxyCommand='nc -X 5 -x localhost:<port> %h %p'
The proxy only accepts SOCKS5 username/password auth, and those credentials are in ALL_PROXY. macOS nc can't send SOCKS5 credentials, so the connection is refused before SSH starts.

Proof it's only the auth step: I used a small ProxyCommand that does SOCKS5 user/pass auth with the ALL_PROXY credentials, then CONNECTs to %h %p. Through it, git ls-remote over SSH works inside the sandbox. Proxy, allowlist and SSH keys are all fine.

Also: GIT_SSH_COMMAND overrides ~/.ssh/config, so users can't fix this themselves. The only options are the unsandboxed retry, excludedCommands, or switching remotes to HTTPS.

Expected: the injected ProxyCommand authenticates to the proxy (for example a bundled helper or socat with auth), or the proxy accepts unauthenticated SOCKS5 from the sandboxed process.

Environment Info

  • Platform: darwin
  • Terminal: Hyper
  • Version: 2.1.285
  • Feedback ID: f82637c8-2736-450c-9ebb-f0f52bffbe7d

Errors

[]

View original on GitHub ↗