gh release upload of large files fails with "tls: bad record MAC" through Bash sandbox proxy
Bug
gh release upload of any release asset larger than ~a few MB consistently fails with remote error: tls: bad record MAC when run from the Claude Code Bash tool. The same command from a regular Terminal.app (outside Claude Code's environment) succeeds with the same network and same gh credentials.
Reproduction
- From Claude Code's Bash tool, build any large file (e.g. a 185 MB zip)
- Run:
gh release upload v0.X.Y build/large.zip --clobber - Result:
Post "https://uploads.github.com/repos/owner/repo/releases/N/assets?...": remote error: tls: bad record MAC
What I tested to narrow it down
- Small upload through same proxy: 16-byte text file uploaded fine to the same release ✓
- Large upload from regular Terminal.app: succeeds (with normal proxy / no-proxy environment)
gh release create(small JSON POST): succeeds through same Claude Code env ✓dangerouslyDisableSandbox: true: still fails — proxy env vars remain setenv -u HTTP_PROXY -u HTTPS_PROXY -u ALL_PROXY gh release upload ...: fails with "error connecting to api.github.com" (network requires Claude Code's proxy to reach GitHub at all)- Drop only
ALL_PROXY(keepHTTPS_PROXY): same TLS error → not a SOCKS-vs-HTTP-CONNECT issue - Pattern matches reports of similar Go HTTP client + local proxy + large streaming POST: rclone#1893, rclone#3338, googleapis/google-cloud-go#1581 — all attribute it to proxy-side buffering corrupting long TLS streams
Diagnosis
Claude Code's local sandbox proxy (ports 65166 HTTP / 65167 SOCKS5 in my session) appears to corrupt bytes during long-running streaming HTTPS uploads, breaking TLS record MAC verification on uploads.github.com. Small requests through the same proxy work fine; the bug only triggers on multi-second streaming uploads.
This blocks gh release upload (and presumably any other Go-based tool doing chunked/streaming HTTPS uploads to allow-listed hosts) from inside Claude Code.
Environment
- Claude Code: 2.1.138
- macOS: 26.4.1 (Darwin 25.4.0)
- gh CLI: 2.92.0
uploads.github.comis in the host allowlist (small uploads pass)
Workaround
Run gh release upload from a regular Terminal.app outside Claude Code.
Suggested investigation
The Bash tool's sandbox proxy implementation — likely a Go HTTP CONNECT proxy / SOCKS5 proxy — needs to handle long-running upload streams without buffering or re-segmenting the TLS payload. This was apparently working in earlier Claude Code versions and regressed.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