Stop Getting Roasted in PR Review (CodeRabbit, Locally)
By Jack Herrington
Key Concepts
- Agentic Coding: A development paradigm where AI agents assist in writing, refactoring, and reviewing code.
- CodeRabbit: An AI-powered code review tool that analyzes pull requests (PRs) for vulnerabilities, logic errors, and architectural issues.
- CLI (Command Line Interface): The interface used to run CodeRabbit locally, allowing for pre-PR code analysis.
- Git Diff: The comparison between two versions of code, used here to identify changes that might introduce bugs.
- Agentic IDEs: Development environments (like Cursor or VS Code) that integrate AI agents to automate coding tasks.
1. Main Topics and Challenges
The speaker, a maintainer of the TanStack libraries, highlights two primary professional weaknesses:
- Writing Specs: The speaker prefers writing code directly rather than formalizing specifications beforehand.
- Code Reviews: Difficulty in identifying potential vulnerabilities or system-wide impacts by manually reviewing
git diffs. Given that TanStack libraries serve hundreds of thousands of developers, the risk of pushing flawed code is significant.
2. The Role of CodeRabbit
CodeRabbit serves as an automated safety net. It performs deep analysis on PRs, providing:
- Detailed Analysis: Explanations of why a specific change is problematic.
- Visual Aids: Sequence diagrams to illustrate logic flows.
- Actionable AI Prompts: Pre-generated prompts that users can copy and paste to have an AI agent automatically fix the identified issues.
3. Integration Methodologies
The speaker demonstrates three ways to shift CodeRabbit from a post-PR check to a proactive development tool:
A. CLI Integration (Claude Code)
- Installation: Install via
curlorHomebrew, then authenticate usingcoderabbit login. - Usage: Within the Claude Code environment, install the CodeRabbit plugin (
plugin install coderabbit). - Workflow: Run
coderabbit reviewto analyze uncommitted changes. The process is asynchronous, allowing the developer to background the task (Ctrl+B) while continuing other work.
B. IDE Extension (Cursor/VS Code)
- Installation: Search for "CodeRabbit" in the extensions panel and authenticate.
- Workflow: A dedicated side panel displays potential issues. Developers can click on specific issues to view details and choose to "Fix with AI" directly within the editor.
C. Agentic Rules Integration (Advanced)
- Methodology: Add a custom rule to the IDE’s agent settings (e.g., Cursor’s
.cursorrulesor settings). - Process: By instructing the agent that "CodeRabbit is installed" and to "run it on changes as they occur," the agent automatically validates its own work.
- Benefit: This allows the use of "lower-end" or "auto" models to produce high-quality code, as the agent is forced to self-correct based on CodeRabbit’s feedback before presenting the final result to the developer.
4. Key Arguments and Perspectives
- Shift-Left Security: The speaker argues that waiting for a PR review is too late. Integrating AI reviews into the development loop (pre-PR) increases productivity and reduces the risk of shipping critical bugs.
- Trust in Automation: The speaker notes that in every instance where they used the AI-generated fix suggested by CodeRabbit, the agent correctly identified and resolved the issue.
- Productivity: By automating the "drudgery" of manual code reviews, developers can focus on higher-leverage tasks.
5. Notable Quotes
- "I kind of write code as my spec and I always have." — The speaker on their personal coding style.
- "Good things take time." — Regarding the depth of the CodeRabbit analysis process.
- "I only ever do [sponsorships] if I actually use the product on a day-to-day basis." — The speaker’s criteria for endorsing tools.
6. Synthesis and Conclusion
The video demonstrates that AI-driven code review is no longer just a final gatekeeper for pull requests but a continuous, integrated part of the development lifecycle. By utilizing the CodeRabbit CLI and integrating it into agentic IDEs like Cursor, developers can catch critical vulnerabilities in real-time. This approach effectively mitigates the risks associated with manual code reviews and allows developers to maintain high standards of code quality even when working at scale.
Chat with this Video
AI-PoweredLoad the transcript when you're ready to chat so the initial page stays lighter.