Code Review
Run AI code review with Claude, Codex, and other agents — single or multi-agent passes over a diff, with custom reviewers and configurable workflows.
Overview#
Agentastic includes integrated code review powered by AI agents. Review your changes before committing or get suggestions on existing code. Multiple agents can run in parallel, each providing a different perspective.
Supported Agents#
Claude Code#
Anthropic's Claude provides intelligent code review with deep understanding of code patterns and best practices.
Command: claude "$(cat 'prompt_file')"
Requirements:
- Claude Code CLI installed (
npm install -g @anthropic-ai/claude-code) - Anthropic API key configured
Codex#
OpenAI's Codex agent for code analysis and suggestions.
Command: codex review "$(cat 'prompt_file')"
Requirements:
- Codex CLI installed
- OpenAI API key configured
CodeRabbit#
CodeRabbit integration for automated PR reviews and code quality checks.
Command: coderabbit review
Requirements:
- CodeRabbit CLI installed
- CodeRabbit account connected
Greptile#
Greptile runs a full review on your local branch diff with whole-codebase context — severity-rated findings, suggested fixes, and a PR summary, identical to its GitHub/GitLab reviews.
Command: greptile review --agent
Requirements:
- Greptile CLI installed (
curl -fsSL https://greptile.com/cli/install | bash) - Greptile account connected (
greptile login)
Cursor Agent#
Cursor's AI agent for code review. Supports sandbox control (--sandbox enabled|disabled) and cloud offloading (--cloud).
Command: agent --model auto --print "$(cat 'prompt_file')"
Using Code Review#
Review Current Changes#
- Click the Code Review button in the toolbar
- Select which agent(s) to use (or use your defaults from Settings)
- The agent runs in a new terminal tab
- Review the feedback in the terminal output
From the Toolbar#
- Click - Run review with enabled agents from Settings
- Hold/Menu - Select specific agent(s) to use
From Your iPhone#
With the Companion paired, open a worktree on the phone and tap Review, or long-press it and choose Review Changes…. The sheet offers the same two choices as the toolbar button: Review Diff with your enabled reviewers, or one specific reviewer. The review runs on the Mac with the prompt and reviewers configured here, and starts in the background without changing what the Mac's window shows.
What Gets Reviewed#
The Review Diff action prompt includes:
- Current branch vs target branch comparison
- Complete unified diff of all changes
- Commit history between branches
- Review criteria prioritization
Customize this prompt in Settings > Tasks. The built-in template uses {currentBranch}, {targetBranch}, {diff}, and {commitHistory}, but all Actions placeholders are available if you customize it. See the Actions placeholder reference.
Review Criteria#
Agents are prompted to prioritize:
- Bugs - Logic errors, edge cases, null handling
- Security - Vulnerabilities, input validation, secrets
- Performance - Inefficiencies, memory leaks, N+1 queries
- Maintainability - Code clarity, documentation, patterns
- Testing - Test coverage, test quality
Multi-Agent Reviews#
Enable multiple agents to get diverse perspectives:
- Go to Settings > Code Review
- Enable the agents you want to use
- Click Review - all enabled agents run in parallel
- Each agent opens in its own terminal tab
Different agents catch different issues:
- Claude excels at understanding intent and architecture
- Codex focuses on code patterns and best practices
- CodeRabbit specializes in PR-specific feedback
- Greptile reviews the branch diff with full-codebase context
Adding Custom Agents#
Add your own review agents to integrate team tools or alternative AI services.
Configuration#
- Go to Settings > Code Review
- Scroll to Custom Agents
- Click Add Agent
- Enter:
- Name: Display name for the agent
- Command: Shell command to execute
Command Template#
Use {prompt} as a placeholder for the review prompt:
my-agent review --prompt "{prompt}"If {prompt} is not in your command, the prompt is passed via a temporary file:
my-agent "$(cat 'prompt_file')"Examples#
Local LLM with Ollama:
ollama run codellama "$(cat 'prompt_file')"Custom script:
./scripts/review.sh "{prompt}"Team review tool:
team-reviewer --format=terminal "{prompt}"Configuration#
Use Settings > Tasks for the primary Review Diff prompt, model, and execution target. Use Settings > Code Review to select any additional reviewers that should receive the same captured review prompt.
| Setting | Description |
|---|---|
| Review Diff action | Primary prompt, model, and execution target; configured in Tasks |
| Enabled Agents | Toggle additional built-in reviewers |
| Custom Agents | Add your own review commands |
Review Workflow#
A typical review workflow:
- Make your code changes
- View changes in the Diff Viewer
- Click Review to get AI feedback
- Address suggestions
- Commit when satisfied
Tips#
- Review smaller changes for more focused feedback
- Use multiple agents for diverse perspectives
- Custom agents can integrate with your team's tools
- Combine AI review with human review for best results
- Check the terminal for detailed feedback and suggestions