Bible Network Crypto DeFi Onchain RWA AI Agent Stablecoin Chain SAFU CryptoTax DeFAI AGI Claude Me Claude Skill Claude Design Claude Cowork
Independent Media
Not affiliated with any project
Exploring the Frontier of AI Intelligence
claude-me.com
LATEST
Claude Code's --worktree Now Accepts a GitLab Merge Request URL Directly, No Number Conversion Needed  ·  Claude Code Remote Control Now Streams Live: Every Foreground Subagent Tool Call, Visible on Your Phone  ·  Claude Code Adds PreModelSwitch/PostModelSwitch Hooks: Switching Models Can Finally Be Intercepted and Logged  ·  Claude Code's New /design Skill: Turn a Screenshot or an Idea Into an Editable Interface  ·  Claude Code's Auto Mode Became the Default on 8/14, and Its Rules Are Now Written as Plain Sentences  ·  Claude Code's New Feature: It Drafts Its Own Feedback Report When Something Goes Wrong, and You Decide Whether to Send It
practice

Claude Code's --worktree Now Accepts a GitLab Merge Request URL Directly, No Number Conversion Needed

30-Second Version · For the impatient
One fewer step of "look up the number, then manually assemble the format" sounds small, but if you're opening several worktrees a day for different MRs, that's a repetitive annoyance you no longer have to deal with.

Full Explanation +
01 · Why did this happen?

Does this change alter worktree's own behavior, or only the way input is given?

Only the input method changed — once a worktree is created, its behavior is exactly the same as before. Whether you paste a plain number with #, a GitHub pull request URL, or a GitLab merge request URL, Claude Code parses out the same core piece of information in the end — which numbered change request this is — and then follows the same logic to fetch the corresponding head commit from your repository's origin remote, creating it under the same directory-naming convention (.claude/worktrees/pr-<number>).

In other words, this update solves the input-layer problem of "what format do you use to tell Claude Code which change you want," not the core logic of how worktrees are created, isolated, and managed — that whole mechanism is unchanged before and after this update.

02 · What is the mechanism?

Why does a small change like "support more input formats" deserve a dedicated write-up?

Looking at this one feature in isolation, it really is just saving one manual conversion step, with a fairly narrow impact. But it reflects a broader pattern: many of Claude Code's features were originally designed with GitHub as the default target, and GitLab support tends to arrive later as a follow-up — that ordering often means GitLab users have to take an extra detour on certain details compared to GitHub users, even when a feature technically exists for both.

This update to --worktree closes that specific gap — GitLab users can now use this feature in exactly the same way as GitHub users (paste the URL directly), without doing any format conversion in their head. For a team with people on both platforms, this kind of "input parity" arguably matters more than the value of the single feature itself, because what it reduces is the internal communication cost that arises from different tooling habits within the same team.

03 · How does it affect me?

Once you paste the URL, how does Claude Code actually fetch the corresponding change? Do I need to configure anything for this?

No extra configuration is needed — the whole fetching process is automatic. Claude Code only reads the number out of the URL; when actually fetching the change's content, it always goes through your repository's already-configured origin remote, rather than connecting to whatever domain appears in the URL you pasted. That means even if the URL you copied doesn't exactly match your repository's actual remote configuration, as long as the number is correct, the fetch still succeeds — because the system trusts the origin configuration, not the domain in the URL itself.

The fetch path is determined automatically based on the host type origin points to: for GitHub Enterprise, a self-hosted GitLab instance, or any other host type, the system tries the path pull/<number>/head first, and falls back to merge-requests/<number>/head if that fails. This "try one, fall back to the other" mechanism was added specifically in this update — before 2.1.233, the system always tried only the single path pull/<number>/head.

04 · What should I do?

If my team uses both GitHub and GitLab, how should we actually adjust team workflow habits to take advantage of this update?

The most direct adjustment is no longer needing to maintain two separate sets of instructions for "how to tell Claude Code which change to work on" across the two platforms. Previously, you might have had to specifically tell GitLab users to "first find the number on the MR page, then use # plus that number" as an extra step. Now it can be unified into one sentence: "paste the MR or PR URL directly into --worktree" — no need to distinguish which platform the other person is on.

