GuideIntermediate

Claude Code in CI/CD Pipelines

Take Claude Code from your terminal into your pipeline. In this guide Claude Code runs inside GitHub Actions and GitLab CI/CD as a real agent: it reads the repository, runs the tests, follows your `CLAUDE.md`, comments on pull requests and opens branches with changes, all with nobody at the screen and with scoped permissions and budget. You start with `anthropics/claude-code-action@v1`: you install it with `/install-github-app` or by hand, choose how to authenticate (API key, subscription token, identity federation, or a cloud provider through OIDC) and use it in its two modes, the interactive one that answers `@claude` and the automation one that runs with a `prompt` on any event. You build an automated PR review with inline comments and your team's conventions, and compare it with Code Review, Anthropic's managed service. Then you leave GitHub: you run `claude -p` in GitLab and in any other CI with validated JSON output, permissions for unattended runs and caps on turns and dollars, and you write your own pipeline agent with the Claude Agent SDK in Python and TypeScript. The Messages API shows up once, as the no-agent alternative for when a single call is enough. A full module is dedicated to the agent's security in CI: least-privilege tokens, secrets and short-lived credentials, prompt injection from fork PRs, budget guards and auditing. With that in place you apply Claude to real delivery: changelog and release notes, readiness validation, human approval gates, fixing broken CI, security scanning with triage, and diagnosis after a rollback. The capstone builds the full pipeline for Colibrí, an online store with a FastAPI service, from an opened PR to production, hardened and documented.

lessons
64
modules
8
available in
English · Spanish
certificate
Yes
access
Free
Outcomes

What you'll be able to do

  • Install and configure `anthropics/claude-code-action@v1` with the right authentication for your team
  • Use interactive mode (`@claude`) and automation mode (`prompt`, `claude_args`) with model aliases
  • Build an automated PR review with inline comments, team conventions and large PRs kept under control
  • Choose between managed Code Review, your own workflow, local `/code-review` and ultrareview
  • Run `claude -p` in GitLab CI/CD and other CI systems with `--output-format json`, `--json-schema`, `--allowedTools` and `--max-turns`
  • Write your own pipeline agent with the Claude Agent SDK in Python and TypeScript, with a structured result and an exit code
  • Recognize when one Messages API call is enough and what you give up compared with an agent
  • Secure the agent in CI: least privilege, secrets, OIDC, prompt injection from forks and cost limits
  • Automate changelog, readiness, approvals, CI fixes and scheduled jobs without handing Claude the production key
  • Integrate security scanning, rollback with deterministic triggers and follow-up diagnosis
Before you start

What you need to bring

It's for you if...

  • Developers who already use Claude Code in their terminal and want it working on every PR without invoking it by hand
  • Platform and DevOps teams integrating coding agents into existing pipelines
  • Tech leads who want automated review with their team's rules and spend control
  • Anyone who has to answer "what if a malicious PR talks to the agent?" before turning it on

Requirements and materials

  • Claude Code installed and used on real projects (Claude Code Foundations guide)
  • `claude -p`, hooks, subagents and plugins at the local level (Advanced Claude Code Workflows guide)
  • Having written at least one GitHub Actions workflow or GitLab CI/CD pipeline
  • Git and pull requests as part of your daily work
  • A test repository on GitHub (and optionally on GitLab) where you are an admin
  • An API key from the Claude Console or a Pro, Max, Team or Enterprise subscription
Content

The syllabus, module by module

Open any of them to see its lessons.

Common questions

What people usually ask

Start whenever you like

Reviews

What students say

These reviews are from enrolled students who completed at least 50% of the course. We moderate reviews only on content grounds (spam, offensive language, personal data), never for being critical or negative.

No approved reviews yet.

Be the first to share your experience!