config
You are installing or updating Trail of Bits' Claude Code configuration into the user's `~/.claude/` directory.
@description Review an existing PR with parallel agents, fix findings, and push. @arguments $PR_NUMBER: GitHub PR number to review and fix
How it fires
How this command gets triggered: by you, by Claude, or both.
/review-prContext preview
What this command does when you run it.
@description Review an existing PR with parallel agents, fix findings, and push. @arguments $PR_NUMBER: GitHub PR number to review and fix
@description Review an existing PR with parallel agents, fix findings, and push. @arguments $PR_NUMBER: GitHub PR number to review and fix
Read PR #$PR_NUMBER thoroughly using `gh pr view`. Understand the full context: description, linked issues, commit history, and the diff against the base branch.
Detect the upstream repository: if a git remote named `upstream` exists, use it as the canonical repo. Otherwise, fall back to `origin`. Resolve the canonical repo's `owner/name` (e.g. from `git remote get-url upstream`) and store it — use `--repo <owner/name>` on every `gh` command to ensure they target the correct repository. Run `git fetch <upstream-remote>` to ensure you are working with up-to-date code.
Check out the PR branch locally.
Execute every step below sequentially. Do not stop or ask for confirmation at any step.
Run two review passes in parallel, then merge findings.
Launch these Task tool agents **in parallel** (single message, multiple tool calls), each with `subagent_type` from the pr-review-toolkit plugin. Tell each agent which files changed (from `git diff --name-only <base>...HEAD`):
| agent | focus | |-------|-------| | `pr-review-toolkit:code-reviewer` | Code quality, style, project guidelines | | `pr-review-toolkit:silent-failure-hunter` | Silent failures, swallowed errors, bad fallbacks | | `pr-review-toolkit:pr-test-analyzer` | Test coverage gaps and missing edge cases |
Launch these Task tool agents **in parallel with Pass A** — all 5 agents in a single message, multiple tool calls. Each uses `subagent_type: general-purpose`.
**Codex reviewer** — tell the agent to run:
codex review --base <upstream-remote>/<base-branch> \ -c model='"gpt-5.3-codex"' \ -c model_reasoning_effort='"xhigh"'
`AGENTS.md` at the repo root if one exists)
`gpt-5.2-codex`
`[thinking]`/`[exec]` blocks and sandbox warnings
**Gemini reviewer** — tell the agent to run:
git diff <upstream-remote>/<base-branch>...HEAD > /tmp/pr-review-diff.txt
# Build prompt file (avoids heredoc shell expansion issues)
{
echo "Review this diff for code quality, bugs, and improvements."
if [ -f CLAUDE.md ] || [ -f .claude/CLAUDE.md ]; then
echo ""
echo "Project conventions:"
echo "---"
cat CLAUDE.md .claude/CLAUDE.md 2>/dev/null
echo "---"
fi
echo ""
echo "Diff:"
cat /tmp/pr-review-diff.txt
} > /tmp/pr-review-prompt.txt
# Pipe prompt via stdin to avoid shell metacharacter issues
cat /tmp/pr-review-prompt.txt | gemini -p - \
-m gemini-3-pro-preview \
--yoloexpansion issues with `$`, backticks, etc. in diffs
Collect results from all 5 sources (3 toolkit agents + Codex + Gemini). Deduplicate overlapping findings — if multiple sources flag the same issue, keep the most specific description and note the consensus. Rank every finding by severity:
Address all P1–P3 findings. For each finding, either:
the churn (e.g. a stylistic disagreement or an impossible edge case). Document the reasoning inline.
When a fix requires external context — unfamiliar library behavior, unclear API semantics, or an error you don't recognize — use Exa (`mcp__exa__web_search_exa`) to search for solutions rather than guessing.
P4 findings are informational — note them but do not fix unless trivial.
Before running anything, read the project's CI configuration to learn what the project *actually* runs. This takes priority over the fallback tables below.
1. **Read CI workflows.** Scan `.github/workflows/` for the main CI workflow (typically `ci.yml`, `test.yml`, or `build.yml`). Extract:
`cargo test --features foo,bar`)
— these are **codegen sync checks** (schema generation, snapshot updates, help text, etc.). Record the command.
2. **Read the Makefile** (if present). Cross-reference targets used in CI — these are the ones that matter. 3. **Read CLAUDE.md** (if present at repo root or `.claude/`). It may define project-specific quality gates.
Store the discovered commands. They override the fallback table for any overlapping step.
Detect the project language from manifest files (`Cargo.toml` → Rust, `pyproject.toml`/`setup.py` → Python, `package.json` → Node/TypeScript, `go.mod` → Go). A project may use multiple languages; run checks for each.
Run checks in this order. For each step, use the CI-discovered command if one was found; otherwise fall back to the default.
1. **Build** — compile or bundle 2. **Test** — run the full test suite with the same feature flags CI uses. Iterate on failures until green. 3. **Lint and format** — fix any issues 4. **Extended checks** — per-language extras (see fallback table) 5. **Codegen sync** — for every codegen check discovered in 3a, run the command and
Opinionated defaults, documentation, and workflows for Claude Code at Trail of Bits. Covers sandboxing, permissions, hooks, skills, MCP servers, and usage patterns we've found effective across security audits, development, and research.
Repo: trailofbits/claude-code-config
You are installing or updating Trail of Bits' Claude Code configuration into the user's `~/.claude/` directory.
@description End-to-end: plan, implement, test, review, fix, push, and PR for a GitHub issue. @arguments $ISSUE_NUMBER: GitHub issue number to fix
@description Evaluate and merge dependabot PRs with parallel builds, dependency-aware batching, and transitive dep analysis. @arguments $REPO: GitHub org/repo…