# 30.7 Claude in CI and the release pipeline (/building-ai-workers/shipping-claude-applications/claude-in-ci)

---
type: Document
title: "30.7 Claude in CI and the release pipeline"
description: "The checks that must pass before a change reaches staging, what check:environments catches that the suite cannot, Claude Code in a pipeline, and the GitHub Action's two traps."
status: stable
order: 330.07
ksor:
  owner: team:panaversity
  audience:
    - public
  approval:
    by: process:panaversity
    at: 2026-11-30T10:58:03Z
chapter: '30'
part: III
expert_status: builder-only
concepts: [ "30.7" ]
last_verified: '2026-11-30'

sources:
  - id: claude-code-github-actions
    title: Claude Code GitHub Actions (Claude Code docs, verified 2026-11-30)
    resource: https://code.claude.com/docs/en/github-actions
  - id: claude-code-headless
    title: Run Claude Code programmatically (Claude Code docs, verified 2026-11-30)
    resource: https://code.claude.com/docs/en/headless
  - id: claude-code-model-config
    title: Model configuration (Claude Code docs, verified 2026-11-30)
    resource: https://code.claude.com/docs/en/model-config
generated:
  at: 2026-11-30T10:58:03Z
  by: esl-rewrite/1.2.0+ksor.1
trust_tier: unverified
build_id: sha256:d6ce3f28a2cf8e492a60bae1b426b7cc6466e35e83d70c3b9763db2c55009f4b
dirty: true
ksor_version: 0.0.60
---

**In everyday life.** A post office will not send a parcel with an empty address line, however urgent the sender says it is. The clerk checks every line against the form, at nine in the morning and at closing time alike. The clerk does not open the parcel or judge what is inside. The clerk checks only that every line is filled and that the ZIP code matches the town. In this section, the parcel is a pull request, the address lines are the table's cells, and the clerk is a required check.

**What you will learn.** You practice this in Lab 30, Tasks 0 and 4.

- Which checks must pass before a change reaches staging?
- What does `check:environments` catch that the suite cannot?
- How does Claude Code run in a pipeline?
- Which two traps does the GitHub Action hold?
- Which model does CI's review job use?

**Why it matters.** This is how you find out before Ana does. A release pipeline is the path every change takes from a pull request to production. Its first gate is the pull request's checks, the only place a fault can be caught before any environment runs the change.

**At work.** It is Tuesday, May 18, 2027, just after 10:00 a.m. Your pull request is open. Its checks run, and so does CI's review job, which runs Claude Code on the change. <!-- EDITOR: proposed in the spec, not yet in specs/labs/part-2-facts.md, and changed in round 2 at the editor's word: CI's review job sets its model with `--model` in `claude_args`, which beats .claude/settings.json (the spec's point 3e named ANTHROPIC_MODEL, which the Action's page does not document) --> The review's log names a model that `.claude/settings.json` does not name. Nobody changed that file. You want to know why.

### Which checks must pass before a change reaches staging?

**Every check a machine can run on the change, made required, and none of them holding a key.** That is [15.7](../code-review/checks-that-block.md)'s rule: "make every check a machine can run a required check". A required check is one the branch's rule names, so a merge waits until it passes. Brightline's pull request now runs these four, beside Lab 15's `tests-unchanged` and `no-secrets`:

| The check | What it reads | What it catches | From |
| --- | --- | --- | --- |
| `checks` | The code | Type errors and failing tests | Lab 15 |
| `check:agent-config` | `agents/`, `environments/`, `deployments/` | An agent file that breaks the worker's rules | Lab 23 |
| The suite on replay, and live when the prompt, the model or the golden set changes | The golden set and recorded answers | A wrong answer, below the written threshold ([24.3](../evaluating-ai-workers/checks-and-regression-tests-in-ci.md)) | Lab 24 |
| `check:environments` | `docs/environments.md` and the files its proofs name | An empty cell in a row the change touched, and a cell its file disagrees with | Lab 30 |

The first, second and fourth read files only. They need no model and no key, as Lab 23's pull-request job gets "no platform token at all" ([Lab 23](../hosted-agents/lab.md), Task 13). The suite's live job does call a model.

