clab — AI Code Review Automation tool screenshot
AI Code Review Automation

clab: Best AI Code Review Automation for GitLab teams in 2026

7 min read·

clab turns GitLab merge request review into a local, deterministic Claude Code workflow that fetches diffs, runs rule checks, and posts inline comments without Node.js or third-party SaaS.

Pricing

Open-Source

Tech Stack

Go binaries, GitLab REST API, Claude Code skills, Cursor slash commands

Target

GitLab teams using Claude Code or Cursor for merge request review

Category

AI Code Review Automation

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

AttributeDetails
TypeAI Code Review Automation
Best ForGitLab teams using Claude Code or Cursor for merge request review
Language/StackGo binaries, GitLab REST API, Claude Code skills, Cursor slash commands
LicenseMIT
GitHub StarsN/A as of Feb 2026
PricingOpen-Source
Last ReleaseN/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 ingestionclab-fetch-diff pulls 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 passclab-lint-rules runs regex-based checks and emits findings to /tmp/gl_mr_auto_findings.json. The built-in rule set covers no-secrets, dead-code, todo-comment, and large-file with severity labels from critical to minor.
  • Inline GitLab discussionsclab-post-comments writes 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 synthesisclab-prepare-rules can 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

ToolBest ForKey DifferentiatorPricing
clabGitLab MR review with local AI + lint rulesClaude Code skill that fetches diffs, posts inline comments, and can generate project rules from past MRsOpen-Source
DangerConventional PR/MR policy checksMature rules-as-code workflow for CI-based review automationOpen-Source
reviewdogCI lint feedback on diffsBroad linter integration and annotation pipelines across many languagesOpen-Source
GitLab native MR discussionsTeams that want built-in review onlyZero extra tooling, but no custom AI pass or rule synthesisIncluded 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 api scope, 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.

Frequently Asked Questions

Looking for alternatives?

Compare clab with other AI Code Review Automation tools.

See Alternatives →

You Might Also Like