pr-risk

pr-risk is a command for Claude Code from kumaran-is/claude-code-onboarding. It costs 71 tokens per session (2,065 once invoked), scanned A, original, MIT.

A pre-merge command that scores a pull request across size, complexity, tests, dependencies, and security changes. It also creates a checklist tailored to the changes.

In plain words
What is it for?
Use it on a branch or commit range before opening or reviewing a pull request.
Why use it?
It highlights risky or oversized changes before review or merging, so you can split large pull requests and check sensitive areas early.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it on a branch or commit range before opening or reviewing a pull request.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/kumaran-is/claude-code-onboarding/pr-risk
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/kumaran-is/claude-code-onboarding

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pr-risk

README.md
[![agentmods](https://agentmods.dev/badge/commands/kumaran-is/claude-code-onboarding/pr-risk.svg)](https://agentmods.dev/commands/kumaran-is/claude-code-onboarding/pr-risk)
Your own site
<a href="https://agentmods.dev/commands/kumaran-is/claude-code-onboarding/pr-risk"><img src="https://agentmods.dev/badge/commands/kumaran-is/claude-code-onboarding/pr-risk.svg" alt="Measured on agentmods" height="20"></a>
Per session 71 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,065 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00071 $0.02065
Opus 5 $0.00036 $0.01033
Sonnet 5 $0.00014 $0.00413
Haiku 4.5 $0.00007 $0.00206

Measured 4d ago against content hash d69d129bd20f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

pr-risk scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/pr-risk.md · 215 lines

How it starts

The opening of the file, as written. The whole thing — 215 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PR Risk Assessment

Calculate a composite risk score across 5 dimensions before review or merge.

Step 1 — Determine Scope

Use $ARGUMENTS as the diff range if provided. Otherwise default to HEAD~1..HEAD.

Step 2 — Gather Raw Data

Run all of these:

# Size stats
git diff --shortstat $SCOPE

# File list with status (A=added, M=modified, D=deleted, R=renamed)
git diff --name-status $SCOPE

# Dependency file changes
git diff --name-only $SCOPE | grep -E "package\.json$|package-lock\.json|pnpm-lock\.yaml|yarn\.lock|requirements\.txt|uv\.lock|Pipfile\.lock|pom\.xml|build\.gradle|pubspec\.yaml|pubspec\.lock"

# Security-sensitive file changes
git diff --name-only $SCOPE | grep -iE "auth|login|token|jwt|crypto|secret|password|credential|permission|role|guard|interceptor|middleware|\.env|config/.*\.(yml|yaml|json)"

# Full diff for pattern analysis
git diff $SCOPE

Step 3 — Score Each Factor (0–10)

A. Size Risk

Use the higher of the file-count score and the line-count score.

Score Files changed OR total lines changed
0–2 ≤ 5 ≤ 100
3–4 ≤ 10 ≤ 300
5–6 ≤ 20 ≤ 600
7–8 ≤ 40 ≤ 1,000
9–10 > 40 > 1,000

B. Complexity Risk

Start at 0. Add points for each signal found in the diff. Cap at 10.

Signal in diff Points
Public interface or API contract changed (endpoint signature, DTO field, exported function) +2
Database schema or migration file added or modified +3
Auth, security, permission, or role logic changed +3
Async or concurrent code added or modified +2
New third-party integration added +2
CI/CD, Docker, or infrastructure config changed +1
Cross-cutting concern modified (logging, error handler, event bus, interceptor) +1

C. Test Coverage Risk

Count files in the diff:

  • Source files: .ts, .java, .py, .dart, .kt, .swift, .js — excluding test files
  • Test files: paths containing test, spec, __tests__, _test., .test., .spec.

Read the full file on GitHub · 215 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 215 lines · 0 tokens per session scan A d69d129bd20f

Subscribe to this mod's changes

pr-risk is a command published in the GitHub repository kumaran-is/claude-code-onboarding (35 stars, last pushed 2mo ago), licensed MIT. It adds 71 tokens to every session and 2,065 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.