Claude Code auth

GitHub Token Missing Required Scopes

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

API Error: 403 Forbidden Insufficient permissions to access repository GET https://api.github.com/repos/owner/repo returned 403

Common Causes

  1. OAuth scopes missing 'repo' or 'repo:read' permission during token generation
  2. Missing 'workflow' scope needed to read GitHub Actions
  3. OAuth flow hardcoded to minimal scopes instead of asking user for authorization
  4. Token generated with 'public_repo' only, but accessing private repository
  5. 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.

Real developers can help you.

Omar Faruk Omar Faruk As a Product Engineer at Klasio, I contributed to end-to-end product development, focusing on scalability, performance, and user experience. My work spanned building and refining core features, developing dynamic website templates, integrating secure and reliable payment gateways, and optimizing the overall system architecture. I played a key role in creating a scalable and maintainable platform to support educators and learners globally. I'm enthusiastic about embracing new challenges and making meaningful contributions. Matthew Jordan Matthew Jordan I've been working at a large software company named Kainos for 2 years, and mainly specialise in Platform Engineering. I regularly enjoy working on software products outside of work, and I'm a huge fan of game development using Unity. I personally enjoy Python & C# in my spare time, but I also specialise in multiple different platform-related technologies from my day job. legrab legrab I'll fill this later Richard McSorley Richard McSorley Full-Stack Software Engineer with 8+ years building high-performance applications for enterprise clients. Shipped production systems at Walmart (4,000+ stores), Cigna (20M+ users), and Arkansas Blue Cross. 5 patents in retail/supply chain tech. Currently focused on AI integrations, automation tools, and TypeScript-first architectures. Victor Denisov Victor Denisov Developer rayush33 rayush33 JavaScript (React.js, React Native, Node.js) Developer with demonstrated industry experience of 4+ years, actively looking for opportunities to hone my skills as well as help small-scale business owners with solutions to technical problems Jaime Orts-Caroff Jaime Orts-Caroff I'm a Senior Android developer, currently working at Aircall. I'm open to work in various fields! Costea Adrian Costea Adrian Embedded Engineer specilizing in perception systems. Latest project was a adas camera calibration system. Milan Surelia Milan Surelia Milan Surelia is a Mobile App Developer with 5+ years of experience crafting scalable, cross-platform apps at 7Span and Meticha. At 7Span, he engineers feature-rich Flutter apps with smooth performance and modern UI. As the Co-Founder of Meticha, he builds open-source tools and developer-focused products that solve real-world problems. Expertise: 💡 Developing cross-platform apps using Flutter, Dart, and Jetpack Compose for Android, iOS, and Web. 🖋️ Sharing insights through technical writing, blogging, and open-source contributions. 🤝 Collaborating closely with designers, PMs, and developers to build seamless mobile experiences. Notable Achievements: 🎯 Revamped the Vepaar app into Vepaar Store & CRM with a 2x performance boost and smoother UX. 🚀 Launched Compose101 — a Jetpack Compose starter kit to speed up Android development. 🌟 Open source contributions on Github & StackOverflow for Flutter & Dart 🎖️ Worked on improving app performance and user experience with smart solutions. Milan is always happy to connect, work on new ideas, and explore the latest in technology. Tejas Chokhawala Tejas Chokhawala Full-stack engineer with 5 years experience building production web apps using React, Next.js and TypeScript. Focused on performance, clean architecture and shipping fast. Experienced with Supabase/Postgres backends, Stripe billing, and building AI-assisted developer tools.

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help

Frequently Asked Questions

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.

Related Claude Code Issues

Can't fix it yourself?
Real developers can help.

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help