Titouan Mathis

CTO at Studio Meta and ikko

Adding GitLab merge request links to Claude Code status line

15/09/2026 in #claude-code #gitlab #dotfiles

We use GitLab at ikko.fr to host most of our client projects and I was missing the useful link to a PR that Claude Code displays for GitHub repositories. So I wanted to update its status line to display a similar link for GitLab.

The Bash script for this is simple, we get the merge request URL with glab CLI and jq and then wrap the merge request IID in an OSC 8 hyperlink.

mr=$(glab mr view --output json | jq -r 'select(.web_url) | "\(.iid)\t\(.web_url)"')
IFS=$'\t' read -r mr_iid mr_url <<< "$mr"
printf '\033]8;;%s\007!%s\033]8;;\007' "$mr_url" "$mr_iid"

Display was working fine, but the link was not detected and not clickable. I found the solution in a Github issue thread: for links in the status line to be detected and clickable, you have to set FORCE_HYPERLINK=1 in the Claude Code environment. This can added directly in ~/.claude/settings.json.

{
  "env": {
    "FORCE_HYPERLINK": "1"
  }
}

My status line now display something like the following for GitLab projects and I can quickly open the merge request in GitLab by clicking on its number.

~/gitlab.example.com/acme/widget (feat/login) !42
↑0 ↓0 R0 W0 0%/1.0M claude-fable-5-1 (medium)