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

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
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
The syllabus, module by module
Open any of them to see its lessons.
- 1. Introduction: the night-shift contractor
- 2. Installing with `/install-github-app` and by hand
- 3. Your first `@claude` workflow, line by line
- 4. Authentication and secrets
- 5. Automation mode: `prompt`, triggers and `claude_args`
- 6. Outputs: `structured_output`, job summary and artifacts
- 7. Costs: minutes, tokens and brakes
- 8. Project: Claude on call at Colibrí
- 1. Module 3 introduction: claude -p outside GitHub
- 2. claude -p in CI: bare mode, JSON output and exit codes
- 3. GitLab CI/CD for a Claude job: stages, jobs, rules, variables and artifacts
- 4. The GitLab pipeline with Claude: the official job, merge requests and credentials
- 5. Permissions for unattended runs
- 6. claude -p from Python and TypeScript scripts
- 7. Other CI systems: the common recipe
- 8. Project: porting Colibrí's review bot to GitLab
- 1. Module 4 introduction: the Claude Agent SDK in your own pipelines
- 2. Choosing: action, claude -p, Agent SDK, Messages API or Managed Agents
- 3. The Agent SDK in Python inside a job
- 4. The Agent SDK in TypeScript inside a job
- 5. Permissions, hooks and budgets in the SDK
- 6. Structured results and exit codes
- 7. The no-agent alternative: one Messages API call
- 8. Project: broken-CI triage agent for Colibrí
- 1. Module 5 introduction: securing Claude in CI
- 2. Threat model of an agent in CI
- 3. Least privilege: job permissions, identities and tokens
- 4. Secrets and short-lived credentials
- 5. Prompt injection from PRs, forks, comments and logs
- 6. Budget guards for unattended runs
- 7. Auditing and observability
- 8. Project: hardening Colibrí's workflows
- 1. Module 6 introduction: delivery automation
- 2. Changelog from diffs, with validated JSON
- 3. Readiness validation: Claude advises, checks decide
- 4. Staging, production and approval gates
- 5. PR descriptions and release notes
- 6. Fixing broken CI with workflow_run
- 7. Scheduled jobs
- 8. Project: Colibrí's complete release workflow
- 1. Module 7 introduction: security scanning and rollback
- 2. Security scanning with Claude: the dedicated action, /security-review and your own prompt
- 3. Integrating deterministic tools and triaging with Claude
- 4. Automatic rollback with deterministic triggers
- 5. Diagnosis after the rollback
- 6. Findings as SARIF and annotations
- 7. Incident summary and postmortem draft
- 8. Project: security gate and rollback for Colibrí
- 1. Project introduction: Colibrí's complete pipeline
- 2. End-to-end pipeline design
- 3. Stages 1 to 3: PR review, scanning and description
- 4. Stages 4 to 6: release, readiness and deploy with approval
- 5. Failure paths and observability
- 6. Hardening and security review
- 7. Documentation, cost and retrospective
- 8. Final delivery and rubric
What people usually ask
No limit. It's a free guide: come in whenever you like, as often as you like.
No. Modules run from easier to harder, but you can jump to the one you need. Progress is saved per lesson.
Whatever is needed is listed under “What you need to bring”, above. If nothing is listed there, you can start from zero.
In the WhatsApp group, and every two weeks there's a live with an instructor where questions get worked through.
Yes. When you finish every lesson you get a statement of completion. Pass the guide's certification exam and it becomes a certificate, with a verifiable code you can share on LinkedIn.
Start whenever you like
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!