Repository navigation
AGENTS.md: rules for the GitHub API budget - #10021
Merged
Merged
Conversation
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DZvaN9tm5taf5avUvVtmyq
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GitHub allows 5000 REST requests an hour per user (1000 for
GITHUB_TOKENper repository), and every token that acts as the same account shares one bucket. Today an analysis with four requests per pull request, eight in parallel, plus a concurrent dry run ofstale-discovered.shthat walked the comments of 3400 pull requests, used up the whole hour.This adds a "GitHub API budget" section to AGENTS.md:
rate_limitevery 50 requests and stops with a reserve left, print the count in the summary, stop afterlimitactions, one request-heavy job at a time, respect the search API's own limit;refs/pull/N/head,ls-remote, raw.githubusercontent.com) where it gives the same answer for free, readrate_limitbefore a batch and keep a reserve, cache responses, 2-3 requests in parallel at most, stop at the first "rate limit exceeded".The matching change to
stale-discovered.sh(prefilter byupdated_at, request counter and quota guard) is in #10014.🤖 Generated with Claude Code
https://claude.ai/code/session_01DZvaN9tm5taf5avUvVtmyq
Generated by Claude Code