Files
ironclaw/.github/workflows/claude-review.yml
dependabot[bot] c1db630b1f chore(deps): bump the actions group across 1 directory with 5 updates
Bumps the actions group with 5 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [anthropics/claude-code-action](https://github.com/anthropics/claude-code-action) | `1.0.183` | `1.0.208` |
| [actions/setup-node](https://github.com/actions/setup-node) | `4.0.2` | `7.0.0` |
| [Swatinem/rust-cache](https://github.com/swatinem/rust-cache) | `e18b497796c12c097a38f9edb9d0641fb99eee32` | `f0d9c3887740aee45f6153b24b3a6b815192ec16` |
| [docker/login-action](https://github.com/docker/login-action) | `4.5.2` | `4.6.0` |
| [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) | `4.2.0` | `4.3.0` |



Updates `anthropics/claude-code-action` from 1.0.183 to 1.0.208
- [Release notes](https://github.com/anthropics/claude-code-action/releases)
- [Commits](be7b93b190...e8c2d7c16c)

Updates `actions/setup-node` from 4.0.2 to 7.0.0
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v4.0.2...v7)

Updates `Swatinem/rust-cache` from e18b497796c12c097a38f9edb9d0641fb99eee32 to f0d9c3887740aee45f6153b24b3a6b815192ec16
- [Release notes](https://github.com/swatinem/rust-cache/releases)
- [Changelog](https://github.com/Swatinem/rust-cache/blob/master/CHANGELOG.md)
- [Commits](e18b497796...f0d9c38877)

Updates `docker/login-action` from 4.5.2 to 4.6.0
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](371161bbe7...dbcb813823)

Updates `docker/setup-buildx-action` from 4.2.0 to 4.3.0
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](bb05f3f551...37fe631027)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: anthropics/claude-code-action
  dependency-version: 1.0.198
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: docker/login-action
  dependency-version: 4.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: docker/setup-buildx-action
  dependency-version: 4.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: Swatinem/rust-cache
  dependency-version: f0d9c3887740aee45f6153b24b3a6b815192ec16
  dependency-type: direct:production
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-30 20:16:14 +00:00

128 lines
5.9 KiB
YAML

name: Claude Code Review
on:
issue_comment:
types: [created]
permissions:
contents: read
pull-requests: write
issues: write
id-token: write
concurrency:
group: claude-review-${{ github.event.issue.number || github.run_id }}
cancel-in-progress: true
jobs:
review:
name: Claude Code Review
if: >
github.event.issue.pull_request &&
contains(github.event.comment.body, '@claude review') &&
github.event.comment.author_association == 'MEMBER'
runs-on: ubuntu-latest
timeout-minutes: 30
env:
PR_NUMBER: ${{ github.event.issue.number }}
steps:
- name: Check PR trust boundary
id: pr_metadata
env:
GH_TOKEN: ${{ github.token }}
run: |
is_cross_repository="$(
gh pr view "$PR_NUMBER" \
--repo "$GITHUB_REPOSITORY" \
--json isCrossRepository \
--jq .isCrossRepository
)"
echo "is_cross_repository=${is_cross_repository}" >> "$GITHUB_OUTPUT"
if [ "${is_cross_repository}" = "true" ]; then
echo "Skipping Claude review for forked pull request #${PR_NUMBER}."
fi
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
if: steps.pr_metadata.outputs.is_cross_repository != 'true'
with:
ref: refs/pull/${{ env.PR_NUMBER }}/merge
fetch-depth: 0
persist-credentials: false
- name: Run Claude Code review
if: steps.pr_metadata.outputs.is_cross_repository != 'true'
uses: anthropics/claude-code-action@e8c2d7c16c018cf1e694711c1c07a5f5db2b5eb1 # v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
allowed_bots: "ironclaw-ci[bot]"
claude_args: "--max-turns 50 --model claude-haiku-4-5-20251001 --allowedTools 'Read,Glob,Grep,Agent,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*),Bash(gh issue view:*),Bash(gh issue list:*),Bash(gh search:*),Bash(git blame:*),Bash(git log:*),Bash(git diff:*)'"
prompt: |
Code review pull request #${{ env.PR_NUMBER }}. Follow these steps precisely:
1. Find relevant CLAUDE.md files: the root CLAUDE.md and any CLAUDE.md files
in directories whose files this PR modifies. Use Glob to find them, then Read
to load their contents.
2. Get the PR diff with `gh pr diff ${{ env.PR_NUMBER }}` and summarize the change.
3. Launch 4 parallel agents to review the change independently. Each agent should
read the PR diff with `gh pr diff ${{ env.PR_NUMBER }}` and the full source files
for changed code, then return a list of issues. Each agent MUST score its own
findings inline using the severity and confidence rubric below.
Severity levels:
- CRITICAL: security vulns, panics in prod (.unwrap/.expect), data exfiltration, race conditions
- HIGH: logic bugs, missing error handling, breaking API/schema changes
- MEDIUM: missing tests, unnecessary complexity, performance issues
- LOW: documentation gaps, naming suggestions
Confidence scoring (0-100):
0: False positive, doesn't stand up to scrutiny, or pre-existing issue.
25: Might be real, but may be false positive. Stylistic issues not in CLAUDE.md.
50: Real issue but nitpick or rare in practice. Not very important.
75: Verified real issue, will be hit in practice. Directly impacts functionality
or explicitly mentioned in CLAUDE.md.
100: Certain, confirmed, will happen frequently. Evidence directly confirms.
Each agent returns findings as: [SEVERITY:CONFIDENCE] <brief description>
Agent 1 — Security & Safety
Check for: command injection, path traversal, SSRF, XSS, auth bypass,
secrets in logs, .unwrap()/.expect() in production code (not tests),
race conditions, TOCTOU, unsafe blocks, panics in async, unbounded allocations.
Agent 2 — Architecture & Patterns
Check for: extensible design, clean abstractions, proper error types,
CLAUDE.md compliance, type-driven design over stringly-typed code, DRY violations.
Agent 3 — Bug Scan
Shallow diff-only scan for obvious bugs: logic errors, off-by-one,
missing error handling, division by zero, incorrect return values.
Ignore nitpicks and likely false positives.
Agent 4 — Performance & Production
Check for: blocking in async, N+1 queries, unbounded loops, missing
timeouts, resource leaks, and large allocations in hot paths.
4. Consolidate all agent findings and post exactly one comment on PR #${{ env.PR_NUMBER }}
using `gh pr comment ${{ env.PR_NUMBER }}`. If no issues were found, post
"No issues found." instead.
### Code review
Found N issues:
1. [SEVERITY:CONFIDENCE] <brief description>
<permalink to file:line using full SHA, eg https://github.com/owner/repo/blob/abc123def/src/file.rs#L10-L15>
IMPORTANT rules:
- Only YOU (the main process) may call `gh pr comment`. Agents must return
their findings to you; they must NOT post comments themselves.
- You MUST post exactly one `gh pr comment` before finishing, even if agents
fail or return empty results. If review is incomplete, post "No issues found."
- Use Read/Glob for file access and `gh` for GitHub interactions.
- Do NOT build or test the code.
- Ignore pre-existing issues not introduced by this PR.
- Ignore issues a linter/compiler would catch.