Answer: You can configure Claude Code in GitLab with the CLI flags `-p` and `--max-turns`, the GitLab job-level `timeout` keyword, and the variables `ANTHROPIC_API_KEY` plus provider-specific environment variables such as `AWS_REGION` and project/region vars for Google Cloud's Agent Platform. Status: Confirmed Entry: tool/claude-code/settings/gitlab-cicd-variables Revision: 1 Digest: sha256:16e4d82b8a2ebf40 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:04:17Z Last changed: 2026-11-13T03:04:17Z Last verified: 2026-11-20T12:21:00Z Next check: 2026-11-21T12:21:00Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of Inline instructions flag | -p | [1] | 2026-11-20 Max turns flag | --max-turns | [1] | 2026-11-20 Timeout keyword | timeout | [1] | 2026-11-20 API key variable | ANTHROPIC_API_KEY | [1] | 2026-11-20 Provider-specific environment | AWS_REGION | [1] | 2026-11-20 Sources: [1] Anthropic. "Claude Code GitLab CI/CD". https://code.claude.com/docs/en/gitlab-ci-cd.md Role: primary. Accessed: 2026-11-20T12:21:00Z Quote: "`-p`: provide instructions inline, for example `claude -p "Review this MR"`" (Supports: Inline instructions flag) Quote: "`--max-turns`: limit the number of back-and-forth iterations" (Supports: Max turns flag) Quote: "`timeout`: limit total job execution time with GitLab's job-level `timeout` keyword, for example `timeout: 30m`" (Supports: Timeout keyword) Quote: "`ANTHROPIC_API_KEY`: required for the Claude API (not used for Amazon Bedrock or Google Cloud's Agent Platform)" (Supports: API key variable) Quote: "Provider-specific environment: `AWS_REGION`, project/region vars for Google Cloud's Agent Platform" (Supports: Provider-specific environment) Published: 2026-11-20T03:10:58Z Snapshot SHA-256: 0511eaba5a9b283724ccfdd0e421e54491f7a90e0494f7e5df3d5c8d3728a69a (captured 2026-11-19T12:16:34Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-13T03:04:17Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T12:21:00Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:21:00Z Last attempt: 2026-11-20T12:21:00Z Notes and limitations: Extracted automatically from a single official source (section "Common parameters and variables"). Related: https://latestn.com/tool/claude-code/settings/hook-locations Where can I configure hooks in Claude Code (which settings files and locations)? https://latestn.com/tool/claude-code/settings/inspect-effective-config How do I inspect the defaults and my effective auto mode config in Claude Code? https://latestn.com/tool/claude-code/settings/list-of-env-vars Which environment variables does Claude Code read to control model selection, authentication, and request routing? https://latestn.com/tool/claude-code/settings/enable-vim-mode How do I enable Vim keybindings in the Claude Code prompt? https://latestn.com/tool/claude-code/settings/env-var-precedence When an environment variable and a settings file both set the same Claude Code behavior, which value takes precedence? https://latestn.com/tool/claude-code/settings/ghes-plugin-marketplaces How do I add or pre-register a plugin marketplace hosted on GitHub Enterprise Server in Claude Code? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:04:17Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/claude-code/settings/gitlab-cicd-variables/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/claude-code/settings/gitlab-cicd-variables POST: https://latestn.com/dispute/tool/claude-code/settings/gitlab-cicd-variables with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/claude-code/settings/gitlab-cicd-variables?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). What CI/CD variables and parameters can I configure for Claude Code in GitLab? Revision 1, last verified 2026-11-20T12:21:00Z. https://latestn.com/tool/claude-code/settings/gitlab-cicd-variables (accessed 2026-11-21T09:53:22Z). @misc{LatestN_tool_claude_code_settings_gitlab_cicd_variables_r1, title = {What CI/CD variables and parameters can I configure for Claude Code in GitLab?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/claude-code/settings/gitlab-cicd-variables}}, note = {Revision 1; digest sha256:16e4d82b8a2ebf40; last verified 2026-11-20T12:21:00Z; accessed 2026-11-21T09:53:22Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/claude-code/settings/gitlab-cicd-variables