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
API Error: 403 ForbiddenInsufficient permissions to access repositoryGET 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.

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 Jen Jacobsen Jen Jacobsen I’m a Full-Stack Developer with over 10 years of experience building modern web and mobile applications. I enjoy working across the full product lifecycle — turning ideas into real, well-built products that are intuitive for users and scalable for businesses. I particularly enjoy building mobile apps, modern web platforms, and solving complex technical problems in a way that keeps systems clean, reliable, and easy to maintain. Daniel Vázquez Daniel Vázquez Software Engineer with over 10 years of experience on Startups, Government, big tech industry & consulting. Yovel Cohen Yovel Cohen I got a lot of experience in building Long-horizon AI Agents in production, Backend apps that scale to millions of users and frontend knowledge as well. Matt Butler Matt Butler Software Engineer @ AWS Kingsley Omage Kingsley Omage Fullstack software engineer passionate about AI Agents, blockchain, LLMs. Sage Fulcher Sage Fulcher Hey I'm Sage! Im a Boston area software engineer who grew up in South Florida. Ive worked at a ton of cool places like a telehealth kidney care startup that took part in a billion dollar merger (Cricket health/Interwell health), a boutique design agency where I got to work on a ton of exciting startups including a photography education app, a collegiate Esports league and more (Philosophie), a data analytics as a service startup in Cambridge (MA) as well as at Phillips and MIT Lincoln Lab where I designed and developed novel network security visualizations and analytics. I've been writing code and furiously devoted to using computers to make people’s lives easier for about 17 years. My degree is in making computers make pretty lights and sounds. Outside of work I love hip hop, the Celtics, professional wrestling, magic the gathering, photography, drumming, and guitars (both making and playing them) 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. Basel Issmail Basel Issmail ’m a Senior Full-Stack Developer and Tech Lead with experience designing and building scalable web platforms. I work across the full development lifecycle, from translating business requirements into technical architecture to delivering reliable production systems. My work focuses on modern web technologies, including TypeScript, Angular, Node.js, and cloud-based architectures. I enjoy solving complex technical problems and helping teams turn product ideas and prototypes into working platforms that can grow and scale. In addition to development, I often collaborate closely with product managers, business analysts, designers, and QA teams to ensure that solutions align with both technical and business goals. I enjoy working with startups and product teams where I can contribute both as a hands-on engineer and as a technical partner in designing and delivering impactful software. prajwalfullstack prajwalfullstack Hi Im a full stack developer, a vibe coded MVP to Market ready product, I'm here to help

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