Agent skill

Reviewing Code Changes

by trilwu in trilwu/secskills

Perform a security review of a diff, branch, or pull request — assessing what the change introduces, weakens, or exposes, with a triage-first workflow and false-positive discipline.

MITAuto-check passedSecurity

Install Reviewing Code Changes

skills CLI
$ npx skills add trilwu/secskills --skill reviewing-code-changes -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install trilwu/secskills reviewing-code-changes --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/trilwu/secskills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/secskills-core/skills/reviewing-code-changes .claude/skills/reviewing-code-changes && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
reviewing-code-changes
GitHub stars
156
Token cost
~2.3k tokens
SKILL.md length
950 words
Files
1
Skills in repo
50
Repo updated
First seen
Licence
MIT

At a glance

Perform a security review of a diff, branch, or pull request — assessing what the change introduces, weakens, or exposes, with a triage-first workflow and false-positive discipline.

  • Works in 3 steps: What is this change trying to do? Read… → Does the diff match the description?… → What is the change's exposure? A change…
  • Asked to security review a PR
  • SKILL.md covers When to Use, When NOT to Use, Get the Real Diff First and Triage: Where to Spend the…, plus 5 more sections
  • Calls git, rg and terraform

What it does

Reviewing Code Changes is an agent skill from trilwu/secskills. Perform a security review of a diff, branch, or pull request — assessing what the change introduces, weakens, or exposes, with a triage-first workflow and false-positive discipline. Use when asked to security review a PR or branch, check a diff before merge or commit, or assess whether a change is safe to ship.

Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Security, covering Security review and Pull requests. The repository describes itself as: Transform Claude Code into your personal security engineer. The licence is MIT.

When your agent uses it

  • Asked to security review a PR
  • Check a diff before merge
  • Assess whether a change is safe to ship

Example prompts

  • “/reviewing-code-changes”

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. What is this change trying to do? Read the PR description and the
  2. Does the diff match the description? Unexplained files — a config
  3. What is the change's exposure? A change to an unauthenticated request

What it can do on your machine

Read from SKILL.md and the folder at commit ca53957. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git
    • rg
    • terraform

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Reviewing Code Changes loads about 2.3k tokens when it runs. Until then it costs about 84 tokens; SKILL.md has 950 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~84
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from trilwu/secskills at commit ca53957, republished under its MIT licence (© trilwu). 950 words, ~2,280 tokens.

