Skip to content

Implement negative structural evidence #2

Implement negative structural evidence

Implement negative structural evidence #2

name: Claude — Review PR
on:
pull_request:
types: [opened, synchronize, ready_for_review, reopened]
jobs:
review-pr:
if: |
github.event.pull_request.draft == false && (
github.event.pull_request.user.login == 'claude[bot]' ||
github.event.pull_request.author_association == 'OWNER' ||
github.event.pull_request.author_association == 'MEMBER' ||
github.event.pull_request.author_association == 'COLLABORATOR' ||
github.event.pull_request.author_association == 'CONTRIBUTOR'
)
runs-on: self-hosted
permissions:
contents: read
pull-requests: write
issues: read
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
ref: ${{ github.event.pull_request.head.ref }}
- name: Review PR
id: review-pr
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
claude_args: "--model claude-opus-4-6 --dangerously-skip-permissions"
allowed_bots: 'claude[bot]'
prompt: |
Review PR #${{ github.event.pull_request.number }} in ${{ github.repository }}.
Use `gh pr diff ${{ github.event.pull_request.number }}` to read the diff and `gh pr view ${{ github.event.pull_request.number }}` for context. Run `uv run pytest` to check if tests pass.
Review the changes for bugs, logic errors, security issues, and CLAUDE.md compliance. Focus on high-signal issues only — do not flag style nits, potential issues that depend on specific inputs, or subjective suggestions.
Pay special attention to cleanliness: the codebase should look like it was always designed this way. Flag any leftover dead code, backward-compatibility shims, or half-finished refactors as issues worth fixing.
Then submit a formal review:
- If there are no issues: `gh pr review ${{ github.event.pull_request.number }} --approve -b "Looks good."`
- If there are issues: `gh pr review ${{ github.event.pull_request.number }} --request-changes -b "<description of issues>"` with a clear explanation of each issue and what needs to change.