Skip to content

The cross-harness, self-improving memory layer for AI agents. Join our community: https://discord.com/invite/zdNChS2fBu

Add Claude PR review and security review to CI

Claudebd58b86ea551
diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml
new file mode 100644
index 00000000..5c67fb0b
--- /dev/null
+++ b/.github/workflows/claude-code-review.yml
@@ -0,0 +1,64 @@
+name: Claude Code Review
+
+# Claude reviews each ready-for-review PR for bugs and posts inline comments plus a summary.
+# Setup: add the ANTHROPIC_API_KEY secret (repo or org). CLAUDE_CODE_OAUTH_TOKEN works
+# instead via the claude_code_oauth_token input.
+
+on:
+ pull_request:
+ types: [opened, synchronize, ready_for_review, reopened]
+
+concurrency:
+ group: claude-code-review-${{ github.event.pull_request.number }}
+ cancel-in-progress: true
+
+jobs:
+ review:
+ # Skip drafts, and fork PRs (secrets are not available to them).
+ if: >-
+ !github.event.pull_request.draft &&
+ github.event.pull_request.head.repo.full_name == github.repository
+ runs-on: ubuntu-latest
+ timeout-minutes: 30
+ permissions:
+ contents: read
+ pull-requests: write
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 1
+
+ - uses: anthropics/claude-code-action@v1
+ with:
+ anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
+ # Workflow token: comments come from github-actions[bot] and no GitHub App is needed.
+ # To post as claude[bot], install the Claude GitHub App, drop this, and add id-token: write.
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+ prompt: |
+ REPO: ${{ github.repository }}
+ PR NUMBER: ${{ github.event.pull_request.number }}
+
+ Review this pull request for bugs. The PR branch is already checked out in the
+ current working directory. This repo is mostly Go (cli/, collector-builder/, pkg/)
+ with TypeScript (packages/, plugins/, browser-extension/). Read CLAUDE.md and
+ AGENTS.md first and check the change against the invariants they state, for example
+ that hooks never touch the network and that embedded or mirrored copies stay identical.
+
+ Focus only on:
+ - Correctness bugs: wrong logic, off-by-one errors, nil dereferences, wrong units or types.
+ - Regressions: behavior this change breaks for existing users, configs, data, or tests.
+ - Edge cases: empty or missing input, concurrency and races, partial failure, OS differences.
+ - Missing or swallowed error handling, and leaked files, processes, or goroutines.
+
+ Do not comment on style, formatting, naming, or other nits, and do not summarize what
+ the PR does. Report only issues you are confident are real, and say how each one is
+ triggered.
+
+ Use `gh pr diff` and `gh pr view` to read the change.
+ Post each issue as an inline comment on the relevant line with
+ `mcp__github_inline_comment__create_inline_comment` (with `confirmed: true`).
+ Then post one short summary with `gh pr comment`: the issues found, or one line saying
+ no bugs were found.
+ Only post GitHub comments - don't submit review text as messages.
+ claude_args: |
+ --allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*)"
diff --git a/.github/workflows/claude-security-review.yml b/.github/workflows/claude-security-review.yml
new file mode 100644
index 00000000..28b3514b
--- /dev/null
+++ b/.github/workflows/claude-security-review.yml
@@ -0,0 +1,38 @@
+name: Claude Security Review
+
+# Claude scans each PR's diff for security vulnerabilities and comments on the affected lines.
+# Setup: add the ANTHROPIC_API_KEY secret (repo or org). The action takes an API key only.
+
+on:
+ pull_request:
+ types: [opened, synchronize, ready_for_review, reopened]
+
+concurrency:
+ group: claude-security-review-${{ github.event.pull_request.number }}
+ cancel-in-progress: true
+
+permissions:
+ contents: read
+ pull-requests: write # PR comments
+
+jobs:
+ security:
+ # Skip drafts, and fork PRs (secrets are not available to them; the action is not
+ # hardened against prompt injection, so it should only see trusted PRs).
+ if: >-
+ !github.event.pull_request.draft &&
+ github.event.pull_request.head.repo.full_name == github.repository
+ runs-on: ubuntu-latest
+ timeout-minutes: 30
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ ref: ${{ github.event.pull_request.head.sha || github.sha }}
+ fetch-depth: 2
+
+ - uses: anthropics/claude-code-security-review@0c6a49f1fa56a1d472575da86a94dbc1edb78eda # main
+ with:
+ comment-pr: true
+ claude-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
+ # Review every push; also keeps a cancelled run from blocking later ones.
+ run-every-commit: true