Download SKILL.mdSave it as .claude/skills/reviewing-code-changes/SKILL.md (or your agent's skills folder).
name
reviewing-code-changes
description
Perform a security review of a diff, branch, or pull request — assessing what the change introduces, weakens, or exposes, with a triage-first workflow and false-positive discipline. Use when asked to security review a PR or branch, check a diff before merge or commit, or assess whether a change is safe to ship.
verified
2026-07-27

Reviewing Code Changes

Reviewing a diff is not auditing a codebase in miniature. The diff shows you what changed but hides what the change means — the caller that now receives untrusted data, the check that used to run, the assumption that no longer holds. Reviewing only the added lines is the standard way to miss the bug.

When to Use

  • Security review of a pull request, branch, or commit range
  • Pre-commit or pre-merge check on your own changes
  • Assessing risk of a dependency bump or config change
  • Reviewing an AI-generated change before it ships

When NOT to Use

  • Whole-codebase audit — use auditing-code-for-vulnerabilities
  • Runtime testing of the deployed change — use the relevant testing skill
  • Dependency/CI changes as the main subject — use auditing-supply-chain

Get the Real Diff First

bash
# Against the actual merge base, not against whatever HEAD happens to be
BASE=$(git merge-base HEAD origin/main)
git diff --stat $BASE...HEAD
git diff $BASE...HEAD

# Rename and whitespace noise hides real changes
git diff -M -C -w $BASE...HEAD

# Files changed most, and by whom — where to spend attention
git diff --numstat $BASE...HEAD | sort -rn | head -20

Three things to establish before reading code:

  1. What is this change trying to do? Read the PR description and the tests. A security review without the intent is pattern matching.
  2. Does the diff match the description? Unexplained files — a config change, a new dependency, a workflow edit riding along with a feature — are the highest-signal thing in a review.
  3. What is the change's exposure? A change to an unauthenticated request path deserves an order of magnitude more attention than an internal refactor.

Triage: Where to Spend the Review

Not all diffs deserve equal time. Rank hunks by what they touch:

PrioritySignals
CriticalAuth/authz logic, session handling, crypto, input parsing on an untrusted boundary, SQL/command/template construction, file path handling, deserialization, CI/CD workflows, IAM/security-group config, dependency additions
HighNew endpoints or routes, new tool/RPC surface, error handling on security paths, logging of user data, tenant scoping, cache keys, rate limits
MediumBusiness logic that consumes validated input, refactors that move security-relevant code
LowTests, docs, formatting, comments — but read test deletions
bash
# Fast triage of a large diff
git diff $BASE...HEAD --name-only | rg 'auth|login|session|crypto|password|token|admin|permission|\.github/workflows|Dockerfile|terraform|policy'
git diff $BASE...HEAD -U10 | rg -n '^\+.*(eval\(|exec\(|system\(|innerHTML|pickle|yaml\.load|Sprintf.*SELECT|shell=True|verify=False|InsecureSkipVerify)'

What to Look For

Removals and weakenings — read the minus lines first

The most dangerous diffs delete things. Search the removed lines specifically:

bash
git diff $BASE...HEAD | rg '^-' | rg -i 'auth|verify|valid|check|sanitiz|escape|permission|assert|csrf|limit'
  • A validation call deleted "because it was redundant"
  • An authorization decorator removed during a refactor
  • A test deleted rather than fixed
  • A TODO: add authz that was never done and is now shipping
  • A timeout, size cap, or rate limit removed
  • strict mode, a security header, or a CSP directive relaxed
Additions — the ordinary classes, in context

Apply the bug-class hunting from auditing-code-for-vulnerabilities, but scoped to the changed paths: injection sinks, authorization on new object lookups, SSRF in new outbound calls, path handling on new file operations, deserialization, secrets, weak randomness, unsafe defaults.

The two questions that catch most real issues in a diff:

Does new untrusted data reach an old sink? Does old untrusted data reach a new sink?

Both require reading outside the diff.

Context beyond the diff

Read the whole function for every non-trivial hunk. Then check callers:

bash
# Who calls the changed function, and do they still satisfy its assumptions?
rg -n 'changedFunctionName\s*\(' --type <lang>
# What else in the codebase uses the pattern this change introduced?
git log -1 --format=%H $BASE  # anchor, then compare behaviour before/after

Specifically check whether the change alters an invariant that other code relies on: a function that used to sanitize and now does not, a return value whose meaning flipped, a nullable that became non-null, an ordering guarantee that was dropped.

Config, infra, and pipeline changes riding along
bash
git diff $BASE...HEAD -- '*.yml' '*.yaml' '*.tf' 'Dockerfile*' '.github/**' '*.json'
  • New or bumped dependencies: who maintains them, and does the lockfile change match the manifest change? (See auditing-supply-chain.)
  • Workflow permissions widened, pull_request_target added, unpinned actions
  • Security group / firewall rules opened, buckets made public, IAM "*"
  • Debug flags, verbose logging of request bodies, disabled TLS verification
  • Feature flags that default to on
Show full SKILL.md (390 more words)Show less
AI-generated and large mechanical changes

Machine-written diffs fail in characteristic ways: plausible-looking validation that does not actually constrain, error handling that swallows security-relevant failures, invented API usage that silently no-ops, and copied patterns applied where the surrounding assumptions differ. For a large generated diff, sample the security-relevant hunks and verify against the real library behaviour rather than reading for plausibility.

Verify Before Reporting

Diff review generates false positives faster than any other review mode, because the missing context is exactly what makes a hunk look wrong. Before raising a finding:

  1. Read the surrounding function and the callers. The check you think is missing is often two frames up.
  2. Check the framework's behaviour. Many "missing escaping" findings are handled by the template engine.
  3. Confirm reachability with the caller privilege required.
  4. Look for the same pattern elsewhere in the codebase. If it is everywhere and predates this PR, it is a codebase finding, not a PR blocker — say so, and file it separately.

Then state the finding with a concrete failure scenario: the input, the path, and the result. "This could be unsafe" is not a review comment; it is a request for someone else to do the analysis.

Output

Separate what blocks the merge from what does not:

markdown
## Security review — PR #482

**Blocking**
1. `api/reports.go:214` — export handler drops the tenant predicate present on
   the list path. Any authenticated user can export another tenant's report by
   ID. Add `AND tenant_id = ?` to the lookup.

**Non-blocking, should fix**
2. `api/reports.go:190` — report IDs are sequential, making enumeration
   trivial once (1) is fixed. Consider opaque IDs.

**Notes / pre-existing**
3. The `findByID` pattern without scoping appears in 14 other handlers and
   predates this PR. Filed as ISSUE-991 rather than blocking here.

**Reviewed but clear**
- New `/webhooks/stripe` route: signature verified before body parse, replay
  window enforced. No finding.
- Dependency bump `lodash 4.17.20 → 4.17.21`: patch for CVE-2021-23337, no
  API change.

**Not covered**
- The React changes under `web/` were not reviewed for XSS in depth; the diff
  touches 40 components.

Stating what you reviewed and found clean is as useful as the findings — it tells the next reviewer where not to spend time, and it makes the coverage of the review honest.

Rationalizations to Reject

  • "The diff looks fine." You reviewed the added lines. Read the removed ones and the callers.
  • "CI passed." CI runs the tests that exist for the behaviour someone anticipated.
  • "It's a small change." One deleted decorator is a small change.
  • "The author is senior." Review the code.
  • "It's just a refactor." Refactors move security-relevant code across trust boundaries more often than features do.
  • "That's pre-existing." True, and worth saying — but confirm it is pre-existing rather than assuming, and file it rather than dropping it.
  • "I'd need to understand the whole system to be sure." Then say what you could not determine. An honest uncertainty is a reviewable statement; silence reads as approval.

References

  • auditing-code-for-vulnerabilities — full audit methodology and bug classes
  • auditing-supply-chain — dependency and workflow changes in the diff
  • securing-ai-systems — reviewing changes to LLM/agent features
  • reporting-security-findings — severity and write-up when a finding leaves the PR

© trilwu, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in secskills-core/skills/reviewing-code-changes of trilwu/secskills.

Open the folder on GitHubat commit ca53957

Compare with similar skills

Reviewing Code Changes next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Reviewing Code Changes compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Reviewing Code Changes this skilltrilwu/secskills156—~2.3kAutomated safety check: PassMIT
Fix Scan Findingmalloydata/publisher116—~5.1kAutomated safety check: PassMIT
Claude Securityanthropics/claude-plugins-official37k—~1.4kAutomated safety check: PassApache-2.0
Trailmark Review Gatetrailofbits/skills7.4k—~1.1kAutomated safety check: NotesCC-BY-SA-4.0
Differential Security Reviewtrailofbits/skills7.4k—~1.8kAutomated safety check: NotesCC-BY-SA-4.0
Security Review PRwarpdotdev/oz-for-oss3131 repos~2kAutomated safety check: NotesMIT

Similar skills

  • Fix Scan Finding

    malloydata/publisher

    Fix a CRITICAL Trivy finding that is failing CI in this repo (a vulnerability, misconfiguration, or secret from security-scan.yml or image-scan.yml), or add, review, or retire an entry in…

    116 GitHub stars~5.1k tokensUpdated today
    SecurityAuto-check passed
  • Claude Security

    anthropics/claude-plugins-official

    Official

    Scans a whole codebase or a set of changes for security issues, and turns findings into verified patch files that you apply yourself.

    37k GitHub stars~1.4k tokensUpdated today
    SecurityAuto-check passed
  • Trailmark Review Gate

    trailofbits/skills

    Official

    Compares before and after Trailmark graphs of a branch, pull request or release diff to flag new entry points, tainted paths, removed validation and other structural security regressions.

    7.4k GitHub stars~1.1k tokensUpdated 5 days ago
    SecurityAuto-check: notes
  • Official

    Reviews a pull request, commit or diff for security problems, using git history, caller counts and test coverage, and writes a markdown report.

    7.4k GitHub stars~1.8k tokensUpdated 5 days ago
    SecurityAuto-check: notes
  • Security Review PR

    warpdotdev/oz-for-oss

    Audit a pull request diff for common security concerns (input validation, sanitization, authentication and authorization, secrets management, unsafe dependencies, and related risks) and fold…

    313 GitHub starsUsed in 1 repo~2k tokens
    SecurityAuto-check: notes
  • Security Diff Scan

    CoWork-OS/CoWork-OS

    A skill your agent uses when the user asks for a security review of a pull request, commit, branch diff, working-tree patch, or other Git-backed change set.

    473 GitHub stars~2.5k tokensUpdated today
    SecurityAuto-check passed

More from trilwu/secskills

All 50 skills in this repo
  • Audit source code for exploitable vulnerabilities using threat-model-driven review, taint tracing, invariant checking, and variant analysis.

    156 GitHub stars~3.2k tokensUpdated 1 mo ago
    Auto-check passed
  • Perform OSINT, subdomain enumeration, port scanning, web reconnaissance, email harvesting, and cloud asset discovery for initial access.

    156 GitHub stars~3.1k tokensUpdated 1 mo ago
    Auto-check: notes
  • Securing AI Systems

    trilwu/secskills

    Assess and harden LLM applications and agentic systems against prompt injection, tool misuse, excessive agency, memory poisoning, RAG data leakage, and model supply-chain risk, mapped to the OWASP…

    156 GitHub stars~2.9k tokensUpdated 1 mo ago
    Auto-check passed
  • Analyzing Binaries

    trilwu/secskills

    Reverse engineer compiled binaries, firmware, and mobile app packages using triage, static disassembly, decompilation, and dynamic instrumentation.

    156 GitHub stars~2.9k tokensUpdated 1 mo ago
    Auto-check passed
  • Analyzing Go Binaries

    trilwu/secskills

    Reverse engineer Go binaries by recovering function names and types from pclntab and moduledata using GoReSym, redress, and IDA/Ghidra Go plugins, and by reading Go's non-standard calling…

    156 GitHub stars~2k tokensUpdated 1 mo ago
    Auto-check passed
  • Analyzing iOS Binaries

    trilwu/secskills

    Analyze iOS applications at the binary level — decrypting FairPlay-protected IPAs with frida-ios-dump or bagbak, inspecting Mach-O load commands, recovering Objective-C headers with class-dump, and…

    156 GitHub stars~2k tokensUpdated 1 mo ago
    Auto-check passed

Questions about Reviewing Code Changes

What does Reviewing Code Changes do?

Perform a security review of a diff, branch, or pull request — assessing what the change introduces, weakens, or exposes, with a triage-first workflow and false-positive discipline. Reviewing Code Changes is an agent skill from trilwu/secskills. Perform a security review of a diff, branch, or pull request — assessing what the change introduces, weakens, or exposes, with a triage-first workflow and false-positive discipline.

When should I use Reviewing Code Changes?

Reviewing Code Changes fits situations like: asked to security review a PR; check a diff before merge; assess whether a change is safe to ship.

How do I install Reviewing Code Changes in Claude Code?

Run `npx skills add trilwu/secskills --skill reviewing-code-changes -a claude-code`. Or copy the skill folder (secskills-core/skills/reviewing-code-changes in trilwu/secskills) into .claude/skills/reviewing-code-changes in your project. Claude Code loads it when a task matches its description.

How do I install Reviewing Code Changes in Codex?

Run `npx skills add trilwu/secskills --skill reviewing-code-changes -a codex`. Or copy the skill folder (secskills-core/skills/reviewing-code-changes in trilwu/secskills) into .agents/skills/reviewing-code-changes in your project. Codex loads it when a task matches its description.

Can I use Reviewing Code Changes in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add trilwu/secskills --skill reviewing-code-changes -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/reviewing-code-changes, .gemini/skills/reviewing-code-changes, .github/skills/reviewing-code-changes and .opencode/skills/reviewing-code-changes in your project.

What does Reviewing Code Changes need to run?

Going by SKILL.md and its folder, Reviewing Code Changes needs the command-line tools its instructions call (git, rg and terraform).

Does Reviewing Code Changes access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Reviewing Code Changes safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Reviewing Code Changes use?

Reviewing Code Changes is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Reviewing Code Changes use?

About 2.3k tokens (SKILL.md is roughly 9.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Reviewing Code Changes?

Skills that share tags, products or a category with Reviewing Code Changes: Fix Scan Finding (malloydata/publisher, 116 stars), Claude Security (anthropics/claude-plugins-official, 37k stars), Trailmark Review Gate (trailofbits/skills, 7.4k stars) and Differential Security Review (trailofbits/skills, 7.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Reviewing Code Changes?

trilwu (a GitHub user) maintains it in trilwu/secskills, which has 156 GitHub stars. The repository holds 50 skills in this directory. The repository was last updated on September 4, 2026.

Source: trilwu/secskills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.