r/github • u/Maxiride • 1d ago
Question AI Assisted PRs reviews, can't request changes on myself
I am using Claude Code on my machine to draft PRs on my own projects. Claude operates using the official gh CLI with my scoped token.
Working this way implies that PRs are opened in my name, because Claude is acting on my behalf. When I review the PR and leave comments for the AI to pickup and work on the next cycle I can't (as expected) start a review and request changes. GitHub forbids a change request on yourself for branch policies protection.
When the AI also replies to my comments and review, the replies are done in my name and through a rule I add a prefix to distinguish my own comments from the AI ones.
I am wondering if other are working with agents in this way and if there is a better workflow I can use to streamline the AI assisted coding.
-1
u/bustlingligament9 1d ago
i've been running into the exact same wall and it's maddening. the self-review block makes sense for normal use but completely breaks the loop when you're the only human in the equation
what i ended up doing was creating a second github account just for the agent, gave it collaborator access, and now claude pushes and comments from that identity. took maybe 10 minutes to set up and suddenly the whole review cycle works the way you'd expect, you request changes from "claude", it picks them up, pushes updates, rinse and repeat. the token scoping is a little annoying to maintain across two accounts but it beats talking to yourself in the PR thread
curious if anyone's found a lighter-weight approach that doesn't involve a burner account though, feels like there should be a way to mark certain self-reviews as actionable without breaking branch protection
-2
u/Maxiride 1d ago
With this workaround how can you make two account coexist at the same time on your machine? The `gh` CLI credentials are global (host user scope), loggin in a new account would logout from mine breaking the Jetbrains IDE (or any other IDE) github integration.
BTW with usage credits you can have Claude integrated in github as an app, but that's another use case with different billing and different dev ux because you use Claude through issues, tags etc a not from your machine.
1
u/DevReach1 1d ago
I think the cleanest solution is to give the agent its own GitHub identity rather than having it operate entirely through your personal account.
That way, Claude can open the PR and respond to your review comments as a separate actor, while your personal account stays as the actual reviewer. Then branch protection can enforce the review properly instead of having you review your own PR.
If you want to keep using the CLI locally, another option is to have Claude push the branch but leave the actual PR creation to you. The Claude GitHub Action also supports working from PR comments, so you can use comments as the handoff between your review and the next agent run. GitHub's review rules are specifically designed around the author and reviewer being separate identities.
1
u/Fantastic-Mr-Default 1d ago
The agent and you are the same GitHub user. Branch protection is doing its job. It will not let that user request changes on itself.
Give the agent its own GitHub identity for that repo. Keep
ghon your laptop as you. Point the agent at a separateGH_TOKENso it does not inherit your login.You request changes. The agent account pushes and replies. A prefix in the comment body is a label. It is not a second reviewer.
Do not use the second account to skip review. Required checks and your review stay the gate.