← Blog

Claude Code GitHub Actions: Where the Evidence Can Actually Land

Marco Masut

Claude Code GitHub Actions is the official GitHub Action, anthropics/claude-code-action, that runs Claude Code inside a repository's workflows. It answers @claude mentions in issues and pull requests, or runs a fixed prompt on any GitHub event such as a pull request or a schedule. To set it up you install the Claude GitHub App, store an ANTHROPIC_API_KEY secret and add a workflow file with contents, pull-requests and issues permissions. Most of the work is the setup, and this piece covers it. The part people skip is what the run leaves behind. What Claude says about its own work is a claim. What the runner executes on a clean machine, with a log nobody edits afterwards, is a record. A pull request is the natural place to turn the first into the second, before anyone merges.

The configuration below follows the official Claude Code documentation, checked on 29 October 2026. Action inputs and permissions change between versions, so check the page again before copying anything.

How do you run Claude Code inside a pull request?

The action has two modes, chosen by one input. Without a prompt, it is interactive: it waits for the trigger phrase @claude in a comment, a review or a new issue, and replies there. With a prompt, it is automation: it runs on its own on the event you chose, and the result goes to the workflow log unless the prompt tells it to post a comment.

| | Interactive | Automation | | --- | --- | --- | | Trigger | @claude in a comment or review | Any event: pull_request, schedule, others | | prompt input | Absent | Present | | Where the result goes | A comment on the issue or PR | The workflow run log, or a comment if asked | | Typical use | "Fix this", "explain this" | Review every PR, daily report |

Source: Claude Code documentation, "Interactive and automation modes", checked on 29 October 2026.

How do you set up permissions, secrets and triggers?

The documented manual setup has three steps.

  1. Install the Claude GitHub App on the repository. The action relies on three of its permissions: contents, issues and pull requests, each read and write.
  2. Add a secret: ANTHROPIC_API_KEY for an API key, or CLAUDE_CODE_OAUTH_TOKEN for a subscription token generated with claude setup-token. Never commit either to the repository.
  3. Copy a workflow into .github/workflows/. A review on every pull request looks like this in the documentation, with the job's permissions kept to read:
name: Code Review
on:
  pull_request:
    types: [opened, synchronize, ready_for_review, reopened]
jobs:
  review:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: read
      issues: read
      id-token: write
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: 1
      - uses: anthropics/claude-code-action@v1
        with:
          anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
          prompt: "Review this pull request and list the risks"

A few details decide whether it works. The user who triggers the run needs write access to the repository, and bot actors are rejected unless listed in allowed_bots. On public repositories, GitHub withholds secrets from runs triggered by pull requests from forks, so the review only runs on branches in the same repository. Commits pushed with the default GITHUB_TOKEN do not trigger other workflows, which is why the documentation tells you not to pass it if you want your CI to run on Claude's commits. And since every run spends runner minutes and API tokens, cap it with --max-turns in claude_args and a workflow timeout.

Why is CI output different from anything the agent says about itself?

Because of who produces it. An agent's summary of a session is written by the same system that made the change. It can be accurate, and it can be confidently wrong. A CI job is different on three counts:

  • it runs on a fresh machine, not on the environment where the change was made;
  • it executes a command you declared in advance, and the exit code is not negotiable;
  • it leaves a log tied to a commit, a time and a workflow definition that sits in the repository.

That is what makes CI the one place in the flow where the evidence can land. It is also why hooks and the agent's own checks are useful but not sufficient: they run inside the session. The same reasoning is behind the view that an AI review tool reads the change but does not record who decided.

How do you go from a green check to a signable record?

A green check says that a command passed. It does not say which requirement the command was meant to prove, what the change was allowed to touch, or who accepted the result. To get from one to the other you need a short list of things stored next to the check:

  1. the request or requirement behind the change;
  2. the declared scope, compared with the files actually modified;
  3. the exact command the pipeline ran, its date and its outcome;
  4. the commit and workflow version that produced it;
  5. the name of whoever approved the merge, as a verifiable signature and not a click on a button.

Detent, the end-to-end delivery line (detent-ai.com), works this way: the runner executes the verification itself rather than trusting the model's word, and a named person signs before the release. For the broader question of what a trail has to contain, see the audit trail when an agent made the change.

What still needs a human before the merge?

A workflow can run the review and the tests. It cannot decide that the change is the right one. Three things stay with a person:

  • whether the requirement was the right requirement, which a test only checks against its own assumptions;
  • whether the workflow itself is trustworthy: who can edit .github/workflows/, and with which permissions the job runs;
  • the decision to release, which is a signature and not an exit code.

Run Claude Code in CI because it is the best place to make its work checkable, and treat the green check as the start of the evidence. On how to measure what a delivery line really leaves behind, see the bench.