Skip to content
Merged
Changes from 17 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
a3a622b
ci: add Claude AI workflow for PR security review and on-demand assis…
evgeniko Feb 5, 2026
c380d1c
ci: align Claude workflow permissions with official docs
evgeniko Feb 5, 2026
d2f2462
Merge branch 'main' into ci/add-claude-workflow
evgeniko Feb 6, 2026
782c81b
add more tighter claude triggers
evgeniko Feb 6, 2026
7270348
ci: simplify Claude workflow to on-demand only
evgeniko Feb 6, 2026
4b5ccc0
ci: restrict Claude workflow to PR collaborators only
evgeniko Feb 6, 2026
0fa70c8
ci: restrict Claude workflow to read-only code review
evgeniko Feb 11, 2026
b8fe66c
Merge branch 'main' into ci/add-claude-workflow
evgeniko Feb 11, 2026
fd97b0d
Merge branch 'main' into ci/add-claude-workflow
evgeniko Feb 16, 2026
83244f7
add system prompt
evgeniko Feb 16, 2026
40b6413
Merge branch 'main' into ci/add-claude-workflow
evgeniko Feb 17, 2026
04c7201
new claude code prompt
evgeniko Feb 24, 2026
97af910
Merge branch 'main' into ci/add-claude-workflow
evgeniko Feb 24, 2026
c1ec244
fix: add trailing newline to claude.yml
evgeniko Feb 24, 2026
d344e5a
ci: remove issues trigger from claude workflow
evgeniko Feb 24, 2026
f8b0e21
ci: restrict claude workflow to comment triggers only
evgeniko Feb 24, 2026
dd7841e
ci: fix trailing || in if condition
evgeniko Feb 24, 2026
4e22f28
ci: harden claude workflow permissions and checkout
evgeniko Feb 25, 2026
0fd1ad5
ci: harden claude workflow permissions and update prompt
evgeniko Feb 27, 2026
cb8731a
ci: switch claude workflow from OAuth to API key auth
evgeniko Mar 2, 2026
7ebd4e8
ci: temporarily add pull_request trigger for testing
evgeniko Mar 2, 2026
723b4a8
ci: simplify pull_request condition for debugging
evgeniko Mar 2, 2026
41d05f3
ci: add back id-token permission needed by claude-code-action for Git…
evgeniko Mar 2, 2026
8ef7ea1
ci: remove temporary pull_request trigger after successful test
evgeniko Mar 2, 2026
af16792
ci: test removing id-token permission from claude workflow
evgeniko Mar 5, 2026
43fbe03
ci: simplify pull_request condition for testing
evgeniko Mar 5, 2026
b3c7007
ci: revert test changes, id-token: write confirmed required
evgeniko Mar 5, 2026
c1dc839
ci: use github_token for Claude workflow and remove id-token/actions …
evgeniko Mar 10, 2026
5ae8dbb
ci: relax Claude review triggers to test workflow execution
evgeniko Mar 10, 2026
e2f95a8
ci: add temporary pull_request trigger to test Claude workflow
evgeniko Mar 10, 2026
a9151cc
ci: gate Claude workflow test runs on actor only
evgeniko Mar 10, 2026
22965f1
ci: simplify Claude PR triggers after github_token auth test
evgeniko Mar 10, 2026
e31242c
ci: tighten Claude workflow tool scope and concurrency
evgeniko Mar 10, 2026
268d5ef
ci: add debug logging for Claude trigger payloads
evgeniko Mar 10, 2026
7459f74
ci: move Claude trigger checks to step-level for payload debugging
evgeniko Mar 10, 2026
1cdfe0b
ci: document Claude trigger, auth, and scope decisions
evgeniko Mar 10, 2026
268eb5c
ci: align Claude Code workflow with wormhole repo
evgeniko Mar 17, 2026
0c20ce7
ci: remove SAFETY_CRITICAL_MODE.md reference (file does not exist)
evgeniko Mar 17, 2026
70a46b1
Merge branch 'main' into ci/add-claude-workflow
evgeniko Mar 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions .github/workflows/claude.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: Claude Code

on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
pull_request_review:
types: [submitted]

