Skip to content
BENIBIX Learn

Claude Code GitLab CI/CD

AI⌨️ Claude CodeIntegrations

Also known as Claude Code GitLab, .gitlab-ci.yml Claude job

Claude Code that runs as a job in a GitLab pipeline.

Think of it like

It is like the same helper, but it works in GitLab.

Example

Emma's team uses GitLab. She adds a Claude job, and a comment on an issue turns into a merge request with working code.

Why it matters

Teams on GitLab get the same help as teams on GitHub, inside their own pipelines.

Definition

Claude Code GitLab CI/CD runs Claude Code as a job in a GitLab pipeline. You add one job to .gitlab-ci.yml and save your API key as a masked CI/CD variable. A trigger, such as a comment that says @claude, starts the job. Claude then works in your own runner and sends its changes back as a merge request. It can use the Claude API, Amazon Bedrock or Google Cloud.

Example code

yaml
script:
  - claude -p "Review this MR" --permission-mode acceptEdits
The line in the job that runs Claude.
GitLab pipelines are one more place to run Claude Code.

Common mistake

Running /install-github-app for a GitLab project. That command only works with GitHub. GitLab is set up by hand.

Key takeaways

  1. 1
    One job. In .gitlab-ci.yml.
  2. 2
    A masked variable. Holds the key.
  3. 3
    Merge requests back. From your runner.