Claude Code GitLab CI/CD changedgitlab-ci-cd
Nearest release: v2.1.251, published 13 hours before upstream edited the page. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Upstream edited this page at 29 Aug 2026 04:34 UTC, give or take a minute or two: the time comes from Anthropic’s own sitemap rather than from a commit. This site recorded the change at 20 Oct 2026 18:37 UTC.
Upstream edited
Recorded here
Lines+74added
Lines−76removed
From line
2
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits3to this page, all time
### Prerequisites ### Setup instructions ### Prerequisites ### Setup instructions
The whole hunk
from line 2, old and new numbered
/
from line 2
22
33> Learn about integrating Claude Code into your development workflow with GitLab CI/CD
44
5<Info>
6 Claude Code for GitLab CI/CD is currently in beta. Features and functionality may evolve as we refine the experience.
5> [!NOTE]
6>
7> Claude Code for GitLab CI/CD is currently in beta. Features and functionality may evolve as we refine the experience.
8>
9> This integration is maintained by GitLab. For support, see the following [GitLab issue](https://gitlab.com/gitlab-org/gitlab/-/issues/573776).
710
8 This integration is maintained by GitLab. For support, see the following [GitLab issue](https://gitlab.com/gitlab-org/gitlab/-/issues/573776).
9</Info>
11> [!NOTE]
12>
13> This integration is built on top of the [Claude Code CLI and Agent SDK](/docs/en/agent-sdk/overview), enabling programmatic use of Claude in your CI/CD jobs and custom automation workflows.
1014
11<Note>
12 This integration is built on top of the [Claude Code CLI and Agent SDK](/docs/en/agent-sdk/overview), enabling programmatic use of Claude in your CI/CD jobs and custom automation workflows.
13</Note>
14
1515## Why use Claude Code with GitLab?
1616
1717* **Instant MR creation**: Describe what you need, and Claude proposes a complete MR with changes and explanation
from line 95
9595
9696After adding the job and your `ANTHROPIC_API_KEY` variable, test by running the job manually from **CI/CD** → **Pipelines**, or trigger it from an MR to let Claude propose updates in a branch and open an MR if needed.
9797
98<Note>
99 To run on Amazon Bedrock or Google Cloud's Agent Platform instead of the Claude API, see the [Using with Amazon Bedrock and Google Cloud](#using-with-amazon-bedrock-and-google-cloud) section below for authentication and environment setup.
100</Note>
98> [!NOTE]
99>
100> To run on Amazon Bedrock or Google Cloud's Agent Platform instead of the Claude API, see the [Using with Amazon Bedrock and Google Cloud](#using-with-amazon-bedrock-and-google-cloud) section below for authentication and environment setup.
101101
102102### Manual setup (recommended for production)
103103
from line 154
154154
155155For enterprise environments, you can run Claude Code entirely on your cloud infrastructure with the same developer experience.
156156
157<Tabs>
158 <Tab title="Amazon Bedrock">
159 ### Prerequisites
157**Amazon Bedrock**
160158
161 Before setting up Claude Code with Amazon Bedrock, you need:
159### Prerequisites
162160
163 1. An AWS account with Amazon Bedrock access to the desired Claude models
164 2. GitLab configured as an OIDC identity provider in AWS IAM
165 3. An IAM role with Amazon Bedrock permissions and a trust policy restricted to your GitLab project/refs
166 4. GitLab CI/CD variables for role assumption:
167 * `AWS_ROLE_TO_ASSUME` (role ARN)
168 * `AWS_REGION` (Amazon Bedrock region)
161Before setting up Claude Code with Amazon Bedrock, you need:
169162
170 ### Setup instructions
1631. An AWS account with Amazon Bedrock access to the desired Claude models
1642. GitLab configured as an OIDC identity provider in AWS IAM
1653. An IAM role with Amazon Bedrock permissions and a trust policy restricted to your GitLab project/refs
1664. GitLab CI/CD variables for role assumption:
167 * `AWS_ROLE_TO_ASSUME` (role ARN)
168 * `AWS_REGION` (Amazon Bedrock region)
171169
172 Configure AWS to allow GitLab CI jobs to assume an IAM role via OIDC (no static keys).
170### Setup instructions
173171
174 **Required setup:**
172Configure AWS to allow GitLab CI jobs to assume an IAM role via OIDC (no static keys).
175173
176 1. Enable Amazon Bedrock and request access to your target Claude models
177 2. Create an IAM OIDC provider for GitLab if not already present
178 3. Create an IAM role trusted by the GitLab OIDC provider, restricted to your project and protected refs
179 4. Attach least-privilege permissions for Amazon Bedrock invoke APIs
174**Required setup:**
180175
181 Use the [Amazon Bedrock job example](#configuration-examples) to exchange the job's OIDC token for temporary AWS credentials at runtime.
182 </Tab>
1761. Enable Amazon Bedrock and request access to your target Claude models
1772. Create an IAM OIDC provider for GitLab if not already present
1783. Create an IAM role trusted by the GitLab OIDC provider, restricted to your project and protected refs
1794. Attach least-privilege permissions for Amazon Bedrock invoke APIs
183180
184 <Tab title="Google Cloud's Agent Platform">
185 ### Prerequisites
181Use the [Amazon Bedrock job example](#configuration-examples) to exchange the job's OIDC token for temporary AWS credentials at runtime.
186182
187 Before setting up Claude Code with Google Cloud's Agent Platform, you need:
183**Google Cloud's Agent Platform**
188184
189 1. A Google Cloud project with:
190 * Google Cloud's Agent Platform API enabled
191 * Workload Identity Federation configured to trust GitLab OIDC
192 2. A dedicated service account with only the required Google Cloud's Agent Platform roles
193 3. GitLab CI/CD variables:
194 * `GCP_WORKLOAD_IDENTITY_PROVIDER` (provider resource name without the `//iam.googleapis.com/` prefix, such as `projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider`)
195 * `GCP_SERVICE_ACCOUNT` (service account email)
196 * `GCP_PROJECT_ID` (Google Cloud project ID)
185### Prerequisites
197186
198 ### Setup instructions
187Before setting up Claude Code with Google Cloud's Agent Platform, you need:
199188
200 Configure Google Cloud to allow GitLab CI jobs to impersonate a service account via Workload Identity Federation.
1891. A Google Cloud project with:
190 * Google Cloud's Agent Platform API enabled
191 * Workload Identity Federation configured to trust GitLab OIDC
1922. A dedicated service account with only the required Google Cloud's Agent Platform roles
1933. GitLab CI/CD variables:
194 * `GCP_WORKLOAD_IDENTITY_PROVIDER` (provider resource name without the `//iam.googleapis.com/` prefix, such as `projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider`)
195 * `GCP_SERVICE_ACCOUNT` (service account email)
196 * `GCP_PROJECT_ID` (Google Cloud project ID)
201197
202 **Required setup:**
198### Setup instructions
203199
204 1. Enable IAM Credentials API, STS API, and Google Cloud's Agent Platform API
205 2. Create a Workload Identity Pool and provider for GitLab OIDC
206 3. Create a dedicated service account with Google Cloud's Agent Platform roles
207 4. Grant the WIF principal permission to impersonate the service account
200Configure Google Cloud to allow GitLab CI jobs to impersonate a service account via Workload Identity Federation.
208201
209 Use the [Agent Platform job example](#configuration-examples) to authenticate without storing keys.
210 </Tab>
211</Tabs>
202**Required setup:**
212203
2041. Enable IAM Credentials API, STS API, and Google Cloud's Agent Platform API
2052. Create a Workload Identity Pool and provider for GitLab OIDC
2063. Create a dedicated service account with Google Cloud's Agent Platform roles
2074. Grant the WIF principal permission to impersonate the service account
208
209Use the [Agent Platform job example](#configuration-examples) to authenticate without storing keys.
210
213211## Configuration examples
214212
215213Below are ready-to-use snippets you can adapt to your pipeline.
from line 269
271269 CLAUDE_CODE_USE_BEDROCK: "1"
272270```
273271
274<Note>
275 Model IDs for Amazon Bedrock include region-specific prefixes (for example, `us.anthropic.claude-sonnet-4-6`). Pass the desired model via your job configuration or prompt if your workflow supports it.
276</Note>
272> [!NOTE]
273>
274> Model IDs for Amazon Bedrock include region-specific prefixes (for example, `us.anthropic.claude-sonnet-4-6`). Pass the desired model via your job configuration or prompt if your workflow supports it.
277275
278276### Agent Platform job example (Workload Identity Federation)
279277
from line 343
345343 ANTHROPIC_VERTEX_PROJECT_ID: "$GCP_PROJECT_ID"
346344```
347345
348<Note>
349 With Workload Identity Federation, you do not need to store service account keys. Use repository-specific trust conditions and least-privilege service accounts.
350</Note>
346> [!NOTE]
347>
348> With Workload Identity Federation, you do not need to store service account keys. Use repository-specific trust conditions and least-privilege service accounts.
351349
352350## Best practices
353351
from line 417
419417* `ANTHROPIC_API_KEY`: required for the Claude API (not used for Amazon Bedrock or Google Cloud's Agent Platform)
420418* Provider-specific environment: `AWS_REGION`, project/region vars for Google Cloud's Agent Platform
421419
422<Note>
423 Exact flags and parameters may vary by version of `@anthropic-ai/claude-code`. Run `claude --help` in your job to see supported options.
424</Note>
420> [!NOTE]
421>
422> Exact flags and parameters may vary by version of `@anthropic-ai/claude-code`. Run `claude --help` in your job to see supported options.
425423
426424### Customizing Claude's behavior
427425
No line in this hunk matches that.