Review-flow: Automate 80% of code reviews using Claude Code and Model Context Protocol
Review-flow is an open-source server that automates code review pipelines on GitHub and GitLab. It utilizes Claude Code background sessions and a dedicated Model Context Protocol server to execute structured multi-agent audits.
Impact: High
Why it matters
Self-host Review-flow to automate repetitive code quality, architecture, and security reviews directly within your merge requests.
TL;DR
- 01Runs multi-agent reviews (SOLID, Testing, DDD) asynchronously on GitHub and GitLab.
- 02Uses isolated Git worktrees and a memory guard capped at 4 GB RSS for stability.
- 03Leverages typed MCP commands instead of text parsing to manage Git thread state safely.
Key facts
- Max RSS Memory
- 4 GB
- Hard Timeout
- 15 minutes
- Default Concurrency Limit
- 2 parallel reviews
Background Process Orchestration
Review-flow replaces interactive CLI loops with detached background sessions. When a webhook triggers, the server spawns a background worker via claude --bg and immediately returns. Completion of the review is detected via a three-way race condition with first-wins semantics: 1. The MCP skill calls set_phase('completed') on the local server. 2. Polling claude agents --json every 30 seconds shows completion. 3. A hard backstop timeout of 15 minutes is reached.
Once completed, the report is read from the isolated worktree directory (.claude/reviews/report-<mrNumber>.md) and posted to the Git platform. The session is closed using claude stop && claude rm.
Self-Hosted Infrastructure Specifications
Review-flow enforces system safety and cost controls locally:
- Memory Guard: Automatically terminates running review sessions if the RSS memory consumption exceeds 4 GB.
- Concurrency Control: Limits parallel reviews (default is capped at 2 parallel tasks).
- Billing Limits: Tracks monthly token usage from transcripts to block execution if budgets are exceeded.
- Worktree Lifecycle: Runs daily sweeps to prune worktrees of closed MRs older than 24 hours or with modification times exceeding 7 days.
Try it in 2 minutes
reviewflow init --yesbash
✓ When to use
- When managing high-velocity teams looking to offload basic architectural and quality checks directly inside merge requests.
✕ When NOT to use
- When security policies strictly forbid running self-hosted web servers connected to third-party LLM providers.
- When your team lacks a dedicated server environment capable of running background Node.js processes.
What to do today
- Initialize Review-flow locally by running `reviewflow init --yes` in your terminal.
- Configure webhooks on your GitLab/GitHub projects pointing to your self-hosted Review-flow instance.
Sources