Give Claude its own forgejo identity for issues, PRs and commit authorship #108
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Low priority — tooling, not gameplay. Like #106, parked so the findings survive; nothing here blocks game work.
Claude's issues, PRs and commits all currently appear under
liamjd. Issue #106 and PR #107 were opened by Claude but are indistinguishable from ones filed by hand.Three identities, not one
The conflation is the whole problem — these come from three different places and are fixed separately:
user.name/user.emailin the global gitconfig; no local override in this repogit blame, the name on each commitgit.liamjd.netfj's stored token#3 is the real complaint — it attributes an action to a person who did not take it. #1 is softer, since commits already carry a
Co-Authored-By: Claude Opus 5trailer.Decided
Do #3 and #1. Skip #2.
Making pushes appear as the bot needs a second credential for the same host, which means a username-qualified remote (
https://claude-bot@git.liamjd.net/...) as an extra remote, because wincred keys on<user>@<host>. The credential section of CLAUDE.md exists because that area has already caused trouble twice, and the payoff is one line in an activity feed. Not worth it.For #1, set only
GIT_AUTHOR_*and leave the committer alone. Git then records author = claude-bot, committer = Liam, which is exactly what happened in git's own vocabulary, and keepsgit blamehonest without pretending the bot did the directing.Steps
1. Forgejo, as admin (cannot be done from Claude Code — needs the admin UI, or an admin-scoped token):
claude-botat/admin/users/new.liamjdavison@gmail.com.liamjdavison+claude@gmail.comworks: forgejo treats it as distinct and it still reaches the same inbox. This matters for #1 too — forgejo links a commit to an account by matching the author email, so the bot's git email must be the address on its account or the commits will show as an unlinked plain name.claude-botas a collaborator with Write on this repo (Settings → Collaborators). Without write accessfj pr createfails.fjfails obscurely when one is missing, so confirm against the token screen on this forgejo version rather than assuming the names.2. Claude Code side:
fjstores one token per host andfj authhas no per-host account switching — butFJ_TOKENoverrides the stored config, as CLAUDE.md already records. So anenvblock applies the bot identity to every command Claude runs while leaving the user's own terminalfjuntouched:Trap:
.claude/does not exist in this repo and is not in.gitignore. That file holds a plaintext token, so the ignore entry has to be added in the same breath as the file, not afterwards.3. Docs: CLAUDE.md's "Credentials come from stored config" line describes a single account and needs to describe two, including which token is which. Note the existing warning about keeping
fj's token separate from git's push token still applies, and now there are three tokens in play.Caveats
!prefix runs commands inside the Claude Code session, so anything typed that way inherits the bot env and would be committed asclaude-bot.settings.local.json, and it cannot be shared through git because of the token.Closes #Ntrailers work the same whoever opens the PR.AC
claude-botexists, is a Write collaborator, and its token is in.claude/settings.local.json.claude/settings.local.jsonis gitignored, verified bygit statusshowing nothing after it is writtenclaude-botas the authorclaude-bot, committerLiam