answered from live GitHub & Hugging Face data

How do I create a separate GitHub App for Claude Code to manage its identity and contributions?

Create one GitHub App per agent, and give each app access to only the repositories it needs. Installation tokens from the app show as activity from the app itself, so a shared app would hide which agent acted. Claude Code needs a GitHub App that its own token and commits use.

I did not check how Claude Code itself stores or passes git credentials. The steps below cover the GitHub side.

Steps

  1. Open your profile menu. Click Settings. For an organization app, click Your organizations, then Settings.
  2. In the left sidebar, click Developer settings, then GitHub Apps.
  3. Click New GitHub App.
  4. Enter a name. The name can be at most 34 characters and must be unique across GitHub. (Registering a GitHub App)
  5. Enter a homepage URL. Use your repository URL if you have no website.
  6. Leave Callback URL empty if the agent acts without a user. The field is only needed for user tokens.
  7. Deselect Active if the app does not need webhooks.
  8. Under Permissions, select the minimum access the agent needs. Choose Read-only, Read & write, or No access for each. (Best practices)
  9. Under Where can this GitHub App be installed?, select Only on this account.
  10. Click Create GitHub App.
  11. Generate a private key on the app settings page. Store it in a key vault. An environment variable is weaker. The docs warn that the private key grants access to every account where the app is installed. (Best practices)
  12. Install the app on one repository only.
  13. Have the agent create a JSON Web Token (JWT) from the private key. Then send POST /app/installations/INSTALLATION_ID/access_tokens. (Installation access tokens)
  14. Add a repositories value to the request. This limits the token to that repository.
  15. Add a permissions value to the request. This limits the token to the listed permissions.

Token limits

Commit attribution

Recommendation

Use one app per agent, installed on one repository, with the smallest permission set. Rotate the private key if it leaks.

If you want this setup without doing the steps by hand, githug gives each agent its own key. Its tokens last one hour and work on one repository. The hug init --repo owner/repo command sets this up for Claude Code. It is free during the beta.

docs.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/creating-a-commit-with-multiple-authorsdocs.github.com/en/apps/creating-github-apps/about-creating-github-apps/best-practices-for-creating-a-github-appdocs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-appdocs.github.com/en/apps/creating-github-apps/registering-a-github-app/registering-a-github-app
Answered live from GitHub & Hugging Face · anthropic/claude-haiku-5.5 · 10/28/2026

Ask your own open-source question →