Summary
Add a Claude Code GitHub Action that allows PR authors to request AI-assisted code fixes by commenting @simili-bot <query> on a pull request. Claude Code will run in the context of the PR branch, perform the requested changes, and push a commit.
Motivation
When a PR is opened, automated review tools (CodeRabbit, GitHub Copilot, etc.) often leave comments with suggested improvements or flagged issues. Currently, the PR author must manually address each suggestion. This feature allows the author to tag @simili-bot with a natural language request, and Claude Code will automatically make the changes and commit them to the PR branch.
Proposed Behavior
- Trigger: A PR comment is created containing
@simili-bot followed by a query/instruction
- Authorization: Only the PR author can trigger the bot (prevents unauthorized changes)
- Execution: Claude Code runs on the PR branch with the query as its prompt
- Result: Claude Code makes the requested changes and pushes a commit to the PR branch
- Feedback: The bot replies to the comment with a summary of what was done
Authentication
- Uses OAuth token authentication (
CLAUDE_CODE_OAUTH_TOKEN) for Pro/Max subscribers
- No API key required — usage counts against the subscriber's plan limits
- Token generated via
claude setup-token and stored as a GitHub Actions secret
Example Usage
@simili-bot Fix the issues mentioned by CodeRabbit above regarding error handling
@simili-bot Add unit tests for the new processEvent function
@simili-bot Refactor this function to use early returns as suggested
Technical Details
- New workflow file:
.github/workflows/claude-code.yml
- Uses
anthropic/claude-code-action@v1
- Triggered on
issue_comment events (PR comments are issue comments in GitHub API)
- Needs
contents: write, pull-requests: write, issues: write permissions
- Must filter to only run on PR comments (not issue comments)
- Must prevent feedback loops (skip bot-authored comments)
Checklist
Summary
Add a Claude Code GitHub Action that allows PR authors to request AI-assisted code fixes by commenting
@simili-bot <query>on a pull request. Claude Code will run in the context of the PR branch, perform the requested changes, and push a commit.Motivation
When a PR is opened, automated review tools (CodeRabbit, GitHub Copilot, etc.) often leave comments with suggested improvements or flagged issues. Currently, the PR author must manually address each suggestion. This feature allows the author to tag
@simili-botwith a natural language request, and Claude Code will automatically make the changes and commit them to the PR branch.Proposed Behavior
@simili-botfollowed by a query/instructionAuthentication
CLAUDE_CODE_OAUTH_TOKEN) for Pro/Max subscribersclaude setup-tokenand stored as a GitHub Actions secretExample Usage
Technical Details
.github/workflows/claude-code.ymlanthropic/claude-code-action@v1issue_commentevents (PR comments are issue comments in GitHub API)contents: write,pull-requests: write,issues: writepermissionsChecklist
.github/workflows/claude-code.ymlCLAUDE_CODE_OAUTH_TOKENas a repository secret