claude-code - 💡(How to fix) Fix gh release upload of large files fails with "tls: bad record MAC" through Bash sandbox proxy [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#57873Fetched 2026-05-11 03:23:08
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Author
Participants
Timeline (top)
labeled ×5

Error Message

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. 3. Result: Post "https://uploads.github.com/repos/owner/repo/releases/N/assets?...": remote error: tls: bad record MAC

  • env -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 (keep HTTPS_PROXY): same TLS error → not a SOCKS-vs-HTTP-CONNECT issue

Fix Action

Workaround

Run gh release upload from a regular Terminal.app outside Claude Code.

RAW_BUFFERClick to expand / collapse

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

  1. From Claude Code's Bash tool, build any large file (e.g. a 185 MB zip)
  2. Run: gh release upload v0.X.Y build/large.zip --clobber
  3. 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 set
  • env -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 (keep HTTPS_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.com is 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.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix gh release upload of large files fails with "tls: bad record MAC" through Bash sandbox proxy [1 participants]