Workaround for broken git-over-SSH in the Claude Code sandbox on macOS.
The Claude Code sandbox injects GIT_SSH_COMMAND with a ProxyCommand using
BSD nc -X 5 for SOCKS5 proxying. On macOS, nc doesn't support SOCKS5
authentication, and the proxy requires auth — breaking all git-over-SSH
operations (git fetch, git push, git pull).
Tracked upstream: anthropics/claude-code#70684
This plugin ships an nc wrapper (bin/nc) that intercepts SOCKS5 proxy calls
and delegates to ncat with the auth credentials parsed from ALL_PROXY.
- SessionStart hook prepends
plugin/bin/toPATHviaCLAUDE_ENV_FILE - Sandbox injects
GIT_SSH_COMMANDcontainingnc -X 5 -x localhost:PORT %h %p - SSH runs ProxyCommand, shell finds
bin/ncwrapper first via PATH - Wrapper checks for the SOCKS5 pattern (
-X 5 -x), readsALL_PROXY(available at runtime in sandbox), and delegates toncatwith--proxy-auth - Non-SOCKS5 calls or missing
ncatfall through to/usr/bin/nc
The wrapper uses 127.0.0.1 instead of localhost because ncat resolves
localhost differently and the connection is refused.
Install ncat (from nmap) for full SOCKS5 proxy support:
brew install nmapWithout ncat, the plugin falls back to the system nc which will fail for
authenticated SOCKS5 proxies.
Apache License 2.0. See LICENSE for details.