Skip to content

ci: reduce wasted turns in Claude Code review workflow#720

Merged
lklimek merged 3 commits into
v1.0-devfrom
fix/ci-review-workflow
Mar 10, 2026
Merged

ci: reduce wasted turns in Claude Code review workflow#720
lklimek merged 3 commits into
v1.0-devfrom
fix/ci-review-workflow

Conversation

@lklimek
Copy link
Copy Markdown
Contributor

@lklimek lklimek commented Mar 10, 2026

Summary

  • A1: Expose GH_TOKEN to the review step so the claudius MCP server can authenticate GitHub API calls (was causing permission-denied errors that stalled the entire review)
  • A2: Add missing Bash(git status/remote/merge-base) patterns to allowedTools; remove overly broad Bash(bash *) wildcard
  • A3: Inject PR context (number, repo, base/head branches, title) directly into the prompt — eliminates 3-5 wasted turns of the agent discovering what it's reviewing
  • A5: Disable MemCan tools (unavailable in CI) to prevent wasted MCP calls
  • Bonus: replace rigid "prefer MCP, never use gh CLI" with resilient "use MCP, fall back to gh CLI" guidance; instruct agent not to chain bash commands

Estimated savings: ~8-13 API turns per review session, plus fixing the MCP auth failure that was killing sessions entirely.

Test plan

  • Non-functional CI change — no manual test scenarios needed
  • Validate by applying claudius-review label to a test PR and confirming the review completes without permission errors

🤖 Co-authored by Claudius the Magnificent AI Agent

Summary by CodeRabbit

  • Chores
    • Enhanced automated code review workflow with improved PR context handling, including PR metadata integration.
    • Expanded tool configuration for more comprehensive automated review capabilities and optimized CI/CD reliability.

- Expose GH_TOKEN to MCP server for GitHub API authentication
- Inject PR context (number, branches, title) directly into prompt
- Disable MemCan tools unavailable in CI environment
- Add missing Bash patterns (git status/remote/merge-base) to allowedTools
- Remove overly broad Bash(bash *) wildcard from allowedTools
- Add MCP→gh CLI fallback guidance and no-chaining instruction

Saves ~8-13 API turns per review session and fixes MCP auth failures
that were preventing reviews from completing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 10, 2026

Warning

Rate limit exceeded

@lklimek has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 8 minutes and 14 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 12edce4c-3926-47b6-8f8a-0745112f8061

📥 Commits

Reviewing files that changed from the base of the PR and between 4bae236 and ac31c90.

📒 Files selected for processing (1)
  • .github/workflows/claude-code-review.yml
📝 Walkthrough

Walkthrough

The GitHub Actions workflow for Claude code review is updated with PR metadata context (PR number, repository, base/head branches, title), GH_TOKEN authentication configuration, adjusted tool usage guidance prioritizing GitHub MCP tools for API operations, and expanded allowedTools list including additional git and bash commands.

Changes

Cohort / File(s) Summary
Claude Code Review Workflow Configuration
.github/workflows/claude-code-review.yml
Added GH_TOKEN environment variable for authentication. Expanded prompt with PR metadata (number, repository, branches, title). Updated tool usage guidance to prioritize GitHub MCP for API operations. Expanded allowedTools list to include additional git commands (status, remote, merge-base) and related bash commands.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Suggested labels

claudius-review

Poem

A rabbit hops with glee and cheer, 🐰
Claude's workflow grows more clear,
With tokens and git commands in tow,
MCP tools steal the show!
Better reviews will now appear! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the main objective of the PR—optimizing the Claude Code review workflow by reducing unnecessary API turns and fixing authentication issues.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/ci-review-workflow

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

lklimek and others added 2 commits March 10, 2026 18:31
Add explicit mcp__plugin_claudius_github__get_me probe as the first
action in the review prompt. The result (available/unavailable) is
propagated to all sub-agent prompts so they never waste turns
rediscovering MCP status.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@lklimek lklimek merged commit f722b9e into v1.0-dev Mar 10, 2026
2 checks passed
@lklimek lklimek deleted the fix/ci-review-workflow branch March 10, 2026 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant