gitlab

Reviewed at commit 7f629b4 New version, not yet reviewed

Sends data to GitLab (gitlab.com, or the self-managed GitLab host of your git remote) through your glab login

GitLab workflow best practices and glab CLI usage

Made by
Ben Drucker
What we checked

Shows the current branch's merge request pipeline and approval state in the prompt footer and an /mr pane by polling GitLab through your glab login. It messages Claude on its own when a job fails, a conflict appears, or someone approves or comments, and blocks WebFetch of GitLab pages and common gh/glab mistakes. Its skills watch CI, post review comments and approvals, and merge MRs, with glab commands pre-approved.

Review details

Static review of the source at the pinned commit; not run. The diff since f8936be rewrites most of the plugin (83 files, about 5,800 lines added), so the whole plugin was reviewed again from the full bundle. Read in full: plugin.json, package.json, hooks.json, mod/register.ts, mod/pane.tsx, hooks/lint.ts, hooks/auth.ts, hooks/hook-input.ts, hooks/command-segments.ts (a shell-word parser with no I/O), scripts/fetch.ts, scripts/merge.ts, skills/ci-monitor/scripts/watch.ts, skills/merge-request/scripts/discussions.ts, draft-note.ts, review-queue.ts and reviewers.ts, plus the agent and skill frontmatter and the commands the skill Markdown gives Claude; mod/mr.ts (pure parsing and decision logic, no I/O) was read by targeted search for its message texts; the test files were skipped (not loaded by the plugin). The function-hook module registers session.start, session.end, ui.render (PromptHint footer and the new /mr Pane), command.run for the /mr command it registers with $.command.register, ui.press (refresh and muted-list toggle), turn.start and turn.complete (to tell its own notes from the person's and to wake the poller). Only in interactive sessions with glab on PATH and the watch option on (default true, disclosed in userConfig and the README) it ticks every minute via $.clock.every and polls with $.process.run: git rev-parse, git symbolic-ref, glab mr view, glab api GETs for approvals, notes, discussions, pipeline jobs and the current user, and two read-only glab api graphql queries for reviewer state and merge-train/auto-merge state; polls back off from 1 minute up to 2 hours while nothing changes, and the backoff count is kept per MR URL in $.state. On a merge, close, conflict, required rebase, foreign push, newly failed job, request for changes, left merge train, or another person's approval or comment it calls $.prompt.submit with a fixed message (MR number, URL, short SHA, target branch, job names cut to 80 characters, commenter usernames and comment counts, never comment bodies), which starts a Claude turn without the user typing and uses tokens; the conflict and behind messages tell Claude to update or rebase, resolve and push (Claude still asks for those commands under normal permissions); on an MR someone else opened only merge, close and foreign push are sent. Bot chatter can be muted with the ignore and ignoreBody options. Every decision is logged through the declared mod-events dependency ($.modEvents.emit). Shell hooks (run with bun): PreToolUse WebFetch (fetch.ts) now checks gitlab.com and any gitlab.* host, denying issue, MR, pipeline, job, file, tree and repo URLs with a glab suggestion and asking for other URLs on those hosts; PreToolUse Bash for glab and gh (lint.ts) denies glab --jq/--json on api, escaped-dollar GraphQL, two non-existent mutations, @file arguments glab would post literally, and gh pr/issue on a GitLab origin (it reads .git/config walking up from the cwd), and once per session adds context nudging the merge-request skill or the CI watcher, writing empty marker files under /tmp/claude/gitlab-skill; PostToolUse and PostToolUseFailure on glab (auth.ts) add a hint on an expired token suggesting glab auth login with dangerouslyDisableSandbox. The merge-request skill runs a bang line on load that creates the same /tmp marker and pre-approves Bash(glab mr:*), Bash(glab api:*) and its own bun scripts, so while it is loaded Claude can create, merge, approve and comment on MRs and call any GitLab API endpoint (including the documented DELETE calls for blocks and stuck merge-train entries) without asking; its scripts create and publish draft notes, approve with an optional SHA check, list discussions and the review queue, and merge via glab mr merge with an explicit --auto-merge flag, and merge.ts runs git fetch. The ci-monitor skill pre-approves Bash(bun:*), which covers any bun command, plus glab ci, glab api, glab mr view, git remote and jq, and runs watch.ts under Monitor; watch.ts now calls glab and git through execFileSync with argument arrays (no shell), read-only. The haiku logs agent writes failing job traces to $TMPDIR/<session>/gitlab. No unpinned packages are run. Not reviewed: the glab CLI, the declared git and mod-events plugins, and the npm dependencies cleye, table, url-pattern and zod (the agent SDK is types only); the repository README says bun auto-installs missing dependencies on first run.

What it uses
  • Reads your prompts: no
  • Sees tool calls: yes
  • Blocks or changes tool calls: yes
  • Reads or writes files: yes
  • Runs programs on your machine: yes
  • Calls the model (uses tokens): yes
  • Sends data over the network: yes
  • Stores data: yes
  • Shows something on screen: yes
Hooked events
Made this mod? Add a badge to your README

modsforClaude badge for gitlab

Paste this into your README. The badge says reviewed once the current version has been reviewed, and links readers to this page.

[![Listed on modsforClaude](https://modsforclaude.com/badge/gitlab.svg)](https://modsforclaude.com/mods/gitlab/)

← All mods