answered from live GitHub & Hugging Face data

How do I create a GitHub App for Claude Code to manage its commits separately from my personal account?

githug-ai/hugApache-2.0
MaintActive · 5d ago
Stars0
Contrib1
Issues0 open

Verdict: Create a GitHub App and use only its installation tokens. Installation tokens act as the app, not as your personal account. GitHub says installation access tokens "will attribute activity to your app," while user access tokens "will attribute activity to a user and to your app" (Best practices). Avoid user tokens if you want separation.

Steps

  1. Open your account Settings, then Developer settings, then GitHub Apps. Click New GitHub App (Registering a GitHub App).
  2. Enter a unique name of 34 characters or fewer. Example: claude-code-bot.
  3. Set Permissions to the minimum. For commits and PRs, this is likely Contents and Pull requests (my suggestion, not from the docs).
  4. Deselect Active if the app needs no webhooks.
  5. Under "Where can this GitHub App be installed?", select Only on this account.
  6. Click Create GitHub App.
  7. Generate a private key from the app settings. The JWT step requires it. I did not read the key-management page.
  8. Install the app on one repository. Select Only select repositories (Installing your own GitHub App).
  9. Find the installation ID with GET /repos/{owner}/{repo}/installation (Generating an installation access token).
  10. Create a JWT signed with RS256. Set iat to 60 seconds in the past. Set exp to no more than 10 minutes ahead. Set iss to the client ID (JWT docs).
  11. Call POST /app/installations/INSTALLATION_ID/access_tokens with the JWT. Pass repositories to limit the token to one repository (installation token docs).
  12. Give the token to Claude Code for git over HTTPS. I did not verify the exact git syntax or the Claude Code configuration in the docs.

Constraints to plan for

Recommendation

Use one GitHub App per agent when you need separate actors. Register it on your account, install it on one repository, and mint a 1-hour token for each run.

If you want this set up for you, githug provides a CLI (hug init --repo owner/repo) that configures an agent-specific key for Claude Code. It mints one-hour tokens scoped to one repository. It is free during the beta.

docs.github.com/en/apps/creating-github-apps/registering-a-github-app/registering-a-github-appdocs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-an-installation-access-token-for-a-github-appdocs.github.com/en/pull-requests/how-tos/commit-changes/troubleshooting-commitsgithub.com/githug-ai/hugdocs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-json-web-token-jwt-for-a-github-appdocs.github.com/en/apps/using-github-apps/installing-your-own-github-appdocs.github.com/en/apps/creating-github-apps/about-creating-github-apps/best-practices-for-creating-a-github-app
Answered live from GitHub & Hugging Face · anthropic/claude-haiku-5.5 · 10/16/2026

Ask your own open-source question →