Stop reading diffs line by line. See what a merge request actually changes.
MR Behavior Lens reviews a GitLab merge request for you and answers the only question that matters: "what behavior did this change?" — in one screen:
- 🎯 TL;DR — one sentence per behavior group, so you know in 10 seconds what the MR does
- ⚠️ Concerns — possible bugs, regressions and edge cases worth checking before merge (severity
critical/warning/info), each postable to the MR as an inline comment with one click. When the change looks safe you get an explicit "✓ No concerns" - 🔀 Before/after diagram — a zoomable Mermaid diagram (🔴 flows that disappeared / 🟢 new flows) with clickable
[file:line]tags that jump straight to the diff on GitLab
Try it in 30 seconds with zero setup: run MR Lens: Demo Review (sample data) from the command palette.
Quick start
- Connect GitLab — run
MR Lens: Set GitLab Tokenand paste a personal access token (read_apiscope to review,apiif you also want to post comments). Self-hosted instance? SetmrLens.gitlab.url. - Pick an LLM — if you're signed in to GitHub Copilot (or an enterprise LM provider) it just works. Otherwise run
MR Lens: Set Anthropic API Key. - Review — open a workspace whose git remote points at your GitLab project, run
MR Lens: Review Merge Request…, and pick an MR.
That's it. The review panel opens with one tab per behavior group.
What makes it different
Most AI review tools dump a wall of text about your diff. MR Behavior Lens organizes the review around behavior: the diff is first grouped into behavior groups (clusters of files that together change one observable behavior), then each group is analyzed on its own — what the system did before, what it does after, and what could go wrong in between.
- Post reviews back to the MR — post a whole group review, or any single concern as an inline comment on the exact diff line, right from the panel. Nothing is ever sent to GitLab without showing you an editable preview first.
- Clickable everything — every
[file:line]in the summary, concerns, behavior changes or diagram opens that file's diff on the MR's Changes tab (or the local file, withmrLens.openLocationsIn: "workspace"). - Works with the LLM you already have — GitHub Copilot / VSCode LM API, or your own Anthropic API key.
- Self-hosted GitLab supported — point
mrLens.gitlab.urlat your instance.
Built to keep token costs low
Reviews are powered by an LLM, so they consume your Copilot quota or Anthropic credits — the extension is designed to keep that small and visible:
- Local pre-processing (0 tokens) — lockfiles, generated and binary files are filtered out before anything is sent
- Two-stage pipeline — a cheap model groups the diff; the main model only analyzes one group at a time
- Budget guard — anything estimated over
mrLens.tokenBudget(default 30k input tokens) asks first - Cache by diff hash — re-opening a review of an unchanged MR costs 0 tokens
- Usage dashboard —
MR Lens: Token Usageshows today / 7-day / all-time spend, per-MR
Commands
| Command | What it does |
|---|---|
MR Lens: Review Merge Request… |
Pick an MR from a list and open the review panel |
MR Lens: Demo Review (sample data) |
Try the review UI with bundled sample data — no setup needed |
MR Lens: Set GitLab Token |
Store your GitLab PAT in secret storage |
MR Lens: Set Anthropic API Key |
Store your Anthropic API key in secret storage |
MR Lens: Select LLM Model… |
Pick models for the classify/analyze stages from the active provider |
MR Lens: Token Usage |
Open the token usage dashboard |
MR Lens: Clear Review Cache |
Clear cached review results |
Settings
| Setting | Default | Meaning |
|---|---|---|
mrLens.gitlab.url |
https://gitlab.com |
GitLab instance base URL (self-hosted / enterprise supported) |
mrLens.gitlab.token |
empty | GitLab PAT via settings — overrides secret storage. ⚠️ Plain text; prefer the Set GitLab Token command |
mrLens.gitlab.projectId |
empty | Project ID or URL-encoded path. Empty = derived from the workspace git remote |
mrLens.provider |
auto |
auto = try VSCode LM (Copilot/enterprise) first, fall back to Anthropic API key |
mrLens.model.classify / analyze |
empty | Per-stage model override — easiest to set via MR Lens: Select LLM Model… |
mrLens.openLocationsIn |
mr |
Where [file:line] clicks go: the MR's Changes tab on GitLab, or the local workspace file |
mrLens.tokenBudget |
30000 |
Input-token estimate above which the extension asks for confirmation |
mrLens.maxGroups |
5 |
Max behavior groups analyzed per MR |
mrLens.contextBytesPerGroup |
4096 |
Cap on extra LSP context per group |