
Your GitLab MR Gets Its Own Claude Code Session: Pass a Merge Request URL to --worktree
Chris Harper
2 min read
Sep 1, 2026 · 04:05 UTC
TL;DR: Since v2.1.233, pass a GitLab MR URL to --worktree and Claude Code opens the session on the MR branch in its own worktree; the claude agents view labels that session !N for quick identification.
Teams on GitLab have been manually checking out branches and creating directories for each MR review session. Since v2.1.232–v2.1.233, this is a one-command operation.
Branching from a merge request:
claude --worktree https://gitlab.com/group/project/-/merge_requests/42
Claude Code fetches merge-requests/42/head, branches from it, and opens the session in a dedicated worktree. Your main checkout stays untouched. The claude agents view labels MR-linked sessions !N so you can tell at a glance which session is reviewing which MR.
The footer MR badge. Authenticate glab once (glab auth login), and on any branch with an open GitLab MR, the footer shows a colored badge — green for open, orange for draft, a checkmark when mergeable. It updates without any command.
Other GitLab additions landing in the same release:
- Plugin marketplaces clone bare
gitlab.comURLs including nested subgroups - GitLab token families (
glpat-,glrt-) are now redacted in logs and transcripts glabCLI's config store is protected the same waygh's is
The real limit: --worktree gives you a session on the MR branch — it does not post review comments back to GitLab. For automated MR feedback, you still need glab CLI commands or a CI pipeline that calls the GitLab API. The session reads the code; what you do next with Claude's output is up to you.
Sources: Week 33 — Claude Code Docs · How We Automated Our GitLab PR Review Workflow with Claude Code — Medium · Claude Code and GitLab: Three Workflows That Ship — GitLab Blog · Claude Code 2.1.233 GitLab support — AI/TLDR