A more granular detail: if your team runs a self-hosted GitLab or GitHub Enterprise instance, the system tries pull/<number>/head first and falls back to merge-requests/<number>/head only if that fails. If your self-hosted environment has unusual path-naming logic — say, it sits behind a reverse proxy or has a customized API path — and you run into a fetch failure, it's worth first confirming whether neither of these two standard paths matches your environment, rather than immediately assuming --worktree itself is broken.

Full Content +

Claude Code version 2.1.233 (part of the August 2026 update sequence) added a small but genuinely useful change to --worktree: you can now paste a GitLab merge request URL directly, with no need to look up the corresponding number yourself or manually convert the format first. This piece covers exactly how this works and how it differs from the old behavior.

What Worktree Was Solving in the First Place

--worktree lets you create an independent checkout for a specific branch without touching your main working directory. A common scenario: you're in the middle of working on a feature branch, and you suddenly need to look at a PR or MR without wanting to interrupt what you're doing, and without wanting to stash your current uncommitted changes. With a worktree, you can open a separate directory and have Claude Code handle that other thing there, with neither side interfering with the other.

Before 2.1.233: Only Numbers or GitHub URLs

Before this update, --worktree only accepted two kinds of input: a number prefixed with # (like #123), or a GitHub-style pull request URL. If your project used GitLab and you wanted to handle a merge request through a worktree, you had to first go find the corresponding number on the MR page yourself, then manually assemble the #-plus-number format to paste into Claude Code — one extra conversion step, and if a team had some people on GitHub and others on GitLab, this asymmetry in input format could easily cause confusion.

After 2.1.233: Paste a GitLab MR URL Directly

Now you can paste a full URL like https://gitlab.com/group/repo/-/merge_requests/123 directly into --worktree, and Claude Code parses the number out of the URL on its own — no conversion needed beforehand. When actually fetching the change's content, Claude Code always fetches that change's head commit from your repository's origin remote, choosing the fetch path based on the host type origin points to. For GitHub or a self-hosted GitLab instance, it tries pull/<number>/head first, then falls back to merge-requests/<number>/head if that fails. The resulting worktree is always stored at .claude/worktrees/pr-<number> — whether you paste a GitHub URL, a GitLab URL, or just a plain number, the resulting directory-naming logic is consistent.

Details Worth Knowing When You Use This

Because the # character gets treated as the start of a comment in most shell environments, if you're using the plain-number-plus-# format directly (like #123), remember to wrap the entire argument in quotes — otherwise the shell may silently drop everything after the #. Also, since a worktree is essentially a fresh checkout, untracked files in your main working directory — local config files like .env or .env.local — won't automatically appear in the newly created worktree. If your task needs them, you'll need to copy them over manually.

Sources: Run parallel sessions with worktrees - Claude Code Docs
Diagram
--worktree 從輸入到抓取路徑三種輸入(數字/GitHub 網址/GitLab 網址)都會被解析出編號,再依 origin 主機類型嘗試 pull/head 或 merge-requests/head,最終存放路徑命名一致--worktree Input to Fetch Path#123plain numberGitHub PR URLpre-existing supportGitLab MR URLnew in 2.1.233Parse number,fetch from origintry pull/<n>/headfallback merge-requests/<n>/head.claude/worktrees/pr-<number>Same naming, all inputsClaude Me · claude-me.com
Feel free to share. Please credit the source.
Ask a Question
Please enter at least 10 characters
Related Terms
Related Articles
Claude Code's Auto Mode Became the Default on 8/14, and Its Rules Are Now Written as Plain Sentences
practice · Sep 01
How to Schedule Recurring Tasks in Claude: A Practical Guide to Morning Briefs and Weekly Reports
practice · Aug 28
How to Set Up Agent Permissions Safely: A Practical Breakdown from Claude Code to MCP
practice · Aug 28
Why Your Claude Code Bill Keeps Growing: 3 Habits That Cut Token Cost in Half for the Same Task
practice · Aug 23
Related News
More Related Topics