Automating Your Development Workflow with Claude Code and GitHub
Learning objectives
By the end of this chapter, you will be able to:
- Explain how Claude Code runs inside GitHub Actions — an event triggers a workflow that runs `anthropics/claude-code-action@v1` on an ephemeral runner, executing Claude Code non-interactively (headless, on the Claude Agent SDK) — and name the two independent credentials involved: the Claude GitHub App for repository access, and an OAuth token or API key stored as a GitHub Actions secret for model authentication.
- Install and configure the integration by running `/install-github-app` from Claude Code (the documented setup path — `gh` is useful for checking repo/auth state but is not a required prerequisite), install the GitHub App, choose a model credential, and merge the pull request it opens to add an `@claude` assistant workflow under `.github/workflows/`.
- Trigger Claude on an issue or pull request by mentioning `@claude`, and describe the branch-per-issue model — Claude works on a separate branch under the configurable `claude/` prefix (never `main`), with the default branch template producing names like `claude/issue-<number>-<timestamp>` — plus the default human-in-the-loop safeguard (Claude pushes a branch and a PR link; a human reviews and merges).
- Diagnose why an autonomous agent can introduce a breaking change without repository context — the third-party-API-contract example and the 'trust-then-verify gap' — and explain why reviewing agent output is non-negotiable.
- Use `/init` to generate and commit a `CLAUDE.md`, and explain why committed project context measurably improves accuracy for automated runs where no human can course-correct mid-task.
- Describe the layered safety model for autonomous Claude-on-GitHub — scoped GitHub App permissions, only-write-access-can-trigger, short-lived repo-scoped tokens, prompt-injection caution on untrusted content, a configurable review workflow, and branch protection — and explain how each compensates for the loss of interactive oversight.
Before we start — GitHub Actions, workflows, and two kinds of auth in plain language
Skim this if you already know what GitHub Actions is, how a workflow file is shaped, and the difference between a GitHub App and an API key. If any of that is fuzzy, read it first — every section below leans on these ideas.
GitHub Actions is GitHub's built-in automation platform. You describe a process you want to run automatically — build, test, deploy, or respond to activity in your repo — and GitHub runs it for you on machines it manages. The book calls it "serverless," and that's the right intuition: you never run or patch a server. For each run, GitHub spins up a fresh, temporary virtual machine called a runner, executes your steps, and throws the machine away afterward.
A few terms you'll meet over and over:
- An event is something that happens in your repo — someone comments on an issue, opens a pull request, pushes a commit. You list the events you care about under the
on:key. When a matching event happens, the workflow starts. The ones in this chapter:issue_comment(a comment on an issue or PR),issues(an issue opened/assigned),pull_requestandpull_request_review(PR activity). - A workflow is the automated process itself, written as a YAML file committed to your repo under
.github/workflows/. Any.ymlfile in that folder is picked up automatically. - A job is a group of steps that run together on one runner. A step is one unit of work: either a shell command (
run:) or a prebuilt action (uses:). - An action (lower-case, singular) is a packaged, reusable unit of automation that someone published in a repo. You use one with
uses: owner/repo@version— for exampleuses: actions/checkout@v4to clone your code, oruses: anthropics/claude-code-action@v1to run Claude. Inputs go in awith:block underneath. Keep "GitHub Actions" (the platform) and "an action" (one reusable unit) distinct — newcomers conflate them constantly.
Here's the smallest well-formed workflow, so the shape is concrete:
name: CI
on:
pull_request:
jobs:
build:
runs-on: ubuntu-latest # the runner: a fresh Ubuntu VM
steps:
- uses: actions/checkout@v4 # a prebuilt action: clones the repo
- run: echo "Hello from the runner" # a shell command
Secrets. A workflow often needs a token or API key. You never write those in the YAML — you store them as encrypted GitHub Actions secrets in the repo's settings and reference them as ${{ secrets.NAME }}. GitHub injects the value at run time and masks it in the logs. (One security property worth knowing: secrets are not passed to workflows triggered by a pull request from a fork — only the limited, read-only GITHUB_TOKEN is.)
Two kinds of authentication — keep them separate. The Claude integration involves two independent credentials, and blurring them is the single most common source of confusion:
- The Claude GitHub App authenticates Claude to GitHub itself — reading issues and PRs, posting comments, pushing commits. A GitHub App is an installable integration with fine-grained, per-repository permissions you grant at install time, authenticating with short-lived tokens. (This is different from a personal access token, which acts as you with your full access, and from an OAuth token, which authorizes an app to act on your behalf. GitHub recommends Apps for integrations precisely because their permissions are scoped and their tokens are short-lived.)
- Model authentication is a separate credential that lets Claude Code call the Anthropic model from inside the runner — either a long-lived Anthropic OAuth token (tied to a Claude subscription) or an API key. This one lives as a GitHub Actions secret. It has nothing to do with the GitHub App's permissions.
Finally, two GitHub objects you mostly already know: an issue is a tracked work item (a bug, a task, a request); a pull request (PR) proposes merging one branch's changes into another and opens a surface for review, comments, and automated checks before anything merges.
Why this chapter matters
Up to now, Claude Code has lived on your laptop. Chapter 1 was the theory of context engineering. Chapter 2 was the startup pass — CLAUDE.md, permissions, plan mode. Chapter 3 was the daily operating surface. Chapter 4 wired Claude into the rest of your stack with MCP and plugins. In every one of those, you were sitting there — watching each step, approving each permission, course-correcting the moment something looked off.
Chapter 5 is the first time Claude Code works without you in the room. You tag @claude on a GitHub issue and walk away; a GitHub Actions runner spins up, Claude reads the repo, makes changes on a branch, and opens a pull request — while you're at lunch. This is genuinely useful: Anthropic's own Product Design team automated pull-request comments this way, with Claude handling formatting fixes and test refactors on its own. It's also where the stakes change. When there's no human to interrupt mid-task, the safety that was "you, watching" has to move somewhere else: into the context you give the agent up front (a committed CLAUDE.md), the permissions you scope, and the review gate you put before merge.
The chapter teaches both halves honestly. It shows the integration working — and then it shows it failing, on purpose: Claude renames a variable that turns out to be part of a third-party API contract, silently breaking the integration. That failure is the whole point. By the end you'll know how to wire Claude into GitHub, and why "looks done" is never the same as "is correct" when an agent runs unattended.
How to read this chapter. Each numbered section ends with an > Analogy — … box that restates the idea in plain language. Lean on them or skim them as you like.
Lesson
1. From your laptop to the repo — what changes when Claude runs unattended
Interactive Claude Code and automated Claude Code are the same agent doing the same kind of work. The difference is everything around it.
| Interactive (Chapters 1–4) | Automated (this chapter) | |
|---|---|---|
| Where it runs | Your terminal | A GitHub Actions runner in the cloud |
| What starts it | You type a prompt | An event — someone mentions @claude or opens a PR |
| Who watches | You, in real time | Nobody, until it's done |
| Permission prompts | You answer them live | None to answer — there's no UI; the run uses what you pre-authorized |
| Course-correction | You interrupt and redirect | Not possible mid-task |
| The safety net | You | Up-front context + scoped permissions + a review gate |
That last row is the heart of it. In an interactive session, if Claude starts down the wrong path you stop it. In headless mode there is no one to ask — Anthropic's own docs note that when a headless run hits a permission boundary, the process simply terminates rather than silently pushing past it. So the design shifts: you stop relying on live oversight and start relying on what you told the agent before it started and what you check after it finishes.
This is why the book opens the chapter with GitHub and not, say, a fancier prompt. The integration is the easy part — a few install steps. The discipline is the hard part, and it's the same discipline from Chapter 1, now load-bearing because the human safety valve is gone.
Analogy — the contractor who works after hours Hiring a contractor who works while you watch is one thing — you catch a wrong cut before the second one. Giving them a key so they work overnight while you sleep is another. You can't correct them mid-job, so everything rides on two things: the written instructions you left taped to the wall, and the walk-through you do in the morning before you pay. Automating Claude on GitHub is handing over the key.
2. The architecture — Claude Code, GitHub Actions, and the Agent SDK
Here's what actually happens, mechanically, when you tag @claude on an issue.
- Your comment is an event (
issue_comment, typecreated). - The event matches the
on:block of the workflow file.github/workflows/claude.yml, so GitHub starts the workflow. - The workflow's one job spins up an ephemeral Ubuntu runner and runs its steps. The key step is
uses: anthropics/claude-code-action@v1— the official Anthropic action. - That action runs Claude Code non-interactively — headless mode, the same
claude -p-style execution you'd use in any CI script. Under the hood the action is built on the Claude Agent SDK (the SDK was previously called the "Claude Code SDK"; it's the programmatic way to run the same agent that powers the CLI). - To do its work, Claude needs two credentials, and they are independent:
- the GitHub App token, which lets it read the issue, push a branch, and comment — scoped to this one repo;
- the model credential (OAuth token or API key), read from a GitHub Actions secret, which lets it call the model.
- Claude does the task on a new branch, then surfaces a pull request. In the action's default configuration, it does not merge anything — a human reviews and merges.
A couple of details the book's example simplifies, worth getting right because they're what you'll actually see today:
- The action is
anthropics/claude-code-action@v1, not@beta. The action went to a stable v1 in 2025; the book's@betatag is from an earlier build. There's now a single unified action that auto-detects whether it's responding to an@claudemention or running an automation, so the oldmode: "tag"/mode: "agent"inputs are gone. - The example workflows listen on more than one event. The book shows only
issue_comment; the action'sexamples/claude.ymlcurrently also listens onpull_request_review_comment,issues, andpull_request_review, so Claude can be summoned from review threads and new issues too. (The docs' inline "basic workflow" shows a shorter two-event version, and the examples directory has several variants — treat any single file as representative, not canonical, and check the current examples before you copy one.)
Analogy — the dispatch desk Think of GitHub Actions as a dispatch desk. An event is a call coming in. The workflow file is the standing instruction sheet that says "for this kind of call, send this crew." The runner is the truck that gets dispatched — fresh each time, returned to the depot after. The action is the specialist riding in the truck. And the specialist carries two badges: one that opens the building (GitHub App), one that bills the work (model credential). Lose track of which badge is which and you'll spend an afternoon debugging the wrong one.
3. Installing and configuring the integration
The setup is driven by one command. From a Claude Code session opened inside a directory that is a Git repository connected to GitHub (this matters — the integration only works in a valid GitHub repo, and you need admin access to install the App and add secrets):
/install-github-app
The book reaches this via typing /git first; in current builds /install-github-app is a standalone command you can invoke directly. It walks you through the following.
Step 1 — (Optional) the GitHub CLI. The book walks through installing and authenticating the gh CLI first, as a prerequisite. It's genuinely handy — gh repo view and gh auth status are the quickest way to confirm you're in a GitHub-connected repo and signed in — but the current official docs do not list gh as a required prerequisite for /install-github-app. The documented setup path is simply running /install-github-app from Claude Code in a repo you administer; the command itself walks you through the GitHub App install and the secret. If you want gh anyway (the command varies by OS — the book shows macOS Homebrew; on Windows use winget install --id GitHub.cli, on Linux follow https://cli.github.com/):
brew install gh # macOS; see cli.github.com for Windows/Linux
gh --help # verify it's on your PATH
gh auth login # authenticate
During gh auth login, choose HTTPS as the connection method and log in through the browser with the one-time code. With two-factor enabled, approve with your second factor. Once that completes, your gh session is authenticated — useful for checking repo state, though /install-github-app does not depend on it.
Step 2 — Install the Claude GitHub App. Back in Claude Code, press Enter to continue and you're redirected to a GitHub page to install the Claude GitHub App (https://github.com/apps/claude). You choose which repositories it can touch; it requests read & write on Contents, Issues, and Pull requests — nothing broader. Click Install, return to the terminal, press Enter again.
Step 3 — The workflow it sets up. The book describes the installer presenting a choice of two templates — "Tag Claude" (respond to @claude mentions) and "Claude Code Review" (auto-review new PRs). The current docs describe /install-github-app more simply: it sets up the GitHub App plus the required secret, and adds an @claude assistant workflow (claude.yml) that responds to mentions in issues and PR comments. **Automated PR review is a separate workflow you add yourself** — the action's examples directory ships ready-to-copy review workflows such as pr-review-comprehensive.yml, pr-review-filtered-paths.yml, and manual-code-analysis.yml. So treat "two templates named Tag Claude / Claude Code Review" as the book's description of an earlier installer; what you'll reliably get today is the @claude assistant workflow, and you copy in whatever review workflow you want. (Anthropic also offers a separate managed Code Review product — see §7 — which is a different thing entirely.)
Step 4 — Choose a model credential. Someone has to pay for the tokens Claude consumes. Two options:
- A long-lived OAuth token tied to a Claude subscription (Pro, Max, Team, or Enterprise). Generate it with
claude setup-token— it prints a token (formatsk-ant-oat01-…, valid about a year) that you store as the secretCLAUDE_CODE_OAUTH_TOKEN. Good for small-to-medium usage inside a subscription. (Billing caveat, as of writing — verify the current terms in the authentication docs: per Anthropic, starting June 15, 2026, Agent SDK andclaude -pusage on subscription plans draws from a new monthly Agent SDK credit, separate from your interactive usage limits. The GitHub Action runs Claude headlessly via the Agent SDK, so a subscription token used in CI is subject to this.) - An Anthropic API key, stored as the secret
ANTHROPIC_API_KEY. Typical for large-scale or high-frequency workflows that would exceed subscription limits.
(Beyond these two, the action also supports Amazon Bedrock, Google Vertex AI, and Microsoft Foundry for teams whose models are hosted there, plus Workload Identity Federation so there's no static key to store. The book covers only the first two; the others are there if your org needs them.)
Whichever you pick, the credential is stored as a GitHub Actions secret, set up automatically during configuration. Nothing sensitive lands in the workflow file.
Step 5 — Merge the setup PR. The install flow fetches your repo info and opens a pull request that adds a workflow under .github/workflows/ — the @claude assistant workflow claude.yml. (The book shows two files, claude.YAML and claude-code-review.YAML; the uppercase extension is an OCR artifact — real workflow files are lowercase .yml — and, per Step 3, a dedicated review workflow is something you copy in from the examples rather than a guaranteed installer output. Review exactly what the PR contains before merging.) The new workflow runs as a check on that very PR — once it passes, merge. Your repo now has a .github/workflows/ directory it didn't have before.
Here is a representative claude.yml — close to the action's current examples/claude.yml — so you know the shape of what you're merging. The official examples can change between releases, so verify against the live examples directory rather than treating this as canonical:
name: Claude Code
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned]
pull_request_review:
types: [submitted]
jobs:
claude:
# only run when the comment/issue/review actually mentions @claude
if: contains(github.event.comment.body, '@claude') || contains(github.event.issue.body, '@claude')
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
issues: write
id-token: write
actions: read # lets Claude read CI results on the PR
steps:
- uses: actions/checkout@v4
- uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
# or: anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
Notice the permissions: block — it's least-privilege: the job can write Contents, Issues, and PRs, but nothing else. And notice the token is a ${{ secrets.… }} reference, never the value. The book's closing note for this section is right and worth keeping: the integration can be customized further — selecting the model, restricting which tools Claude may use, and more. We'll get to that in §7.
Analogy — onboarding a new hire Setup is the first day of a new hire. The gh login is them proving who they are at the front desk. Installing the GitHub App is facilities granting them a building badge scoped to the floors they need. Choosing the model credential is payroll setting up how their work gets billed. And the secret store is the locked drawer where the badge and the payroll code live — never written on a sticky note left on the monitor. Two credentials, two purposes; don't hand them the CFO's keys to read one email.
4. Tagging @claude to resolve an issue — and why it broke
With the integration installed, summoning Claude is one comment. The book's worked example uses a real issue on the IceBreaker project: a user asked to rename a variable from linkedin_username to linkedin_url, because the variable actually holds a URL. On the issue, someone comments:
@claude, can you fix this
The mention fires the workflow (the run even gets a human-readable name like "small rename"). You can open the Actions tab and watch the raw logs stream — but they're mostly JSON tool calls and outputs, great for deep debugging and miserable for following along. Better to watch the issue itself, where Claude posts a to-do list that updates as it works.
The very first thing Claude does is look for a CLAUDE.md in the repo — the project-context file from Chapters 1–3. Its purpose is exactly what you'd expect: tell Claude the tech stack, the structure, the conventions, the things you can't infer from the code alone. This is context engineering, the discipline from Chapter 1, showing up at the moment it matters most.
Spoiler: this repo has no CLAUDE.md. That's deliberate. Claude proceeds anyway, finishes its to-do list, works on a branch, and surfaces a pull request. In the action's default configuration it commits the change to a branch and hands back a PR-creation link rather than opening or merging the PR itself — keeping a human in the loop. The PR description reads reasonably. And then you look at the actual diff.
Claude renamed the variable — including in a payload that gets sent to a third-party API. The external service expects the request body to use a specific set of key names. linkedin_username was one of them. Rename it to linkedin_url and the request no longer matches the contract the external endpoint enforces, so the call fails. The change looks like a clean readability fix. It's a production break.
This is the chapter's most important lesson, and Anthropic's own best-practices guidance names the failure mode precisely: the trust-then-verify gap — "Claude produces a plausible-looking implementation that doesn't handle edge cases." The remedy in their words: "Always provide verification. If you can't verify it, don't ship it." "Looks done" is the only signal an unattended agent has; without an actual check — a human review, or better, a test that exercises the contract — that's all you get. The book states the principle plainly: review any change carefully rather than accepting it blindly, and this applies to every agentic workflow, not just this one.
Analogy — the eager intern and the load-bearing label A sharp new intern is told "that column name is ugly, clean it up." They renamecust_idtocustomer_ideverywhere — tidy, readable, and they did exactly what was asked. What nobody told them is that a partner company's nightly import matches on the literal stringcust_id. Monday morning the import is broken. The intern wasn't careless; they were uninformed. The fix isn't a smarter intern — it's telling them, before they start, which labels are load-bearing.
5. The branch-per-issue model — control, and why it scales
One detail in that failure is quietly reassuring: Claude never touched main. It does its work on a separate branch it creates automatically, under the action's claude/ branch prefix — never the default branch. The exact name is configurable: the action's default branch-name template produces names like claude/issue-<number>-<timestamp> (e.g. claude/issue-950-20250711_082715), but both the prefix and the template are configurable inputs, so don't hard-code an exact suffix into your tooling. (The book writes the older claude/issue/<issue-number> slash form; the part you can rely on is simply a separate branch under claude/, not main.) Because the change lives on its own branch behind a pull request, you decide whether to review, modify, or merge it. The broken rename never had a path to production that didn't go through a human.
This branching strategy isn't just a safety convenience — it's the foundation for scaling agentic work. Because each task gets its own isolated branch, you can run multiple Claude instances in parallel, each on its own branch, without them stepping on each other. That idea grows into Git worktrees, which the book covers later. For now, the takeaway is: one issue, one branch, one PR, one human decision.
The security model around triggering reinforces this:
- Only users with write access to the repo can trigger Claude. A drive-by comment from a random account won't fire the workflow. Bots are blocked by default.
- The runner gets a short-lived token scoped to the single repo — no cross-repo reach, and it expires.
- Be careful with untrusted content. When you tag Claude on an issue or PR opened by an external contributor, that text can contain hidden instructions — invisible characters or HTML comments crafted to redirect the agent (a prompt-injection attempt). Anthropic's action security docs explicitly recommend reviewing the raw content of anything from outside contributors before letting Claude act on it.
Analogy — everyone gets a photocopy of the blueprints A well-run architecture firm never lets anyone draw on the master blueprints. Each person works on a photocopy; changes only reach the master after the lead reviews and signs off. Claude's branch is the photocopy. main is the master. The rename disaster scribbled all over a photocopy — annoying, instantly discardable, and it never touched the original.
6. Adding repository context with CLAUDE.md — the fix
The hypothesis is now obvious: Claude broke the contract because it didn't know the contract existed. Let's give it the context and re-run.
Step 1 — Generate the context file. Open the project locally (in your editor or IDE — the book uses Cursor; any works) and, in Claude Code, run:
/init
/init scans the repository and writes a CLAUDE.md capturing the tech stack, structure, and conventions. During the scan, Claude asks permission to run commands like listing files; you allow them, and the approvals are written to a local settings file (.claude/settings.local.json) so they persist for the session — fine-grained control over what Claude may do. When the scan finishes, Claude writes the file.
Step 2 — Review and improve it. Open the generated CLAUDE.md and read it. The auto-generated summary is a good start — but the single most valuable thing you can add is exactly the fact that would have prevented the break: a note that the LinkedIn variable is part of a third-party API payload whose key names must not change. Anthropic's best-practices guide is explicit that CLAUDE.md is for "persistent context [Claude] can't infer from code alone" — and lists "common gotchas or non-obvious behaviors" as a thing to put there. "This name is load-bearing for an external contract" is precisely such a gotcha.
Step 3 — Commit it. Ask Claude to commit CLAUDE.md; review the commit message; accept. Now it's versioned, shared with the team, and — critically — available to Claude when it runs inside GitHub Actions. That last part is the whole game: the automated run on the runner reads the committed CLAUDE.md just like your local session does. Anthropic's GitHub Actions docs put it directly: "Claude respects your CLAUDE.md guidelines and existing code patterns."
Step 4 — Re-tag Claude. Back on the issue, mention Claude again (the book adds a small hint pointing at the right function — it admits this biases the experiment slightly, but the effect of context still shows):
@claude, can you please address this issue?
Please notice that you need to edit the function ice_break_with
The workflow fires. This time Claude updates the variable consistently in the function definition and at the call site, while preserving the external API payload key — the rename is applied where it's safe and avoided where it isn't. The logic is correct, the contract intact. A pull request titled "Renamed linkedin_username to linkedin_url" now accurately describes a change that's actually right.
Why does this matter more for automated runs than interactive ones? Because in an interactive session you're the missing context — you'd have caught it live and said "no, don't touch that key." In an unattended run there's no you. The committed CLAUDE.md is the substitute for the over-the-shoulder correction. Two honest caveats keep this from becoming magical thinking: CLAUDE.md is advisory, not a hard guarantee — for a rule you must enforce, use a hook or a required test, not a sentence in a doc; and keep it short — Anthropic warns that a bloated CLAUDE.md causes Claude to ignore your actual instructions.
Analogy — the runbook on the wall Back to the after-hours contractor. The reason the morning went badly wasn't the contractor — it's that nobody left a runbook. The fix is a single sheet taped by the door: "Load-bearing wall, do not move. Gas line behind panel C. The blue valve is the supplier's, never touch it." /init drafts that sheet; you add the one line that actually matters; committing it tapes it to the wall so it's there every night, for every contractor, including the one who works while you sleep.
7. Configuring the review workflow — what "fully configurable" really means
Beyond the @claude assistant workflow, you can add an automated PR-review workflow that runs when a pull request is opened — no one has to tag it. The book installs this as a second template ("Claude Code Review"); today you add it yourself by copying one of the action's review examples (e.g. pr-review-comprehensive.yml) into .github/workflows/. In the corrected example, the moment the good PR opens, that review workflow fires: Claude reads the diff and posts a structured review — a checklist of what it examined and what it found. Here it approves, finding no functional issues.
The book notes this review system is "fully configurable," and that's worth making concrete, because it's how you turn a generic reviewer into one that enforces your standards. The v1 action exposes two main knobs: a prompt (plain text, or the name of a skill to run) and claude_args — a pass-through for any Claude Code CLI argument. Through claude_args you can:
- Run your tests and linters as part of the review —
--allowedTools "Bash(npm run test:*),Bash(npm run lint:*)"lets Claude actually execute them. A real test that exercised the LinkedIn payload would have caught the §4 break mechanically, before any human looked. - Pin the model and bound the work —
--model …,--max-turns 10. - Inject review criteria —
--system-prompt "Flag any change to an external API payload. Ensure new code has tests."
There's a deeper reason a separate automated reviewer helps, beyond convenience. Anthropic's best practices point out that "a fresh context improves code review since Claude won't be biased toward code it just wrote." The review workflow runs as its own job with its own clean context — it sees only the diff and your criteria, not the reasoning that produced the change. That independence is exactly why a second pass catches what the first missed.
Two things to keep distinct so you're not surprised later:
- The review workflow you self-host via the action (a
pr-review-*.ymlyou add yourself) is not the same as Anthropic's managed Code Review product (a research-preview feature for Team/Enterprise plans, run on Anthropic's infrastructure, configured in the Claude admin settings, billed per review — averaging roughly $15–25 each). Both read yourCLAUDE.mdto shape what they flag — the managed one even works bidirectionally, flagging when a PR makes aCLAUDE.mdstatement outdated — but they're different things. This chapter is about the self-hosted GitHub Action. - The strongest enforcement doesn't live in Claude at all: GitHub branch-protection rules (require a passing check, require a human review, restrict who can push to
main) are the deterministic backstop. Claude's review is advice; branch protection is the gate.
Analogy — the QA bench with its own checklist A good factory doesn't let the person who built a part also be the one who passes it. The part goes to a QA bench staffed by someone who didn't build it, working from a written checklist, with calipers that actually measure. The automated review workflow is the QA bench: fresh eyes (clean context), your checklist (--system-prompt,CLAUDE.md), and real instruments (tests and linters run viaclaude_args). And the locked gate past the bench — the part can't ship until QA signs and the gate opens — is branch protection.
The whole chapter in one image — the contractor with a key to the shop
Analogy — pedagogical summary, drawing on all seven sections
You've decided to give a skilled contractor a key so they can work in your shop after hours, on jobs you'll review in the morning. That decision is this whole chapter.
Wiring up the access is the install. They prove who they are at the front desk (gh auth login). Facilities issues a badge scoped to just the rooms they need (the GitHub App, with read/write on Contents, Issues, PRs — nothing more). Payroll sets up billing for their hours (the model credential), and both the badge and the billing code go in a locked drawer, never on a sticky note (GitHub Actions secrets). The dispatch desk gets a standing instruction sheet: for this kind of call, send this contractor (the claude.yml workflow, triggered by an @claude mention).
The first overnight job goes wrong — not because the contractor is bad, but because the shop had no rules posted. Asked to "clean up that label," they rename a part that a supplier matches on, and the supplier's delivery breaks (the third-party API contract). The damage is contained to one thing only: they worked on a photocopy of the blueprints, never the master (the claude/issue-… branch, never main), so nothing shipped — you caught it at the morning walk-through (the PR review). The lesson lands hard: looks done is not is correct when nobody's watching the work happen.
The fix is a runbook on the wall. You tape up a single sheet — the blue valve is the supplier's, never touch it (/init drafts the CLAUDE.md, you add the one load-bearing line, you commit it so it's there every night for every contractor). The same job, re-run with the runbook posted, comes out right.
And you keep a QA bench by the door. A second person who didn't do the work checks every job against a written checklist with real instruments (the review workflow — fresh context, your criteria, tests and linters run for real), and the part can't leave until QA signs and the gate unlocks (branch protection).
That's the chapter. The integration is a few commands. The discipline — context up front, scoped access, a review gate — is what makes handing over the key a good idea instead of a bad one.
Activity — Write the CLAUDE.md lines that would stop a 2 a.m. mistake
Ten minutes, individual, no setup required. Pick a real repository you work in (or one you know well).
- List three to five facts about this repo that an autonomous agent would get wrong if nobody told it — the load-bearing labels, the things that look safe to change but aren't. Examples to prime the pump: a field name that's part of an external API or DB contract; a generated file that must not be hand-edited; a "temporary" hack that other code depends on; a naming pattern that a downstream system matches on; a directory that looks like dead code but is loaded dynamically.
- For each, write the single
CLAUDE.mdline that would prevent the mistake. Aim for one crisp sentence each — "events.user_idis sent verbatim to the billing provider; never rename or reshape it." - For the worst one — the fact whose violation would cause real damage — decide whether a sentence in
CLAUDE.mdis actually enough, or whether it needs hard enforcement (a required test, a pre-merge check, a hook). Note which, and why. (CLAUDE.mdis advisory; some things need a gate.) - Count your lines. If your draft
CLAUDE.mdis over ~15 lines, cut it to the most important 8–10. Bloat gets ignored.
Keep the result — it's a real artifact you can commit, and it's exactly the kind of context that turns the §4 break into the §6 success.
Stretch task (enrichment)
Sketch (don't build) the PR-review workflow you'd want for that repo (start from one of the action's pr-review-*.yml examples and name your copy whatever you like — pr-review.yml, say). Write the one --system-prompt sentence that names the thing your reviewer must never wave through, and the one --allowedTools "Bash(…)" entry that would let the reviewer mechanically verify it (a test, a lint, a schema check) instead of just eyeballing it. Two lines. They're the difference between a reviewer that hopes and one that checks.
Practical exercise — Drive the autonomous loop and prove that context fixes it
~35–45 minutes. Hands-on. Two tracks. Track A wires the real GitHub integration (needs admin access to a GitHub repo you own, and a Claude subscription or API credit; the gh CLI is handy for checking state but isn't required). Track B reproduces the chapter's central finding entirely locally with no GitHub account and no admin — everyone can do this one. If you can't do Track A today, do Track B; it teaches the load-bearing lesson (context engineering for unattended runs) without the setup cost.
Pick a throwaway sandbox repo for either track — nothing here touches the training repo or anything you care about.
Track B — the no-GitHub lab (reproduce the break, then fix it)
You'll simulate exactly what the GitHub Action does — run Claude Code non-interactively (headless) on a task, with no human watching — first without context, then with it.
Setup (5 min). Create a tiny repo with a file that has a load-bearing variable name, mirroring the chapter:
mkdir -p ~/cct-ch5-lab && cd ~/cct-ch5-lab
git init -q
cat > linkedin.py <<'PY'
import requests
def ice_break_with(linkedin_username: str):
# linkedin_username is sent VERBATIM to the third-party enrichment API.
# The external service matches on the exact key "linkedin_username".
payload = {"linkedin_username": linkedin_username}
return requests.post("https://api.example-enrich.com/v1/lookup", json=payload)
PY
cat > issue.md <<'MD'
# Issue: rename linkedin_username to linkedin_url
The variable actually holds a URL. Rename it for readability.
MD
git add . && git commit -q -m "init"
Step 1 — Run the task headless, with no CLAUDE.md (5 min). This is the same non-interactive execution mode the GitHub Action uses. From ~/cct-ch5-lab:
claude -p "Read issue.md and linkedin.py, then apply the requested rename. Edit the files." --allowedTools "Read,Edit"
Expected outcome: Claude renames linkedin_username → linkedin_url. Inspect the diff — git diff. There's a good chance it renamed the payload key "linkedin_username" too (or at least didn't flag that doing so is dangerous). That's the §4 break: a plausible-looking change that violates the external contract. Note what it did.
git stash # set the attempt aside so you can compare
Step 2 — Add the one load-bearing line of context (5 min). Create CLAUDE.md:
# Project context
## Gotchas — read before editing
- `linkedin.py` builds a JSON payload sent to a third-party enrichment API.
The external service matches on the **exact** key string `"linkedin_username"`.
You may rename the local Python variable, but you must NOT change that
payload key — doing so breaks the external API contract.
git add CLAUDE.md && git commit -q -m "add CLAUDE.md with the API-contract gotcha"
Step 3 — Re-run the identical headless task (5 min):
claude -p "Read issue.md and linkedin.py, then apply the requested rename. Edit the files." --allowedTools "Read,Edit"
Expected outcome: this time Claude renames the local variable consistently (definition and call site) but leaves the payload key "linkedin_username" intact — exactly the §6 correct change. git diff should show the dict key unchanged. The only thing that changed between the broken run and the correct run was the committed context.
Step 4 — Prove the point with a real check (5 min). Context is advisory; a test is a gate. Add one and see it catch the bad version:
cat > test_contract.py <<'PY'
import inspect, linkedin
def test_payload_key_is_preserved():
src = inspect.getsource(linkedin.ice_break_with)
assert '"linkedin_username"' in src, "external API payload key must not change"
PY
python -m pytest -q # passes against the good change
git stash pop # bring back the broken attempt…
python -m pytest -q # …and watch the same test FAIL
Reflection: in a real GitHub Action, Step 4's test is what you'd wire into your PR-review workflow (a pr-review-*.yml copied from the action's examples) via --allowedTools "Bash(python -m pytest:*)". The human-in-the-loop review is one backstop; a mechanical check the agent runs is a better one. Which would you trust at 2 a.m.?
Track A — the real GitHub integration (if you have a repo + admin + model credit)
- Pick a repo you own, clone it, and open Claude Code inside it. Confirm it's a real GitHub repo (
gh repo view, or just check it has a GitHub remote —ghis optional). - (Optional) sign in to
ghif you want it for checking state:gh auth login(HTTPS, browser). Not required for the next step. - Run
/install-github-appin Claude Code. Install the Claude GitHub App on just this repo, and follow the prompts to add the model-credential secret and the@claudeassistant workflow (claude.yml). If you want automated PR review too, copy a review example (e.g.pr-review-comprehensive.yml) from the action's examples directory into.github/workflows/separately. - Provide a model credential: run
claude setup-tokenfor an OAuth token (or use an API key) and let the installer store it as the GitHub Actions secret. Review and merge the setup PR that adds.github/workflows/. - Open an issue asking for a small, safe change (e.g., "add a docstring to function X"). Comment
@claude, can you do this?. Watch the Action run in the Actions tab, then watch the to-do list on the issue. - Review the branch and PR Claude produces. Confirm the branch name follows
claude/issue-…and thatmainis untouched. Do not auto-merge — read the diff first. - Add and commit a
CLAUDE.md(use/init, then add one project-specific "gotcha" line). Open a second, slightly riskier issue and re-run. Compare how the context changes Claude's output.
Success checklist
- [ ] (Track B) You have a
git stash'd "broken" attempt and a committed "correct" attempt, andgit diffshows the payload key changed in one and preserved in the other. - [ ] (Track B) The same
pytestcheck passes on the good change and fails on the broken one. - [ ] (Track B) You ran the task with
claude -p(headless) — the same non-interactive mode the GitHub Action uses — at least twice. - [ ] (Track A) The integration installed;
.github/workflows/claude.ymlexists; the credential is a secret, not inline. - [ ] (Track A) You triggered Claude with
@claude, watched the Action run, and reviewed aclaude/issue-…branch without merging blindly. - [ ] (Either) You can state, in one sentence, why committed context matters more for unattended runs than interactive ones.
Common pitfalls -/install-github-apperrors out. Almost always because Claude Code was launched from a directory that isn't a GitHub-connected Git repo, or you lack admin on the repo. Re-open Claude in a valid repo you administer. - Mention not triggering. It must be@claude, not/claude, and only users with write access can trigger it — a comment from an account without write access is ignored by design. - The Action runs but can't authenticate the model. The secret name must match what the workflow references (CLAUDE_CODE_OAUTH_TOKENorANTHROPIC_API_KEY). A token fromclaude setup-tokenis the OAuth one. - (Track B)claude -pasks for permission anyway. Pass--allowedTools "Read,Edit"(andBash(...)patterns for Step 4) so the headless run has what it needs; headless mode can't pop an interactive prompt, so an un-allowed tool just stops the run. - Expecting Claude to merge for you. By default it doesn't — it pushes a branch and a PR link. That's the human-in-the-loop safeguard, not a bug.
Knowledge check — try the quiz
Once you've read the lesson and worked the lab, take the chapter quiz from the navigation bar. Six questions: five grounded in the book chapter, one synthesis question that ties the integration to the layered safety model for autonomous agents. Retake it until you're confident.
Further reading & enrichment sources
- Anthropic docs — "Claude Code GitHub Actions" (
https://code.claude.com/docs/en/github-actions). The canonical install flow, theclaude.ymltemplate and its events, theprompt/claude_argsconfiguration model, and the "Security considerations" checklist (review before merge; least-privilege permissions). anthropics/claude-code-action— repo, examples, and security doc (https://github.com/anthropics/claude-code-action,…/tree/main/examples,…/blob/main/docs/security.md). The@v1action, ready-to-copy example workflows, the "only write-access can trigger" rule, the "Claude does not auto-create PRs by default" guarantee, and the prompt-injection caution on untrusted content.- Anthropic docs — "Authentication" (
https://code.claude.com/docs/en/authentication). Howclaude setup-tokengenerates the long-livedCLAUDE_CODE_OAUTH_TOKEN, the full list of model-auth paths (subscription token, API key, Bedrock, Vertex, Microsoft Foundry, WIF), and the dated note that — as of writing — starting June 15, 2026 Agent SDK /claude -pusage on subscription plans draws from a separate monthly Agent SDK credit. Verify current billing terms here before relying on a subscription token in CI. - Anthropic docs — "Claude Code best practices" (
https://code.claude.com/docs/en/best-practices). Source of the trust-then-verify gap, "if you can't verify it, don't ship it," the "give Claude a way to verify its work" guidance, the fresh-context reviewer argument, and theCLAUDE.md-as-persistent-context framing used in §4–§7. - Anthropic docs — "Headless mode" and "Claude Agent SDK overview" (
https://code.claude.com/docs/en/headless,…/agent-sdk/overview). Whyclaude -pis the non-interactive entry point the GitHub Action is built on, and what changes when there's no human to answer a permission prompt. - Anthropic blog — "How Anthropic teams use Claude Code" (
https://claude.com/blog/how-anthropic-teams-use-claude-code). The Product Design team's automated PR-comment workflow via GitHub Actions, and the Security Engineering team's periodic-human-checkpoint discipline. - GitHub docs — workflows, events, secrets, and GitHub Apps vs OAuth apps (
https://docs.github.com/en/actions). The GitHub-side concepts behind the newcomer preface.
Knowledge check
6 questions. Passing score: 5.
Instructor notes & source coverage
Source Ledger — Chapter 5: Automating Your Development Workflow with Claude Code and GitHub
Primary source (the book)
- Source PDF:
source-pdfs/05-chapter-05.pdf - Extracted source:
extracted-chapters/05-chapter-05.md(cleaned, with approximate<!-- page N -->markers — 8 of them) andextracted-chapters/05-chapter-05.txt(raw extraction) - Extraction tool:
pdftotext -layout -enc UTF-8(Poppler, shipped with Git for Windows) - OCR needed: No — extraction was text, but see the PDF page-number caveat at the end. The Chapter 5 extraction lacked clean form-feed page boundaries, so page markers and references in this ledger are approximate.
- Book's three main sections: "Installing and configuring the Claude Code GitHub integration" (pp. ~1–4), "Using Claude Code to resolve GitHub issues" (pp. ~4–6), and "Adding repository context with CLAUDE.md" (pp. ~7–8).
Enrichment sources
The lesson silently incorporates material from the official Claude Code documentation (GitHub Actions, code review, authentication, best practices, headless mode, the Claude Agent SDK, and memory/CLAUDE.md), Anthropic's blog, the anthropics/claude-code-action GitHub repository (its example workflows and security doc), and the official GitHub Actions documentation (workflows, events, secrets, and the GitHub-App-vs-OAuth-app distinction). Per project convention, no inline > Source: or > Enrichment — ... labels appear in the learner-facing lesson — the labels caused visual confusion in Chapter 1 and were dropped. This source ledger is the single source of provenance: every per-section mapping below tells you which paragraphs came from the book, which from labelled enrichment, and which were authored as pedagogical scaffolding for this training.
- [E1] Anthropic docs — Claude Code GitHub Actions —
https://code.claude.com/docs/en/github-actions - [E2] Anthropic docs — Code review —
https://code.claude.com/docs/en/code-review - [E3] Anthropic docs — Authentication / long-lived token —
https://code.claude.com/docs/en/authentication - [E4] Anthropic docs — Claude Code best practices —
https://code.claude.com/docs/en/best-practices - [E5] Anthropic docs — Headless mode —
https://code.claude.com/docs/en/headless - [E6] Anthropic docs — Claude Agent SDK overview —
https://code.claude.com/docs/en/agent-sdk/overview - [E7] Anthropic docs — Memory / CLAUDE.md —
https://code.claude.com/docs/en/memory - [E8] Anthropic blog — How Anthropic teams use Claude Code —
https://claude.com/blog/how-anthropic-teams-use-claude-code - [E9] GitHub Action —
anthropics/claude-code-actionrepo —https://github.com/anthropics/claude-code-action - [E10] GitHub Action — example workflows —
https://github.com/anthropics/claude-code-action/tree/main/examples - [E11] GitHub Action — security model —
https://github.com/anthropics/claude-code-action/blob/main/docs/security.md - [E12] GitHub docs — About workflows —
https://docs.github.com/en/actions/concepts/workflows-and-actions/about-workflows - [E13] GitHub docs — Events that trigger workflows —
https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows - [E14] GitHub docs — Using secrets in GitHub Actions —
https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use-secrets - [E15] GitHub docs — GitHub Apps vs OAuth apps —
https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/differences-between-github-apps-and-oauth-apps
Enrichment is unusually load-bearing in this chapter because the GitHub-integration surface has moved materially since the book went to print: the action GA'd to @v1 (the book shows @beta), the beta mode: "tag" / mode: "agent" vocabulary and inputs were removed in favour of a single auto-detecting action, the branch name is now a configurable input whose default differs from the book's slash form, the action's example claude.yml listens on more events than the book shows (while the docs' inline "basic workflow" shows fewer), and the action's default behaviour (push-a-branch-and-PR-link, no auto-merge) needs reconciling with the book's "Claude creates a pull request" narrative. The enrichment is used primarily to correct and update the book — see the Drift / Corrections Applied table, which is the most important section of this ledger for Chapter 5. A 2026-06-14 accuracy re-audit (see the drift table) softened several over-claims: the workflow is presented as representative, not canonical; gh is useful, not a required prerequisite for /install-github-app; the two-template chooser and claude-code-review.yml are framed as book-era rather than guaranteed current installer output; the branch suffix is framed as a configurable default; and a dated June-15-2026 subscription-billing caveat was added.
Pedagogical enrichment by the training author
The following additions are not from the book and not from Anthropic or GitHub docs — they are pedagogical material written for this training. They are inventoried here so a reviewer can audit them separately. No inline labels are placed in the learner-facing lesson; only the > Analogy — ... callouts carry an in-lesson label.
- Newcomer preface (
## Before we start — GitHub Actions, workflows, and two kinds of auth in plain language). Defines GitHub Actions, event, workflow, job, step, action (the reusable unit), runner, secret, and the two-credentials distinction (GitHub App vs model credential) in plain English for readers new to CI/CD, plus a smallest-well-formed-workflow YAML example and a note on the issue/PR objects. Grounded in [E12]–[E15] and [E9]; the two-credentials framing is the chapter's central conceptual scaffold. - Per-section analogies. Seven
> Analogy — ...callouts, one per numbered lesson section: §1 the contractor who works after hours; §2 the dispatch desk (event = call, workflow = standing instruction sheet, runner = dispatched truck, action = specialist, two badges = two credentials); §3 onboarding a new hire (gh login = front-desk ID, App = building badge, model credential = payroll, secret store = locked drawer); §4 the eager intern and the load-bearing label; §5 everyone gets a photocopy of the blueprints; §6 the runbook on the wall; §7 the QA bench with its own checklist. - Whole-chapter analogy (
## The whole chapter in one image — the contractor with a key to the shop). A sustained contractor/after-hours analogy that re-frames the chapter's seven sections — install, architecture, the break, branch-per-issue, theCLAUDE.mdfix, and the review gate — for less-technical readers. - Four SVG diagrams authored for this training (the book's figures are not reproduced — we do not have rights):
- Figure P.1 — "Anatomy of a GitHub Actions run" (preface): event → workflow → job-on-runner → steps → result, with a note that secrets are referenced, never written.
- Figure 5.A — "The Claude-on-GitHub loop" (§2):
@claudecomment →claude.yml→ ephemeral runner →claude-code-action@v1→ Claude Code (headless, Agent SDK), with the two independent credentials feeding in and the human-merges-not-Claude endpoint. - Figure 5.B — "Why the rename broke" (§4): local variable → JSON payload → third-party API, before (keys match, accepted) vs after the rename (required key missing, rejected).
- Figure 5.C — "Same issue, two runs" (§6): Run 1 (no
CLAUDE.md, broken integration) vs Run 2 (committedCLAUDE.mdwith the contract gotcha, correct change), side by side. - Each figure has a
figcaptionthat explicitly notes it is pedagogical and not from the book. - "Interactive vs automated" comparison table (§1). Six-row table (where it runs / what starts it / who watches / permission prompts / course-correction / the safety net) contrasting Chapters 1–4's interactive use with this chapter's unattended use. Pedagogical synthesis; the headless "process terminates at a permission boundary" row is grounded in [E5].
- Conceptual activity — "Write the
CLAUDE.mdlines that would stop a 2 a.m. mistake." Ten-minute individual exercise: list 3–5 load-bearing facts an autonomous agent would get wrong, write the singleCLAUDE.mdline for each, decide which need hard enforcement (test/hook) vs advisory context, and trim to 8–10 lines. Includes a stretch task sketching a PR-review workflow (a learner-named copy of one of the action'spr-review-*.ymlexamples) with one--system-promptline and one--allowedTools "Bash(…)"entry. - Practical exercise — "Drive the autonomous loop and prove that context fixes it." A ~35–45 minute hands-on walkthrough with two tracks: Track A wires the real GitHub integration (
/install-github-app, the App, the model credential,@claudeon an issue, review theclaude/issue-…branch without merging); Track B reproduces the chapter's central finding entirely locally with no GitHub account — a tiny repo with a load-bearing payload key, runclaude -pheadless (the same non-interactive mode the Action uses) withoutCLAUDE.md(reproduce the break), then withCLAUDE.md(fix it), then a pytest contract check that passes on the good change and fails on the stashed broken one. Includes a success checklist and common pitfalls. Sandbox is created at~/cct-ch5-lab/, outside the training repo.
Quiz items and learning objectives remain grounded in the book chapter and the labelled enrichment sources — none of the pedagogical analogies, diagrams, the comparison table, the activity, or the exercise steps are themselves assessed.
Objective → Source Mapping
| Learning Objective | Source Section (page) | Enrichment | Confidence | Notes |
|---|---|---|---|---|
Explain how Claude Code runs inside GitHub Actions (event → workflow → claude-code-action@v1 on an ephemeral runner → headless Claude Code on the Agent SDK) and name the two independent credentials (GitHub App for repo access; OAuth token/API key as a secret for model auth). | Book §"Installing and configuring..." (pp. ~1, 3–4) — establishes GitHub Actions as event-driven, the workflow files, and that the token is a secret | [E1], [E5], [E6], [E9], [E12]–[E15] | High — corrected on review. Book shows @beta and a single-event issue_comment excerpt; the lesson uses @v1 and a representative multi-event example workflow (the action's examples/claude.yml currently lists four events; the docs' inline basic workflow shows two — presented as representative, not canonical) per [E1]/[E9]. The SDK was the "Claude Code SDK" in the book era (book p. ~1: "Claude Code SDK"); the lesson uses "Claude Agent SDK" per [E6] and notes the rename. The two-credentials separation is sharpened from the book's looser "the token is a secret" framing using [E9], [E11], [E15]. | |
Install and configure the integration by running /install-github-app from Claude Code (the documented path; gh useful but not required), install the App, choose a model credential, and merge the PR it opens to add an @claude assistant workflow (claude.yml). | Book §"Installing and configuring..." (pp. ~1–4) — closely followed: /git → /install-github-app, gh install/auth, App install, two templates, auth choice, the setup PR adding the YAML files | [E1], [E3], [E9] | High — corrected on review. Lesson presents /install-github-app as a standalone command (book reaches it via /git); frames gh as useful-not-required (current docs list no gh prerequisite for /install-github-app); frames the two-template chooser + claude-code-review.yml as book-era (current docs describe the App + an @claude claude.yml; PR-review workflows are copied in from the examples); uses lowercase .yml (book OCR: .YAML). See drift table. | |
Trigger Claude with @claude, describe the branch-per-issue model (a separate branch under the configurable claude/ prefix, never main; default template yields claude/issue-<number>-<timestamp>) and the default human-in-the-loop safeguard (push a branch + PR link; human reviews/merges). | Book §"Using Claude Code to resolve GitHub issues" (pp. ~4–6) — @claude mention, branch naming, never touches main, full control over review/modify/merge | [E1], [E9], [E11] | High — corrected on review. Branch naming is a configurable input (branch_prefix default claude/; branch_name_template default {{prefix}}{{entityType}}-{{entityNumber}}-{{timestamp}}); the guaranteed part is "a separate branch under claude/, not main," and the book's claude/issue/<number> slash form is noted as older. The book says Claude "automatically creat[es] a pull request"; the action's security doc ([E11]) says the default is push-a-branch + PR-creation link, no auto-open/merge. Lesson reconciles. | |
| Diagnose why an autonomous agent introduces a breaking change without repository context — the third-party-API-contract example and the trust-then-verify gap — and explain why reviewing agent output is non-negotiable. | Book §"Using Claude Code to resolve GitHub issues" → "Reviewing the proposed changes" / "Understanding Claude's workflow" (pp. ~5–6) — the rename breaks the third-party contract; "review any changes carefully rather than accepting them blindly... applies throughout all agentic workflows" | [E4], [E11] | High | The book carries the failure narrative and the review-carefully principle verbatim. The trust-then-verify gap naming and "if you can't verify it, don't ship it" wording are from [E4], not the book. |
Use /init to generate and commit a CLAUDE.md, and explain why committed context improves accuracy for automated runs where no human can course-correct. | Book §"Adding repository context with CLAUDE.md" (pp. ~7–8) — /init scans and writes CLAUDE.md; permission whitelist to .claude/settings.local.json; commit so it's "versioned, shared with the team, and available to Claude Code when running in automated workflows" | [E4], [E7], [E1] | High | The "available during the automated run on the runner" point is the book's; the "advisory, not a hard guarantee; keep it short" caveats and the "persistent context Claude can't infer from code alone" / "common gotchas" framing are from [E4]/[E7]. |
| Describe the layered safety model for autonomous Claude-on-GitHub — scoped App permissions, only-write-access-can-trigger, short-lived repo-scoped tokens, prompt-injection caution, a configurable review workflow, and branch protection — and explain how each compensates for the loss of interactive oversight. | Book §§"Creating the pull request" (security note, p. ~4), "Inspecting Claude's changes" (review system "fully configurable", p. ~8) | [E1], [E2], [E4], [E11] | High — synthesis. The book gives "token stored as a secret," "only users with appropriate access can trigger," and "fully configurable" review; the only-write-access rule, short-lived repo-scoped token, prompt-injection caution, and branch-protection backstop are from [E11]/[E1]. The fresh-context-reviewer argument is from [E4]. |
Lesson Section → Source Mapping
| Lesson section | Source location | Enrichment | Confidence | Notes |
|---|---|---|---|---|
| Preface — GitHub Actions / event / workflow / job / step / action / runner / secret definitions, smallest-workflow YAML, two-credentials framing, issue/PR | Book p. ~1 (GitHub Actions is "serverless," event-driven, YAML workflow files); Book p. ~4 (token stored as a secret) | [E12], [E13], [E14], [E15], [E9] | High | Pedagogical re-framing for newcomers. The "action (the reusable unit) vs GitHub Actions (the platform)" distinction, the fork-secrets property, and the GitHub-App-vs-PAT-vs-OAuth distinction are from [E12]–[E15]; the book does not draw them out. |
| Preface — Figure P.1 (Anatomy of a GitHub Actions run) | n/a — pedagogical diagram | [E12] | n/a | Original SVG. Visualises the generic Actions pipeline; not a reproduction of any book figure. |
| "Why this chapter matters" — the shift from interactive to unattended; Anthropic Product Design team example | Book p. ~1 (integration "already used in real-world production systems"; Anthropic uses it across open-source repos) | [E8] | High — corrected on review. The book's specific public example link (anthropics/skills/actions) is not used (it currently shows Copilot review runs — see drift table); the lesson cites the Product Design team's automated PR-comment workflow from [E8] instead. | |
| §1 — interactive vs automated comparison table; "no one to ask" / headless terminates at a permission boundary | Book pp. ~1, 5–6 (the chapter's motivating contrast, implicit) | [E5] | High — table is pedagogical synthesis; the "process terminates at a permission boundary" row is grounded in [E5] (headless mode). | |
| §1 — analogy: the contractor who works after hours | n/a — pedagogical analogy | n/a | n/a | Original; inline > Analogy — ... callout is the only labelled in-lesson source marker per project convention. |
§2 — the mechanical loop (event → claude.yml → ephemeral runner → claude-code-action@v1 → headless Claude on the Agent SDK → branch → PR, human merges) | Book p. ~1 (event-driven, workflows run on GitHub Actions, "Claude Code CLI and the Claude Code SDK"); Book p. ~4 | [E1], [E5], [E6], [E9] | High — corrected on review. "Claude Agent SDK" replaces book's "Claude Code SDK" per [E6]. The @v1 action and single auto-detecting action (no mode:) per [E1]/[E9]. The "example workflows listen on more than one event" point per [E1]/[E10] — framed as representative, not canonical. The "human merges, not Claude" endpoint per [E11]. | |
| §2 — Figure 5.A (the Claude-on-GitHub loop) | n/a — pedagogical diagram | [E9], [E11] | n/a | Original SVG. Encodes the two-credentials separation and the human-merges endpoint. |
§2 — "details the book's example simplifies" (the @v1 tag, single unified action, more-than-one-event template) | Book p. ~4 (@beta, single issue_comment event) | [E1], [E9] | High — corrected on review. Each correction is in the drift table. | |
| §2 — analogy: the dispatch desk | n/a — pedagogical analogy | n/a | n/a | Original. |
§3 — /install-github-app (standalone); Step 1 gh (optional, not a prerequisite); Step 2 App install; Step 3 the workflow it sets up (@claude assistant claude.yml; review added separately); Step 4 model credential (+ June-15-2026 billing caveat); Step 5 setup PR + a representative claude.yml | Book §"Installing and configuring..." (pp. ~1–4) — closely followed step-by-step | [E1], [E3], [E9] | High — corrected on review. Lesson presents /install-github-app standalone (book: via /git) and frames gh as useful-not-required (current docs list no gh prerequisite). The displayed claude.yml is labelled representative, not canonical — close to the action's examples/claude.yml (multi-event, @v1, least-privilege permissions:, if: mention guard) — with a pointer to verify the live examples. Step 3 frames the book's two-template chooser ("Tag Claude" / "Claude Code Review") as book-era; current docs describe the App + an @claude claude.yml, with PR-review workflows copied in from the examples. Windows/Linux gh install commands added for cross-platform learners (book shows macOS Homebrew only). | |
| §3 — App permission scope (read & write on Contents, Issues, Pull requests) | Book p. ~3 (App "allows Claude to comment, create pull requests, and solve issues") | [E1], [E9], [E15] | High — the specific Contents/Issues/Pull-requests scope is from [E1]/[E9]; the book describes the capability, not the exact permission set. | |
§3 — model credential: OAuth token (claude setup-token, sk-ant-oat01-…, ~1yr, secret CLAUDE_CODE_OAUTH_TOKEN) vs API key (ANTHROPIC_API_KEY); aside on Bedrock/Vertex/Foundry/WIF | Book p. ~3 (long-lived token vs API key; subscription vs large-scale framing) | [E3] | High — corrected on review. The token format, claude setup-token command, validity, and the Bedrock/Vertex/Foundry/WIF aside are from [E3]; the book covers only the two primary paths. | |
§3 — workflow filenames, lowercase .yml | Book pp. ~3–4 (book OCR shows claude.YAML / claude-code-review.YAML) | [E1], [E9] | High — corrected on review. Lesson uses lowercase .yml and notes the uppercase .YAML is an OCR artifact. It also notes a dedicated review workflow (pr-review-*.yml from the examples) is copied in separately rather than being a guaranteed installer output named claude-code-review.yml (book-era). | |
| §3 — Step 4 subscription-token billing caveat (June 15, 2026 Agent SDK credit) | n/a (book pre-dates) | [E3], [E5] | High — added on 2026-06-14 re-audit. Per [E3]/[E5], starting June 15, 2026, Agent SDK / claude -p usage on subscription plans draws from a separate monthly Agent SDK credit; the lesson adds an "as of writing, verify current terms" caveat at the claude setup-token step and in Further Reading. | |
| §3 — analogy: onboarding a new hire | n/a — pedagogical analogy | n/a | n/a | Original. |
§4 — @claude mention fires the workflow; run gets a human-readable name; watch the issue not the raw JSON logs; Claude looks for CLAUDE.md first; repo has none (deliberate) | Book §"Using Claude Code to resolve GitHub issues" (pp. ~4–5) — quoted closely: the "small rename" run name, JSON-logs-vs-issue-view, the to-do list, the missing CLAUDE.md spoiler | [E1] | High | Closely follows the book's worked IceBreaker example. |
| §4 — Claude pushes a branch and surfaces a PR-creation link (default config, human-in-the-loop) | Book p. ~6 (book says Claude "creat[es] a pull request") | [E11] | High — corrected on review. Reconciled per [E11]: default is push-branch + PR link, not auto-open/merge. See drift table. | |
| §4 — the rename breaks a third-party API contract (the load-bearing payload key) | Book §"Reviewing the proposed changes" (pp. ~5–6) — quoted: variable is part of a payload to a third-party service that requires a specific key set; rename breaks the contract | n/a | High | Core book narrative, preserved faithfully. |
| §4 — Figure 5.B (why the rename broke) | n/a — pedagogical diagram | n/a | n/a | Original SVG. Visualises the book's Figs 5.6/5.7 argument; not reproduced. |
| §4 — the trust-then-verify gap; "if you can't verify it, don't ship it"; "review carefully, applies to every agentic workflow" | Book p. ~5 ("review any changes carefully... applies throughout all agentic workflows") | [E4] | High — the review-carefully principle is the book's; the trust-then-verify gap naming and the verification quotes are from [E4]. | |
| §4 — analogy: the eager intern and the load-bearing label | n/a — pedagogical analogy | n/a | n/a | Original. |
§5 — branch-per-issue model (a separate branch under the configurable claude/ prefix, never main); foundation for parallelism / Git worktrees | Book §"Understanding Claude's workflow" (p. ~6) — branch convention, never touches main, full control, parallel instances, worktrees later | [E1], [E9] | High — corrected on review. Branch naming framed as a configurable input (branch_prefix default claude/; default template yields claude/issue-<number>-<timestamp>); the reliable claim is "a separate branch under claude/, not main," and the book's claude/issue/<number> slash form is noted as older. Lesson warns against hard-coding an exact suffix. | |
| §5 — security model around triggering (only write-access can trigger; bots blocked; short-lived repo-scoped token; prompt-injection caution on untrusted content) | Book p. ~4 ("Only users with the appropriate repository access can trigger the workflow") | [E1], [E11] | High — corrected/extended on review. The book gives the access-gating sentence; the bots-blocked-by-default, short-lived-repo-scoped-token, and prompt-injection-on-untrusted-content points are from [E11]. | |
| §5 — analogy: everyone gets a photocopy of the blueprints | n/a — pedagogical analogy | n/a | n/a | Original. |
§6 — Step 1 /init scans and writes CLAUDE.md; permissions whitelisted to .claude/settings.local.json | Book §"Initializing the repository context" (p. ~7) — quoted closely | [E7] | High | |
| §6 — Step 2 review and add the one load-bearing line (the contract gotcha); "persistent context Claude can't infer from code alone" / "common gotchas" | Book §"Reviewing and committing CLAUDE.md" (p. ~7) | [E4], [E7] | High — the gotcha-line framing is pedagogical synthesis grounded in [E4]/[E7]; the book describes reviewing the auto-generated summary but does not name the specific load-bearing line to add. | |
| §6 — Step 3 commit it (versioned, shared, available in GitHub Actions); "Claude respects your CLAUDE.md guidelines" | Book p. ~7 ("versioned, shared with the team, and available to Claude Code when running in automated workflows, such as GitHub Actions") | [E1], [E7] | High — the "Claude respects your CLAUDE.md guidelines and existing code patterns" quote is from [E1]. | |
| §6 — Step 4 re-tag (with the function hint, biased-but-illustrative); consistent rename preserving the payload key | Book §"Inspecting Claude's changes" (p. ~8) — quoted closely, including the biased-experiment admission and the function hint | [E1] | High | |
| §6 — Figure 5.C (same issue, two runs) | n/a — pedagogical diagram | n/a | n/a | Original SVG. Visualises the book's run-1-vs-run-2 contrast. |
§6 — "why context matters more for automated than interactive runs"; CLAUDE.md is advisory, keep it short | Book p. ~8 (context improves accuracy) | [E4], [E7] | High — the advisory-not-a-guarantee and keep-it-short caveats are from [E4]/[E7], added by this training; the book does not flag them. | |
| §6 — analogy: the runbook on the wall | n/a — pedagogical analogy | n/a | n/a | Original. |
§7 — an automated PR-review workflow (copied in from the action's pr-review-*.yml examples) runs on PR open; "fully configurable"; prompt + claude_args knobs (run tests/linters, pin model, --max-turns, inject criteria via --system-prompt) | Book §"Inspecting Claude's changes" (p. ~8) — "This review system is fully configurable. Additional checks, such as linters, test execution, or custom validation rules, can be added" | [E1], [E2], [E10] | High — corrected/extended on review. The book states "fully configurable" generically and installs review as a second template; the lesson frames PR review as a workflow you add from the examples (e.g. pr-review-comprehensive.yml), and the v1 prompt / claude_args model with the specific --allowedTools / --model / --max-turns / --system-prompt examples are from [E1] (the beta mode: inputs were removed — see drift table). | |
| §7 — fresh-context reviewer argument ("Claude won't be biased toward code it just wrote") | n/a (book does not make this argument) | [E4] | High — added on review. Direct quote from [E4]. | |
§7 — distinction: self-hosted review workflow (pr-review-*.yml) vs Anthropic's managed Code Review product (research preview, Team/Enterprise, run on Anthropic infra, ~$15–25/review, bidirectional CLAUDE.md checks) | n/a (book does not cover the managed product) | [E2] | Medium — added on review. The managed Code Review product details (research-preview status, plan-gating, infra, per-review cost, bidirectional CLAUDE.md flagging) are from [E2]; product surface for a preview feature is the kind that moves between releases, hence Medium. | |
| §7 — branch-protection rules as the deterministic backstop | n/a (book does not cover branch protection) | [E1], [E11] | High — added on review. GitHub branch-protection is GitHub-native; the "Claude's review is advice; branch protection is the gate" framing is this training's synthesis grounded in [E1]/[E11]'s least-privilege/human-in-the-loop guidance. | |
| §7 — analogy: the QA bench with its own checklist | n/a — pedagogical analogy | n/a | n/a | Original. |
| Whole-chapter analogy: the contractor with a key to the shop | n/a — pedagogical synthesis | n/a | n/a | Original. Ties the seven numbered sections into one sustained contractor/after-hours analogy. |
Activity: Write the CLAUDE.md lines that would stop a 2 a.m. mistake | n/a — pedagogical | [E4], [E7] | n/a | Original. Ten-minute individual exercise on the learner's own repo; grounded in the §4/§6 lesson and the CLAUDE.md-as-gotchas guidance in [E4]/[E7]. |
| Practical exercise: Drive the autonomous loop and prove that context fixes it (Track A real integration + Track B local headless lab) | Book §§"Installing and configuring...", "Using Claude Code to resolve GitHub issues", "Adding repository context with CLAUDE.md" (pp. ~1–8) — recombined into a two-track hands-on flow | [E1], [E5] | High — original sequencing. Track B uses claude -p headless ([E5]) and a pytest contract check to reproduce the book's break-then-fix locally without GitHub. Sandbox at ~/cct-ch5-lab/ is outside the training repo. |
Unsupported / Pedagogical-Only Claims
The following are statements in the learner-facing lesson that are not from the book and not directly from the labelled enrichment. They are listed so a reviewer can audit them in isolation.
| Item | Justification |
|---|---|
| Contractor-who-works-after-hours analogy (§1) | Pedagogical analogy. No external claim. |
| Dispatch-desk analogy (§2) | Pedagogical analogy. No external claim. |
| Onboarding-a-new-hire analogy (§3) | Pedagogical analogy. No external claim. |
| Eager-intern-and-the-load-bearing-label analogy (§4) | Pedagogical analogy. Restates the book's third-party-contract break with a non-code image. |
| Everyone-gets-a-photocopy-of-the-blueprints analogy (§5) | Pedagogical analogy. Restates the branch-per-issue model. |
| The-runbook-on-the-wall analogy (§6) | Pedagogical analogy. Restates the committed-CLAUDE.md fix. |
| The-QA-bench-with-its-own-checklist analogy (§7) | Pedagogical analogy. Restates the independent-reviewer + branch-protection point. |
| Whole-chapter "contractor with a key to the shop" analogy | Pedagogical synthesis. Re-states the chapter without introducing new claims. |
| Figure P.1 — Anatomy of a GitHub Actions run | Original SVG. Visually re-states the generic Actions pipeline ([E12]). |
| Figure 5.A — the Claude-on-GitHub loop | Original SVG. Visually re-states the §2 mechanical loop with the two-credentials separation. |
| Figure 5.B — why the rename broke | Original SVG. Visually re-states the book's Figs 5.6/5.7 contract-break argument. |
| Figure 5.C — same issue, two runs | Original SVG. Visually re-states the book's run-1-vs-run-2 contrast. |
| "Interactive vs automated" comparison table (§1) | Pedagogical synthesis across Chapters 1–4 and this chapter. The headless-terminates-at-a-permission-boundary row is grounded in [E5]. |
| "The safety that was 'you, watching' has to move somewhere else" framing (§1, recurring) | Pedagogical thesis of the chapter. Synthesises the book's review-carefully principle with the layered safety model; not a single book sentence. |
| "Claude Agent SDK" rename note (§2) | Grounded in [E6]; surfaced as a correction to the book's "Claude Code SDK." Listed here because the rename itself is enrichment-sourced, not book-sourced. |
Conceptual activity (Write the CLAUDE.md lines that would stop a 2 a.m. mistake) | Original pedagogical exercise; grounded in the §4/§6 lesson and [E4]/[E7]. |
| Practical exercise (Drive the autonomous loop), both tracks | Original sequencing; every step is grounded in the book or [E1]/[E5]. Track B sandbox at ~/cct-ch5-lab/ is created outside the training repo. The linkedin.py / issue.md / test_contract.py sandbox files are authored for this training. |
Quiz Item → Source Mapping
| Quiz ID | Item | Source location | Enrichment | Confidence |
|---|---|---|---|---|
| q1 | How you trigger Claude on an issue (@claude mention) and the mechanism (the comment is an issue_comment event matching the on: block of claude.yml, which runs anthropics/claude-code-action@v1 headless on an ephemeral runner). | Book pp. ~1, 4–5 (event-driven workflow, @claude mention) | [E1], [E5], [E9] | High — the @v1 action name and the headless-runner mechanism are from [E1]/[E5]/[E9]; the explanation also surfaces the write-access trigger gate ([E11]). |
| q2 | Why the rename was wrong (load-bearing payload key in a third-party contract; renaming broke it) and the stated takeaway (review carefully, never blindly; applies to every agentic workflow). Distractor d ("committed to main") is wrong on the facts — Claude worked on its own branch. | Book pp. ~5–6 — quoted closely | [E4] | High — the trust-then-verify-gap framing in the explanation is from [E4]; the core claim is the book's. |
| q3 | How Claude applies changes (a separate auto-created branch under the configurable claude/ prefix, never main) and why it's foundational for scaling (isolated branches → parallel Claude instances → Git worktrees later). | Book p. ~6 — quoted; branch-naming reframed | [E1], [E9] | High — corrected on 2026-06-14 re-audit. Option b and the explanation now lead with "a separate branch under the claude/ prefix"; the claude/issue-<number>-<timestamp> form appears only as the configurable default template, with the book's older claude/issue/<number> slash form noted and a warning against hard-coding an exact suffix. |
| q4 | What /init does (scans repo, writes CLAUDE.md of stack/structure/conventions) and why committing it helps automated runs (the runner reads the committed file; gives the agent repo-specific facts it can't infer — the "don't rename this payload key" gotcha). | Book pp. ~7–8 — quoted closely | [E1], [E7] | High |
| q5 | How the model credential is handled (stored as a GitHub Actions secret, set up automatically, referenced ${{ secrets.… }}, never inline) and the two options (OAuth token CLAUDE_CODE_OAUTH_TOKEN via claude setup-token; API key ANTHROPIC_API_KEY). | Book pp. ~3–4 — quoted | [E3], [E14] | High — the explanation's Bedrock/Vertex/Foundry aside is from [E3]; the secret-handling mechanics from [E14]. |
| q6 | Synthesis: how the layered safety model compensates for lost live oversight — committed context substitutes for live correction; scoped/short-lived/repo-only App token; only write-access can trigger; untrusted content = prompt-injection risk; a review gate (fresh-context reviewer + real tests via claude_args + branch protection); no auto-merge by default. | Book pp. ~4, 8 (token-as-secret, access-gating, "fully configurable" review) | [E1], [E2], [E4], [E11] | High — synthesis. The only-write-access rule, short-lived repo-scoped token, prompt-injection caution, fresh-context-reviewer argument, and no-auto-merge default are enrichment-sourced ([E11]/[E4]/[E1]); the book supplies the skeleton. This is the chapter's one enrichment-grounded synthesis question. |
Drift / Corrections Applied
Places where the book is out of date or partly wrong, and what the lesson does about it. This is the most important section for Chapter 5 — the book is materially stale on the GitHub-integration surface, which moved to a GA'd @v1 action after the book went to print. Each row is verified against the current canonical docs ([E1], [E3], [E5], [E9], [E11]). Re-audited 2026-06-14 against examples/claude.yml, action.yml, usage.md, the github-actions / authentication / headless / code-review docs, and the examples/ directory listing — this pass softened several over-claims (representative-not-canonical workflow; gh not a required prerequisite; book-era two-template chooser; configurable branch suffix) and added the gh-prerequisite and June-15-2026 billing rows.
| Drift | Book position | Current position | Lesson treatment |
|---|---|---|---|
| Action version | Book's workflow YAML uses uses: anthropics/claude-code-action@beta (p. ~4). | The action GA'd to @v1 (released 2025-08-26). @beta is an earlier build. | §2 and §3 use anthropics/claude-code-action@v1 throughout; §2's "details the book simplifies" bullet states the @beta tag is from an earlier build. Quiz q1 names @v1. |
| Branch naming convention | Book writes the branch as claude/issue/<issue-number> (p. ~6), presented as the convention. | Branch naming is a configurable input: branch_prefix defaults to claude/, and branch_name_template defaults to {{prefix}}{{entityType}}-{{entityNumber}}-{{timestamp}} (yielding claude/issue-<number>-<timestamp>, e.g. claude/issue-950-20250711_082715) per the action's action.yml. The user-facing docs/README/usage.md say nothing about branch naming. The slash form claude/issue/<number> is not used by current tooling. | Re-audited 2026-06-14. §5 and quiz q3 now teach "a separate branch under the configurable claude/ prefix, never main" as the reliable claim; the claude/issue-<number>-<timestamp> form is shown only as the default template output, with both the prefix and template called out as configurable and a warning not to hard-code an exact suffix. The book's slash form is noted as older. |
| Install templates / review workflow | Book describes the installer presenting a two-template chooser — "Tag Claude" and "Claude Code Review" — and says it creates claude.YAML + claude-code-review.YAML (pp. ~3–4). | Current docs ([E1]) do not describe a template chooser or a claude-code-review.yml filename. /install-github-app sets up the App + required secret and an @claude assistant workflow (claude.yml); the manual fallback copies a single examples/claude.yml. Automated PR review is a separate workflow you copy from the examples (pr-review-comprehensive.yml, pr-review-filtered-paths.yml, manual-code-analysis.yml — there is no claude-code-review.yml in examples/). "Tag Claude" reflects the removed beta mode: "tag" vocabulary. | Re-audited 2026-06-14. §3 Step 3 now frames the two-template chooser and the claude-code-review.yml filename as the book's (book-era) description, states current /install-github-app sets up the App + @claude claude.yml, and tells the learner PR-review workflows are copied in from the examples. §3 Step 5 and §7 are aligned. The activity stretch task now sketches a learner-named PR-review workflow (from the pr-review-*.yml examples) — its earlier claude-code-review.yml filename was removed so the term isn't read as an installer output. |
| Workflow file extension casing | Book OCR shows the filenames as claude.YAML / claude-code-review.YAML (pp. ~3–4). | Workflow files are lowercase .yml — e.g. the assistant claude.yml and the example review workflows (pr-review-comprehensive.yml, etc.). The uppercase .YAML is an OCR artifact; the name claude-code-review.yml specifically is the book's and is not a current installer output (see the row above). | §3 Step 5 uses .yml and states "that uppercase extension is an OCR artifact; the real files are lowercase .yml." (The extracted .md retains the book's .YAML because it's the verbatim source-of-truth.) |
on: events / "the canonical workflow" | Book's claude.yml excerpt shows only on: issue_comment: types: [created] (p. ~4), presented as the workflow. | There is no single canonical/minimal workflow. The action's examples/claude.yml currently lists four events (issue_comment [created], pull_request_review_comment [created], issues [opened, assigned], pull_request_review [submitted]); the docs' inline "basic workflow" shows only two (issue_comment, pull_request_review_comment); and the examples/ directory has ~10 workflow files ([E1]/[E10]). | Re-audited 2026-06-14. §2 now says "the example workflows listen on more than one event" and labels any single file representative, not canonical; §3 Step 5 introduces its YAML as "a representative claude.yml … verify against the live examples directory," not "the current minimal/shipped template." The shown block matches examples/claude.yml's four events (with correct per-event types). |
Single unified action vs mode: inputs | Book's @beta action used mode: "tag" / mode: "agent" inputs to switch behaviour. | v1 is a single unified action that auto-detects whether it's responding to an @claude mention or running an automation; the old mode: inputs are removed ([E1]/[E9]). | §2's "details the book simplifies" bullet states there's "now a single unified action that auto-detects... so the old mode: \"tag\" / mode: \"agent\" inputs are gone." §7's claude_args discussion reflects the v1 configuration model (prompt + claude_args), not mode:. |
| Model authentication paths | Book offers only OAuth-token-vs-API-key (p. ~3). | The current action also supports Amazon Bedrock, Google Vertex AI, Microsoft Foundry, and Workload Identity Federation ([E3]). | §3 Step 4 keeps the two as the primary choice (matching the chapter's narrative) and adds a parenthetical aside naming Bedrock/Vertex/Foundry/WIF "if your org needs them." Quiz q5's explanation mentions the extras but the question stays on the two primary paths. |
| Default no-auto-merge / human-in-the-loop | Book narrative says Claude "automatically creat[es] a pull request" and "Claude initializes the integration by... automatically creating a pull request" (pp. ~4, 6) — reads as Claude opening the PR. | Per the action's security doc ([E11]), the default is that Claude commits to a branch and provides a PR-creation link — it does NOT auto-open or merge the PR; a human creates/merges it (configurable). | §2 step 6, §4, and §5 state Claude "pushes a branch and surfaces a PR link" and that "a human reviews and merges." The default-no-auto-merge safeguard is a recurring thread (preface, §2 figure, §4, common-pitfalls). Quiz q6's correct option includes "Claude also doesn't auto-merge by default." NB: the setup PR in §3 Step 5 (the one that adds the workflow files) is genuinely opened by the install flow — that's distinct from the per-issue task PRs, which follow the push-branch-+-link default. |
/install-github-app invocation | Book reaches the command by typing /git first, which "reveals the /install-github-app command" (p. ~1). | Current builds expose /install-github-app as a standalone command; the "via /git" routing is unverified in current docs. | §3 presents /install-github-app as a standalone command directly, with a one-line note: "The book reaches this via typing /git first; in current builds /install-github-app is a standalone command you can invoke directly." |
| SDK name | Book calls the SDK powering the integration the "Claude Code SDK" (p. ~1). | The SDK was renamed the "Claude Agent SDK" ([E6]). | §2 uses "Claude Agent SDK" and notes the rename inline: "the SDK was previously called the 'Claude Code SDK.'" The objective and figure caption use "Agent SDK." |
| Anthropic dogfooding link | Book cites https://github.com/anthropics/skills/actions (p. ~1) as a public example of Anthropic using Claude Code via GitHub Actions. | That page currently shows GitHub Copilot review runs, not claude-code-action — it does not demonstrate the book's claim as of 2026-06-13. | The lesson does not use the anthropics/skills/actions link. "Why this chapter matters" instead points to the anthropics/claude-code-action/examples directory ([E10]) and the "How Anthropic teams use Claude Code" post ([E8], the Product Design team's automated PR comments) as the real-world references. The "Further reading" list cites [E8], [E9], and [E10]. |
gh CLI as a prerequisite | Book walks through installing and authenticating the gh CLI as a required prerequisite before running /install-github-app (pp. ~1–2). | Current docs ([E1]) do not list gh as a prerequisite for /install-github-app — the documented setup is just "open claude and run /install-github-app" (the only stated requirement is repo-admin access, plus being a direct Claude API user for the quickstart path). | Added on 2026-06-14 re-audit. §3 Step 1 is retitled "(Optional) the GitHub CLI" and states gh is "useful for checking repo/auth state but not a required prerequisite"; the documented path is running /install-github-app in a repo you administer. Objective 2, the §3 mapping, and the practical-exercise Track A steps are aligned (Track A makes gh optional). |
| Subscription-token billing (June 15, 2026) | Book pre-dates this; offers the subscription OAuth token for CI with no billing caveat (p. ~3). | Per [E3] and [E5] (verbatim on both pages): "Starting June 15, 2026, Agent SDK and claude -p usage on subscription plans will draw from a new monthly Agent SDK credit, separate from your interactive usage limits." The GitHub Action runs Claude headlessly via the Agent SDK, so a subscription token in CI is in scope. | Added on 2026-06-14 re-audit (the date is one day out — effective 2026-06-15). §3 Step 4 adds an "as of writing — verify the current terms" caveat at the claude setup-token bullet; the Further-Reading authentication bullet repeats it. Canonical wording is singular "a new monthly Agent SDK credit." |
PDF page-number caveat
The Chapter 5 extraction lacked clean form-feed page boundaries, so the cleaned extracted-chapters/05-chapter-05.md uses approximate <!-- page N --> markers (8 of them, hand-placed at section transitions). All page references in this ledger (p. ~N) are therefore approximate and based on those reconstructed boundaries, not on printed book page numbers or reliable form-feed positions. The printed book may number these differently. Cross-check with the printed book if exact pagination is required; the section names ("Installing and configuring the Claude Code GitHub integration," "Using Claude Code to resolve GitHub issues," "Adding repository context with CLAUDE.md") are the more reliable locators.
Source PDF: source-pdfs/05-chapter-05.pdf
Extracted source: extracted-chapters/05-chapter-05.md