GitHub Actions and Code Review
The best place to hand off repetitive work is the pull request. It's where review happens, where changes land, and where a lot of your busywork lives. There are two ways to put Claude to work here, and they solve different problems. One is a managed service you turn on. The other is a GitHub Action you wire up yourself. Let's walk through both and figure out when to reach for each.
한국어 대본
- 00:00반복 작업을 넘겨주기 가장 좋은 곳은 pull request입니다. 이를 처리하는 방법은 두 가지입니다.
- 00:07관리형 방식은 CodeReview입니다. Anthropic이 호스팅하는 서비스로, Claude GitHub
- 00:12앱을 통해 PR을 검토하고 직접 빌드하거나 호스팅할 필요 없이 인라인 댓글로 발견 사항을 게시합니다.
- 00:16직접 구축하는 방식은 Claude Code GitHub action으로, 검토를 넘어
- 00:21사용자 지정 CI까지 필요한 작업에 적합합니다. 조직 관리자가 Claude Code 관리자 설정에서 이를 켜고,
- 00:27Claude GitHub 앱을 설치한 다음 감시할 리포지터리와 실행 시점을 선택합니다.
- 00:32PR이 열릴 때 한 번, 모든 push마다, 또는 누군가 Claude review에 댓글을 남길 때 실행할 수 있습니다.
- 00:38그다음에는 Anthropic 인프라에서 실행됩니다.
- 00:40검토 에이전트들이 전체 코드베이스를 기준으로 diff를 분석하고 발견 사항을
- 00:46특정 줄에 심각도 태그를 붙인 인라인 댓글로 게시하며 check run에 요약 표를 제공합니다.
- 00:50중복을 제거하고 우선순위를 정하므로 사소한 지적이 가득한 글 대신 실제 발견 사항 몇 개만 읽으면 됩니다.
- 00:54PR을 승인하거나 차단하지는 않습니다.
- 00:57판단은 사람이 내립니다.
- 00:59CodeReview는 현재 팀 및 엔터프라이즈 플랜에서 제공되는 리서치 프리뷰이므로,
- 01:02동작이 계속 바뀔 수 있다고 예상해야 합니다.
- 01:04그리고 관리형 자동 수정 기능은 없습니다.
- 01:06서비스는 발견 사항만 게시합니다.
- 01:08적용은 자체 터미널에서 수행하는 로컬 작업입니다.
- 01:11`/code review` 명령이 diff를 검토하고 `--fix` 플래그가
- 01:14발견 사항을 작업 트리에 적용합니다.
- 01:18action은 검토를 넘어서는 작업을 다룹니다.
- 01:20댓글에서 요청한 변경을 구현하거나, 예약 보고서를 만들거나,
- 01:23워크플로로 작성할 만한 모든 작업이 여기에 해당합니다.
- 01:24에이전트는 PR 댓글, 예약 작업, 모든 GitHub 이벤트에서 실행됩니다.
- 01:28Claude Code 안에서 `/install github app` 명령을 실행할 수 있습니다.
- 01:33이 작업에는 리포지터리 관리자 권한이 필요합니다.
- 01:35슬래시 명령이 GitHub 앱 설치와
- 01:38리포지터리에 Anthropic API 키 시크릿을 설정하는 과정을 안내합니다.
- 01:40action 자체는 `anthropics/claude-code-action@v1`입니다.
- 01:45사용할 입력값 중 필수 항목은 Anthropic API 키입니다.
- 01:48GitHub 토큰은 기본값이 `secrets.GITHUB_TOKEN`입니다.
- 01:51트리거 문구는 댓글에서 action이 수신하는 내용으로, 기본값은
- 01:57`@Claude`입니다. Bedrock이나 Vertex를 사용한다면 해당 프로바이더로 전환할 수 있고, 프롬프트는
- 02:01실행 지침이며 Claude Code에 전달되는 CLI 인자 문자열인 Claude arguments도 지정합니다.
- 02:05이를 `.github/workflows/claude.yml`에 넣으면
- 02:11PR 댓글과 이슈 댓글에서 `@Claude`를 수신합니다. 누군가 PR에
- 02:16`@Claude, 연결된 Linear 이슈의 사양을 구현해 줘`라고 작성하면 action이 이를 처리합니다.
- 02:21Claude가 커밋을 push하고 수행한 작업을 댓글로 게시합니다.
- 02:25이것은 일일 요약 작업입니다.
- 02:26Cron이 UTC 9시에 실행되면 action이 작동하고 Claude가 결과를 게시합니다.
- 02:30workflow dispatch 트리거를 사용하면 수동으로 실행할 수도 있습니다.
- 02:33Actions 탭에서 실행합니다.
- 02:35Claude args 줄에서 이 모든 세부 조정을 수행합니다.
- 02:38max turns를 5로 설정했습니다.
- 02:40이렇게 하면 에이전트 루프에 상한이 생깁니다.
- 02:42permission mode에는 `dontAsk`를 설정했습니다.
- 02:44무인 실행 모드입니다.
- 02:45allow tools는 이 작업에 꼭 필요한 설정입니다.
- 02:48보고서용으로는 읽기 전용으로 설정합니다.
- 02:51PR 검토에는 관리형 경로를 사용해 code review를 활성화하고 GitHub 앱이 인라인
- 02:58발견 사항을 게시하게 한 다음, `/code review --fix`로 로컬에서 수정 사항을 적용하세요.
- 03:01검토 이상의 작업에는 action을 사용하세요.
- 03:04설정에는 GitHub 앱 설치, `@Claude` 멘션용 워크플로 하나, cron용 워크플로 하나를 사용하고,
- 03:09나머지는 모두 Claude args에서 조정합니다.
The managed path: Code Review
The simplest option is Code Review. It's an Anthropic-hosted service that reviews your pull requests through the Claude GitHub app. There's nothing for you to build or host. You turn it on, and it starts posting findings as inline comments right on the lines that matter.
An organization admin enables it from the Claude Code admin settings. You'll find a Code review section with a Configure button that hooks it up to your repositories.
From there the admin installs the Claude GitHub app, picks which repos it watches, and decides when it runs. You have a few choices for timing:
- Once when a PR opens
- On every push to the PR
- Only when someone comments
@claude review
Once it's on, everything runs on Anthropic's infrastructure. A set of review agents analyzes the diff against your full codebase, not just the changed lines in isolation. Then it posts findings as inline comments on the specific lines, tagged by severity, with a summary table in the check run.
Here's what one of those findings looks like. It lands as a comment from Claude, right on the line, with a clear explanation and a suggested fix.
The nice part is it deduplicates and ranks the findings. So instead of a wall of nitpicks, you read a handful of real issues worth your attention.
What Code Review will and won't do
A couple of things to keep in mind about the boundaries here:
- It never approves or blocks the PR. The judgment call stays with a human. Claude flags things; you decide.
- There's no managed autofix. The service posts findings only.
- It's a research preview right now, available on team and enterprise plans, so expect the behavior to keep moving.
Since there's no autofix in the service, applying a finding is a local move. From your own terminal, the /code-review command reviews a diff, and its --fix flag applies the findings to your working tree. So the flow is: Claude finds it in the PR, you pull it down and fix it locally.
The do-it-yourself path: the GitHub Action
Code Review handles review. When the job goes beyond review, you reach for the GitHub Action. This is for custom CI: implementing changes from a comment, running scheduled reports, anything you'd normally write a workflow for. It runs the agent on PR comments, scheduled jobs, and any GitHub event.
Setup starts inside Claude Code. Run the /install-github-app command. You'll need repo admin to do this. The slash command walks you through installing the GitHub app and setting the Anthropic API key secret on the repo.
The action itself is anthropics/claude-code-action@v1. Here are the inputs you'll actually use:
anthropic_api_key— optional.github_token— defaults tosecrets.GITHUB_TOKEN.trigger_phrase— what the action listens for in comments. Defaults to@claude.use_bedrock/use_vertex— switch to those providers if you're on Bedrock or Vertex.prompt— the instruction for the run.claude_args— a string of CLI arguments passed straight through to Claude Code.
A workflow that responds to @claude
Drop a workflow into .github/workflows/claude.yaml and it listens for @claude on PR comments and issue comments. The core step looks like this:
Now someone writes @claude implement the spec in the linked Linear issue on a pull request, and the action picks it up. Claude pushes commits and posts comments describing what it did.
A workflow that runs on a schedule
The same action works for a daily rollup. A cron trigger fires at, say, 9:00 UTC, the action runs, and Claude posts the results. You can also add a workflow_dispatch trigger so you can kick it off manually from the Actions tab.
When the action runs, you can watch it work through the steps in the Actions tab, just like any other GitHub workflow.
Tuning the run with claude_args
The claude_args line is where the fine-tuning happens. A few knobs worth knowing:
--max-turns 5puts a hard cap on the agent loop, so it can't run forever.- Permission mode. For an unattended job you'll want it to not stop and ask, since there's no one there to answer.
- Allowed tools. Give the job exactly what it needs and nothing more. For a report, that means read-only.
Which one should you use?
Here's the short version:
- For PR reviews, take the managed path. Enable Code Review, let the GitHub app post inline findings, and apply fixes locally with
/code-review --fix. - Reach for the action when the job is more than review. Use
/install-github-appfor setup, one workflow for@claudementions, one for cron, and all the tuning lives inclaude_args.
Start with the managed service. Move to the action the moment you need Claude to actually do something in CI, not just comment on it.