<!-- OPEN: how a pull request's live job gets its credential is Lab 24's open question (evaluating-ai-workers/lab.md:232): 23.13's rule accepts only main. Row 3's staging cell for CI's live job rests on the answer. -->

### What does `check:environments` catch that the suite cannot?

**A value that is right in one environment and wrong in another.** The suite runs the code on its cases, in one place, with one key. It cannot see production's workspace, or a fallback model that never ran. `check:environments` reads the table and the files its proofs name, and compares them. On Tuesday it caught two such values ([30.3](#303-images-documents-and-the-files-api), [30.4](#304-errors-by-class-retry-fall-back-or-fix)).

It has a limit. A cell proved "by a person" is only listed, never compared.

### How does Claude Code run in a pipeline?

**Headless, with `claude -p`, and its exit code decides the step.** Running with nobody watching, and the output formats a program reads, are [12.7](../agentic-coding/outside-the-app.md) and [12.8](../agentic-coding/both-ai-vendors.md#practice-outside-the-app). For a pipeline, one more fact matters. Anthropic's page says "Claude Code exits with code 0 on success and a non-zero code when the run fails". So a CI step fails when the run fails.[^claude-code-headless]

12.7 also warned: "a seat does not always load them … So check that each seat loads the rules and settings you intend." A CI job is a seat. What it loads is a cell in row 5.

### Which two traps does the GitHub Action hold?

**A `prompt` input sends the answer to the log, and Claude's commits made with the default token start no checks.** Anthropic's GitHub Action, `anthropics/claude-code-action@v1`, runs Claude Code inside a GitHub workflow.[^claude-code-github-actions]

1. *The answer goes to the log.* Without a `prompt` input, Claude waits for an `@claude` mention and answers in a comment. With one, it runs in **automation mode**. "When the workflow provides a `prompt` input, Claude runs without waiting for a mention." And "By default, results appear in the workflow run log rather than a comment."[^claude-code-github-actions] A review job that gives a prompt and expects comments may post nothing that a reviewer sees. Tell it in the prompt to post, and give it a tool that can.
2. *Claude's commits start no checks.* "GitHub doesn't trigger workflows on commits made with the default `GITHUB_TOKEN`."[^claude-code-github-actions] If Claude pushes a fix to your branch with that token, your required checks do not run on its commit. Anthropic's fix: leave `github_token` out, so the Action signs in as the Claude GitHub App, "or pass a custom app token instead".[^claude-code-github-actions]

AI review on every pull request, and what its findings are worth, is [15.6](../code-review/ai-review-on-every-pr.md).

### Which model does CI's review job use?

**The one its `--model` flag names, whatever the settings file says.** The Action passes Claude Code's flags in its `claude_args` input, and `--model` is one of them.[^claude-code-github-actions] Brightline's review job sets it there. In Claude Code's model order, `--model` at startup comes before the settings file's `model`.[^claude-code-model-config] So the review ran on the workflow's model, not on the one `.claude/settings.json` names. Without `--model`, the Action uses Claude Code's default model.[^claude-code-github-actions]

That is not wrong. It is a value that differs by place. Write it in row 5's staging cell, with the workflow's `claude_args` line as its proof, so the next person who reads the log knows why.

<!-- OPEN: the review job's workflow file name is not fixed by Labs 15 to 29. The kit names it, and row 5's proof names that file. -->

**The operating rule:** make the table's check a required check beside the suite, and give the pull request's checks no key. Write every value CI sets for itself into row 5.

**Do this now.** Ask your coding agent to show your pipeline's gates. Copy this line:

> List every workflow in .github/workflows. For each job, say when it runs, whether it is a required check on main, whether it holds a key or a token, and which model it uses and where that is set. Mark any Claude Code step with a prompt input, and say where its output goes. Mark any step that passes the default GITHUB_TOKEN to it. Change no file.

[^claude-code-headless]: Run Claude Code programmatically, Claude Code docs, Anthropic.
[^claude-code-github-actions]: Claude Code GitHub Actions, Claude Code docs, Anthropic.
[^claude-code-model-config]: Model configuration, Claude Code docs, Anthropic.
