Claude Code skills and hooks for working with GitLab via the glab CLI.
This repo has four skills covering common GitLab operations: auth, merge requests, issues, and CI pipelines. It also includes glab-auth-guard.sh, a PostToolUse hook that detects authentication errors in glab output and prompts you to log in, and a settings.local.json with pre-approved glab command permissions so Claude does not ask for confirmation on every call. 224 commands are documented across docs/commands.md and docs/reference.md.
glabCLI installed- Claude Code installed
macOS:
brew install glabWindows (winget):
winget install GitLab.GLabWindows (scoop):
scoop install glabLinux (apt):
sudo apt install glabLinux (snap):
sudo snap install glabVerify the install:
glab --versionYou must authenticate before any glab command will work.
glab auth loginFor a self-managed GitLab instance:
glab auth login --hostname gitlab.example.comCheck your current auth status:
glab auth statusThe glab-auth-guard.sh hook runs after every Bash tool call. When it detects an authentication error in glab output, it tells Claude to prompt you to run glab auth login.
Run these three commands inside any Claude Code session:
/plugin marketplace add moumine9/glab-skills
/plugin install glab-skills
/reload-plugins
Pick a scope when prompted. User is the one you want most of the time — it's available in every project. Project drops the plugin into .claude/plugins/ so the whole team gets it. Local keeps it project-scoped and just for you.
Skills are available as:
/glab-skills:auth/glab-skills:mr/glab-skills:issue/glab-skills:ci
The auth guard hook activates automatically once the plugin is installed.
Note: The official Anthropic marketplace includes a
gitlabplugin that connects via MCP. This plugin is different: it wraps theglabCLI using skills, which load progressively and use far less context than MCP tool definitions loaded at session start.
claude --plugin-dir ./This loads the plugin from the current directory without installing it. Use /reload-plugins to pick up changes without restarting.
Copy each skill directory into ~/.claude/skills/:
cp -r skills/auth ~/.claude/skills/
cp -r skills/mr ~/.claude/skills/
cp -r skills/issue ~/.claude/skills/
cp -r skills/ci ~/.claude/skills/Standalone triggers (without the plugin namespace):
/auth/mr/issue/ci
Copy the hook and make it executable:
cp hooks/glab-auth-guard.sh ~/.claude/hooks/
chmod +x ~/.claude/hooks/glab-auth-guard.shAdd the following entry to ~/.claude/settings.json under hooks.PostToolUse:
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "bash \"${CLAUDE_CONFIG_DIR:-$HOME/.claude}/hooks/glab-auth-guard.sh\""
}
]
}Copy .claude/settings.local.json into your project's .claude/ folder:
cp .claude/settings.local.json <your-project>/.claude/settings.local.json- docs/commands.md: every command at a glance
- docs/reference.md: the full reference, flags and examples included
- CHANGELOG.md: plugin version history
| Skill | Plugin trigger | Standalone trigger | Description | Auto-invoked |
|---|---|---|---|---|
| auth | /glab-skills:auth |
/auth |
Auth flows, Docker credentials, tokens, and key management | No |
| mr | /glab-skills:mr |
/mr |
Full MR lifecycle: create, review, merge, and stacked diffs | No |
| issue | /glab-skills:issue |
/issue |
Create, manage, board view, and track issues | No |
| ci | /glab-skills:ci |
/ci |
Pipelines, jobs, schedules, runners, and CI variables | No |
Skills with disable-model-invocation: true require explicit invocation. Claude will not trigger them automatically.
| Hook | Trigger | What it does |
|---|---|---|
| glab-auth-guard.sh | PostToolUse + PostToolUseFailure (Bash) | Detects auth errors in glab output and tells Claude to prompt for authentication |
The hook uses an if: "Bash(glab *)" condition so it only spawns when a glab command is involved, not on every Bash call.
.claude/settings.local.json contains pre-approved permissions for all glab subcommands (auth, mr, issue, ci, repo, config) and common git operations, so Claude can run them without asking for confirmation each time.