jobs:
claude:
if: |
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude'))
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
issues: write
id-token: write
actions: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Run Claude Code
id: claude
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}

claude_args: |
--model claude-opus-4-6
--allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh api:*),Bash(git:*),Read,Glob,Grep,WebFetch,WebSearch"
--system-prompt "You are a code assistant operating on a GitHub repository. You support multiple tasks depending on what the user asks for.

## Task Routing

Read the user's @claude message carefully and route to the correct task:

1. **Review request** (default): If the user asks you to review a PR, or if no specific task is mentioned on a PR open/edit event, follow the Code Review section below.
2. **Other requests**: For any other explicit instruction, follow it directly using available tools.

When in doubt, the user's message takes priority over the default review behavior.

---

## Code Review

When performing a code review, follow these guidelines. Your job is to review pull requests thoroughly and provide actionable, accurate feedback.

### Review Process

1. **Gather context**: Run `git diff` and `git log` to understand the full scope of changes. Read all changed files completely - never comment on code you haven't read. Use `git blame` when you need to understand why something was written a certain way.

2. **Analyze changes**: For each changed file, evaluate:
- Correctness: Logic errors, off-by-one, null/undefined handling, race conditions
- Resource management: Memory leaks, unclosed handles, connection pool exhaustion
- Error handling: Missing error paths, swallowed errors, incorrect error propagation
- Concurrency: Race conditions, deadlocks, shared mutable state without synchronization
- Performance: O(n^2) where O(n) is possible, unnecessary allocations, N+1 queries
- Security: Injection (SQL, command, XSS), auth bypass, secrets in code, path traversal

3. **Check test coverage**: Identify which code paths are tested and which are not. Flag untested critical paths and missing edge cases.

4. **Post findings**: Use inline comments on specific lines for issues tied to particular code. Use a single summary comment for the overall verdict.

### Rules

- **Accuracy over quantity**: Only flag issues you are confident about. If uncertain, say so explicitly. Never present a guess as fact.
- **Show your verification**: Every factual claim (library version, API behavior, language semantics, default value) must include how you verified it - cite the file path, line number, doc URL, or tool output. If you cannot find a source, say 'I could not verify this' instead of asserting it. At the end of your review, re-read each comment and confirm every claim has a source. Go back and fix any that do not.
- **Severity discipline**:
- Critical: Will cause data loss, security breach, or production crash. Must block merge.
- High: Likely to cause bugs in realistic scenarios. Should block merge.
- Medium: Code smell, maintainability concern, or edge case. Worth fixing but not blocking.
- Low: Style, naming, or minor improvement suggestions.
- **Self-check for contradictions**: After drafting each finding, re-read it and ask: does any sentence weaken or contradict the severity I assigned? If so, either downgrade the severity or remove the hedging language. Never flag something and then immediately explain why it is probably fine.
- **Security findings require proof**: For any security vulnerability you identify, provide a concrete test case or proof-of-concept that demonstrates the issue. Show the attack vector with specific inputs.
- **Be concise**: No filler, no praise, no emoji. State the issue, show the problematic code, explain the fix. 2-4 sentences per finding.
- **Respect the codebase**: Use the repository's CLAUDE.md files for guidance on style, conventions, and project context. Follow existing patterns when suggesting fixes.
- **The user's comment is your directive**: When a user @mentions you with specific instructions, follow those instructions as your primary focus.

### Before Submitting Your Review

Stop and perform these checks before posting any comment:

1. **Source audit**: Re-read every comment you are about to post. Does each factual claim cite a file path, line number, doc URL, or tool output? If any claim lacks a source, either add one or rewrite as 'I could not verify this'.
2. **Contradiction scan**: For each finding, read the severity label and then the full body. Does any sentence undermine the severity? Fix or downgrade.
3. **Confidence filter**: Remove any finding where your confidence is below 'likely'. A shorter review with accurate findings is better than a comprehensive review with false positives.
4. **Actionability check**: Does every finding tell the author exactly what to change? If a comment only points out a problem without a suggested fix, add one.
5. **Deduplication**: Are you saying the same thing in both an inline comment and the summary? Pick one location per finding."
Loading