answered from live GitHub & Hugging Face data

How do I create a dedicated GitHub account for Claude Code or Codex to keep commits separate from my personal account?

MaintSlowing · 7mo ago
Stars1
Issues0 open
MaintActive · 10d ago
Stars1
Issues14 open
MaintActive · 3d ago
Stars0
Issues1 open

A machine account works, but a GitHub App is the better choice if you run more than one agent. GitHub allows a machine account when a person creates it, accepts the terms for it, and stays responsible for it. A GitHub App gives each agent its own identity and tokens that expire.

Option 1: Create a machine account

GitHub's Terms of Service define a machine account as one "set up by an individual human who accepts the Terms on behalf of the Account." It must be "used exclusively for performing automated tasks." You may keep one free machine account in addition to your personal account (GitHub Terms of Service, B.3).

  1. Sign out of your personal account in your browser.

  2. Sign up at github.com with a new username and an email address you control.

  3. Verify the email address.

  4. Sign back in to your personal account. Add the machine account as a collaborator on the repositories it needs.

  5. Set the commit identity for the agent's repository, using the machine account's no-reply address:

    git config user.name "agent-name"
    git config user.email "ID+agent-name@users.noreply.github.com"
    

    GitHub says a commit counts toward a contributor only when its email is linked to a GitHub account (Setting your commit email address).

I did not open GitHub's sign-up page, so check its current steps there.

Limits to know:

Option 2: Use a GitHub App for each agent

Use this option if you run several agents or want short-lived access. Installation tokens "will expire after 1 hour." You can limit a token to specific repositories and permissions (Generating an installation access token).

Project Maintenance Stars License Best for
innago-property-management/AgentGit ✅ maintained, pushed 53 days ago 0 MIT Claude Code users who want a bot identity through GitHub App auth
R4yHarris/github-agent-contracts ✅ actively maintained, pushed 3 days ago 0 MIT Teams that want a policy layer for several agents. The project is new and has one open issue.

These projects are both new and have no stars. Read the code before you trust either one with write access.

How they relate

Both projects handle the same problem. AgentGit covers the Claude Code hook. The contracts project covers identity and policy across several agents. Each still needs a GitHub App that you register and install on your repositories.

Recommendation

Use a machine account for one agent on one repository. Use a GitHub App for each agent in every other case.

githug gives each agent its own GitHub App identity, with tokens that last one hour and cover one repository. Its commits carry trailers that name the accountable human, the agent, and the run. The hug CLI sets this up with hug init --repo owner/repo. It is free during the beta.

docs.github.com/en/site-policy/github-terms/github-terms-of-servicedocs.github.com/en/get-started/learning-about-github/types-of-github-accountsdocs.github.com/en/pull-requests/how-tos/commit-changes/creating-a-commit-with-multiple-authorsgithub.com/nikakakash/git-auto-agentgithub.com/korolevmaksim/aeriegithub.com/R4yHarris/github-agent-contractsgithub.com/innago-property-management/AgentGitgithub.com/mpbarbosa/agora_na_copa_2026docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-an-installation-access-token-for-a-github-appdocs.github.com/en/account-and-profile/how-tos/email-preferences/setting-your-commit-email-address
Answered live from GitHub & Hugging Face · anthropic/claude-haiku-5.5 · 10/10/2026

Ask your own open-source question →