claude-code - 💡(How to fix) Fix [BUG] Cloud environment setup script <code>uv self update</code> fails repeatedly with GitHub API rate limit [1 participants]

Official PRs (…)
ON THIS PAGE

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#52963Fetched 2026-04-25 06:16:04
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×3cross-referenced ×1

Error Message

Setup script failed with exit code 2. Script output: info: Checking for updates... error: GitHub API rate limit exceeded. Please provide a GitHub token via the --token option. Edit your environment's setup script and start a new session.

Fix Action

Fix / Workaround

Workarounds I Tried

WorkaroundResult
Remove uv self update, use curl -LsSf https://astral.sh/uv/install.sh | sh insteadcurl: (22) The requested URL returned error: 403astral.sh is not on the default sandbox network allowlist
Set GITHUB_TOKEN in Custom Environment variablesWorks — uv self update authenticates and the rate limit jumps from 60/hr to 5,000/hr. This should arguably be the documented solution.
pip install --upgrade uvWorks, but the PyPI-published uv version sometimes lags the standalone release

Code Example

Setup script failed with exit code 2.
Script output: info: Checking for updates...
error: GitHub API rate limit exceeded. Please provide a GitHub token via the `--token` option.
Edit your environment's setup script and start a new session.

---



---

uv self update
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

When my cloud environment setup script runs uv self update, it fails with a GitHub API rate limit error, preventing the session from starting. I hit this 5 times in a row around 11:20am PST, so it's not a one-off.

Setup script failed with exit code 2.
Script output: info: Checking for updates...
error: GitHub API rate limit exceeded. Please provide a GitHub token via the `--token` option.
Edit your environment's setup script and start a new session.

uv self update queries the GitHub Releases API to check for newer versions. Unauthenticated requests to that API are limited to 60/hour per source IP. Claude Code's cloud environment appears to either share egress IPs across users, or retries of the setup script from the same session quickly burn through the 60/hour budget — either way, users hit this wall with no way to self-recover beyond adding their own token.

What Should Happen?

Either:

  1. The cloud environment provides an authenticated GITHUB_TOKEN by default for outbound GitHub API calls made from setup scripts (scoped read-only), eliminating the rate limit issue, or
  2. The documentation for cloud environment setup scripts explicitly warns that tools calling the GitHub API (uv self update, gh, release-checking installers, etc.) will hit rate limits and recommends users set GITHUB_TOKEN in Custom Environment variables, or
  3. The default base image ships with a recent uv so users don't need to self-update at session start.

Error Messages/Logs

Steps to Reproduce

  1. Open the Claude desktop app and start a cloud environment session.
  2. In the environment setup script, include:
    uv self update
  3. Start a new session.
  4. Setup fails with exit code 2 and the error above. In my case, this failed 5 consecutive times within a short window around 11:20am PST.

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

Claude 1.3883.0 (93ff6c), build 2026-04-21T17:24:01.000Z

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

Workarounds I Tried

WorkaroundResult
Remove uv self update, use curl -LsSf https://astral.sh/uv/install.sh | sh insteadcurl: (22) The requested URL returned error: 403astral.sh is not on the default sandbox network allowlist
Set GITHUB_TOKEN in Custom Environment variablesWorks — uv self update authenticates and the rate limit jumps from 60/hr to 5,000/hr. This should arguably be the documented solution.
pip install --upgrade uvWorks, but the PyPI-published uv version sometimes lags the standalone release

Environment

  • Product: Claude Code cloud environment (Claude desktop app)
  • Setup script: contains uv self update
  • Time of failure: ~11:20am PST, failed 5 consecutive times
  • OS: macOS
  • Desktop app version: Claude 1.3883.0 (93ff6c), build 2026-04-21T17:24:01.000Z
  • Plan: Max 20x

extent analysis

TL;DR

To fix the GitHub API rate limit error when running uv self update in the cloud environment setup script, set a GITHUB_TOKEN in Custom Environment variables.

Guidance

  • The error occurs because unauthenticated requests to the GitHub API are limited to 60/hour per source IP, and the cloud environment's shared egress IPs or script retries quickly exceed this limit.
  • To verify the issue, check the setup script output for the "GitHub API rate limit exceeded" error message.
  • To mitigate the issue, set a GITHUB_TOKEN in Custom Environment variables, which will authenticate the API requests and increase the rate limit to 5,000/hr.
  • Alternatively, consider updating the documentation to warn users about the potential rate limit issue and recommend setting a GITHUB_TOKEN.

Example

No code snippet is necessary, as the solution involves setting an environment variable.

Notes

The provided workaround of setting a GITHUB_TOKEN in Custom Environment variables is effective, but it may be more convenient to have the cloud environment provide an authenticated GITHUB_TOKEN by default or to update the default base image with a recent uv version.

Recommendation

Apply the workaround by setting a GITHUB_TOKEN in Custom Environment variables, as it is a straightforward and effective solution to the rate limit issue.

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