# Claude Code GitLab CI/CD

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

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** Claude Code GitLab, .gitlab-ci.yml Claude job

## Think of it like

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

## 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

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

## Example code

```yaml
script:
  - claude -p "Review this MR" --permission-mode acceptEdits
```

The line in the job that runs Claude.

## Why it matters

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

## Common mistake

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

## Three principles

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

## Related terms

- [Claude Code GitHub Actions](https://learn.benibix.com/term/ai/claude-code-github-actions)
- [Non-Interactive Mode](https://learn.benibix.com/term/ai/non-interactive-mode)
- [CI/CD Pipeline](https://learn.benibix.com/term/development/ci-cd-pipeline)

![Claude Code reached from GitHub, GitLab pipelines and Slack channels, besides your own terminal.](https://learn.benibix.com/diagrams/ci-integrations.svg)

---

Source: https://learn.benibix.com/term/ai/claude-code-gitlab-ci-cd
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
