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?
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).
Sign out of your personal account in your browser.
Sign up at github.com with a new username and an email address you control.
Verify the email address.
Sign back in to your personal account. Add the machine account as a collaborator on the repositories it needs.
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:
- You stay responsible for everything the account does.
- The free plan allows only one machine account beside your personal account. A second agent needs another route.
- Each agent that runs
giton that account uses the same identity. The commits do not separate agents from each other.
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.
- Choose a machine account if you want the least setup and you accept shared identity.
- Choose a GitHub App if you want each agent to have its own name, its own rate limit, and tokens that expire in one hour.
- In either case, add a
Co-authored-bytrailer if you want the human to get credit. GitHub says the trailer counts only when it uses an email linked to that person's account (Creating a commit with multiple authors).
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.