What is going on
When Claude Code attempts to access a GitHub repository, it receives 403 Forbidden errors despite having a valid GitHub token. The token was generated with limited scopes and lacks permissions needed for repository operations.
This manifests when the user's OAuth flow doesn't request all necessary scopes, or when GitHub's scope requirements change but the CLI isn't updated.
Error messages you might see
Common causes
- OAuth scopes missing 'repo' or 'repo:read' permission during token generation
- Missing 'workflow' scope needed to read GitHub Actions
- OAuth flow hardcoded to minimal scopes instead of asking user for authorization
- Token generated with 'public_repo' only, but accessing private repository
- Admin repository access required but not requested during OAuth
How to fix it
Request scopes: ['repo', 'user', 'gist', 'workflow', 'admin:repo_hook'] during OAuth flow. Display to user which scopes are being requested and why. Provide a 're-authorize' command to upgrade existing tokens. Store scope metadata with tokens to validate permissions before operations.
Getting help takes about a minute
No hiring, no back and forth. A real person looks at your app.
-
1
Describe it
Tell us what you need in plain words. You don't have to be technical or have an account to start.
-
2
Free 15-minute call
A verified developer calls you. Many tasks are sorted right there, and it costs nothing.
-
3
Pay after you approve
If there is more to do, you get one fixed price up front. You pay only once you are happy.
Real people, reviewed by hand
Developers who do this every day
Every developer is approved by our team before they can take a task. Describe yours and the first one who is free picks it up.
Get helpQuestions
What are the minimum GitHub scopes needed?
At minimum: repo (full repository access), user (user profile), and workflow (GitHub Actions). Add admin:repo_hook if managing webhooks.
Can scopes be changed without re-authenticating?
No. Users must re-authorize via the OAuth flow to grant additional scopes. Provide a clear CLI command to trigger re-authorization.
How should scope changes be handled in updates?
Detect when your scopes change. Prompt users to re-authorize on next CLI run, explaining what new permissions are needed and why.