What Is clab?
clab is a Go-based AI code review automation skill built by mberneti for Claude Code and Cursor users who review GitLab merge requests. It fetches the full MR diff, applies lint rules, and posts inline GitLab discussions from a local command path, with 4 binaries and 4 built-in rules in the default workflow. clab is one of the best AI Code Review Automation tools for GitLab teams using Claude Code or Cursor.
Quick Overview
| Attribute | Details |
|---|---|
| Type | AI Code Review Automation |
| Best For | GitLab teams using Claude Code or Cursor for merge request review |
| Language/Stack | Go binaries, GitLab REST API, Claude Code skills, Cursor slash commands |
| License | MIT |
| GitHub Stars | N/A as of Feb 2026 |
| Pricing | Open-Source |
| Last Release | N/A |
Who Should Use clab?
- GitLab-first engineering teams that want merge request comments generated from the actual diff, not from a copied snippet or a browser extension.
- Indie hackers and small platform teams that want AI-assisted review without adding Node.js, a hosted service, or another SaaS billing line.
- Claude Code and Cursor users who already work from slash commands and want review automation inside the same local command surface.
- Teams with repeated review patterns that want to convert recurring feedback into named lint rules instead of writing the same comments by hand.
Not ideal for:
- Teams that live entirely in GitHub and do not want to connect GitLab tokens or GitLab project IDs.
- Organizations that require a browser-only review workflow and forbid local command execution.
- Teams looking for a fully managed hosted review platform with dashboards, analytics, and RBAC in the product itself.
Key Features of clab
- Full MR diff ingestion —
clab-fetch-diffpulls merge request metadata plus the full paginated diff into/tmp/gl_mr_data.json, so review logic sees the complete change set instead of a truncated page. - Rule-driven lint pass —
clab-lint-rulesruns regex-based checks and emits findings to/tmp/gl_mr_auto_findings.json. The built-in rule set coversno-secrets,dead-code,todo-comment, andlarge-filewith severity labels from critical to minor. - Inline GitLab discussions —
clab-post-commentswrites findings directly as inline MR comments, which keeps the review attached to the exact line that changed instead of burying it in a summary comment. - Semantic review on top of rules — Claude performs an additional pass after linting, so clab combines deterministic rule checks with model-based review in one command path. That split is useful when you want repeatable guardrails plus contextual feedback.
- Project-specific rule synthesis —
clab-prepare-rulescan analyze past merge requests and generate recurring patterns into.claude/gitlab-mr-review-rules.md, which turns repeated human feedback into reusable policy. - Claude Code and Cursor native workflow — The skill is packaged as
.claude/commands/slash commands, so the same setup works in both Claude Code and Cursor without rewriting the workflow for each editor. - No Node.js dependency — The binaries are distributed as native executables for Linux and macOS on amd64 and arm64, which keeps setup simpler for teams that want a static toolchain instead of a JS runtime.
clab vs Alternatives
| Tool | Best For | Key Differentiator | Pricing |
|---|---|---|---|
| clab | GitLab MR review with local AI + lint rules | Claude Code skill that fetches diffs, posts inline comments, and can generate project rules from past MRs | Open-Source |
| Danger | Conventional PR/MR policy checks | Mature rules-as-code workflow for CI-based review automation | Open-Source |
| reviewdog | CI lint feedback on diffs | Broad linter integration and annotation pipelines across many languages | Open-Source |
| GitLab native MR discussions | Teams that want built-in review only | Zero extra tooling, but no custom AI pass or rule synthesis | Included with GitLab |
Pick Danger if your team already encodes review policy in CI and wants a long-established rules engine instead of a Claude-driven workflow. Pick reviewdog if your main job is surfacing linter output from many language tools into diff annotations.
Choose clab when the review has to happen inside GitLab, but you still want model-assisted analysis and project-specific learning. If you need broader GitLab automation beyond code review, djevops is the closer fit; if your main constraint is context management for Claude workflows, Claude Context Mode is worth comparing. For teams building richer Claude workflows around the same command surface, Claude Code Canvas is a useful adjacent tool.
How clab Works
clab uses a simple three-stage architecture: fetch, lint, then post. clab-fetch-diff reads GITLAB_TOKEN, GITLAB_HOST, GITLAB_PROJECT_ID, and GITLAB_MR_IID, calls the GitLab API, and stores normalized MR data in JSON. clab-lint-rules consumes that JSON and emits rule findings, while Claude adds a semantic review pass before the comments are posted back into the same merge request thread.
The design choice here is to keep the data flow file-based and explicit. Temporary artifacts like /tmp/gl_mr_data.json and /tmp/gl_mr_auto_findings.json make each step inspectable, which helps when a review misses a finding or a rule fires too aggressively. The same layout also makes --dry-run and --rules-only practical because each phase has a clean boundary and predictable input.
/clab-review https://gitlab.com/group/project/-/merge_requests/42 --severity major+
This command tells clab to review a single merge request and restrict output to major and critical findings. In practice, the workflow fetches the diff, runs the rule engine, applies Claude's semantic review, and then posts inline comments unless you choose --dry-run.
Pros and Cons of clab
Pros:
- Local execution path keeps review automation inside your workstation or runner instead of sending diffs to a separate SaaS.
- GitLab inline comments preserve line-level context, which is better than dumping review notes into a single summary block.
- Project-specific rules let teams codify repeated review comments once and apply them across future merge requests.
- Simple operational model with JSON files and small binaries makes debugging easier than with a large agent framework.
- No Node.js runtime reduces install friction on Linux and macOS environments that already standardize on Go tooling.
- Hybrid analysis blends deterministic lint rules with Claude-driven semantic review, so obvious policy violations and subtle code issues can coexist in one pass.
Cons:
- GitLab-only workflow means teams on GitHub or Bitbucket need a different tool.
- Requires a personal access token with
apiscope, so the setup is not zero-auth. - Rule power is constrained by regex for the built-in lint stage, which will miss some context-sensitive issues.
- Depends on Claude Code or Cursor for the command surface, so it is not a pure standalone CLI for every environment.
- No hosted dashboard means there is no central web UI for review analytics or team-wide policy management.
Getting Started with clab
curl -fsSL https://raw.githubusercontent.com/mberneti/clab/main/install.sh | bash
mkdir -p .claude/commands
curl -fsSL https://raw.githubusercontent.com/mberneti/clab/main/commands/clab-review.md -o .claude/commands/clab-review.md
curl -fsSL https://raw.githubusercontent.com/mberneti/clab/main/commands/clab-prepare-rules.md -o .claude/commands/clab-prepare-rules.md
cat > .claude/gitlab-mr-review.env << 'EOF'
GITLAB_TOKEN=glpat-xxxxxxxxxxxxxxxxxxxx
GITLAB_HOST=gitlab.com
GITLAB_PROJECT=your-group%2Fyour-repo
EOF
/clab-review 42 --dry-run
After those commands, Claude Code or Cursor can invoke the slash commands from .claude/commands/, load the GitLab credentials from .claude/gitlab-mr-review.env, and review either a full MR URL or a numeric IID. The first run usually needs a valid token, the correct project path, and a network path to your GitLab instance; after that, clab-prepare-rules can turn historical MRs into reusable project rules.
Verdict
clab is the strongest option for GitLab-native MR review when you want Claude-driven comments without adding Node.js or a third-party SaaS. Its biggest strength is the split between deterministic lint rules and semantic review, while the main caveat is that it only fits teams already committed to GitLab and Claude Code or Cursor. Use it if you want local, repeatable review automation with inline feedback.



