answered from live GitHub & Hugging Face data

What are the best practices for managing rate limits when using multiple AI coding agents like Claude Code and Codex in the same GitHub repository?

MaintActive · today
Stars156k
Releasev2.1.328today
Contrib59
Issues17k open
openai/codexApache-2.0
MaintActive · today
Stars136k
Releaserust-v0.170.0yesterday
Contrib739
Issues28k open

Give each agent its own GitHub App installation, not a shared personal access token. A personal access token draws from one 5,000-request-per-hour budget, so two agents using it compete for the same quota. An app installation has its own budget, and the limit grows with the size of the installation.

Why the budget matters

Authentication Primary limit (per hour) Shared with Source
Personal access token 5,000 Every token, app, and OAuth grant of that user REST rate limits
GitHub App installation token 5,000 minimum, up to 12,500 Only that installation REST rate limits
GitHub App, Enterprise Cloud org 15,000 Only that installation REST rate limits
GITHUB_TOKEN in Actions 1,000 per repository The repository's workflow runs REST rate limits

The docs say a higher-limit app reduces the budget left for a user's personal tokens. A user token therefore has less room when an agent uses it.

Secondary limits apply to both

These limits apply to any token. The docs state these points:

Sources: REST rate limits and Best practices.

Practices to follow

  1. Create one GitHub App for your team. Install it on the repository for each agent.
  2. Use a separate installation token for each agent run. Limit each token to one repository with the repositories parameter.
  3. Refresh the token before it expires. Installation tokens expire after 1 hour. Octokit SDKs refresh them for you. Source: Generating an installation access token.
  4. Queue requests. Make them one after another, not in parallel. The docs advise against concurrent requests.
  5. Wait at least one second between write requests. This avoids secondary limits.
  6. Use conditional requests when agents poll. An authorized 304 Not Modified response does not count against the primary limit. Use webhooks where you can instead of polling.
  7. Read the x-ratelimit-* headers. When you get a 403 or 429, follow the wait rules. Use retry-after if it is present. Otherwise wait until x-ratelimit-reset. If neither applies, wait at least one minute. Then back off exponentially. Do not keep sending requests while rate limited, because the docs warn this can get the integration banned.
  8. Check remaining quota with GET /rate_limit. It does not count against the primary limit. The response headers are the authoritative source, so rely on them when the two disagree.

How they relate

I checked both projects, and both are active. anthropics/claude-code ✅ was pushed today, its latest release is v2.1.328, and it lists 59 contributors. openai/codex ✅ was pushed today, its latest release is rust-v0.170.0, and it lists 739 contributors. Neither repository documents its own GitHub rate-limit handling in the README I read. I also did not verify how each tool authenticates to GitHub. Check each tool's settings before you assume which token it uses.

Recommendation

Use one GitHub App with one installation per agent, and limit each token to one repository. This keeps each agent's budget separate. It also shows each agent's actions as its own bot.

If you want each agent to have its own identity, githug does this for you. Each agent gets its own key, which mints one-hour tokens that work on one repository. The hug CLI sets this up for Claude Code, Codex, and other agents that run git. The beta is free.

docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-apidocs.github.com/en/apps/creating-github-apps/registering-a-github-app/rate-limits-for-github-appsdocs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-apigithub.com/anthropics/claude-codegithub.com/openai/codexdocs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-an-installation-access-token-for-a-github-appdocs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-as-a-github-app-installation
Answered live from GitHub & Hugging Face · anthropic/claude-haiku-5.5 · 11/19/2026

Ask your own open-source question →