audit-diff

A security review command that examines only files changed against a chosen Git branch, tag, or commit, including uncommitted changes.

In plain words
What is it for?
Use it for a development or production security check before review or release. It determines the comparison point, lists changed files, and audits the relevant differences.
Why use it?
It limits the review to the code most likely to contain new security risks, which is useful for pull requests or large repositories.

Command

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.

agentmods
npx agentmods add commands/sembraniteam/claude-plugins/audit-diff
Clone the repo
git clone --depth 1 https://github.com/sembraniteam/claude-plugins
Per session 46 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,195 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00046 $0.01195
Opus 5 $0.00023 $0.00598
Sonnet 5 $0.00009 $0.00239
Haiku 4.5 $0.00005 $0.00120

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

Security

Grade A, and why

audit-diff 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 2d 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.

security-auditor/commands/audit-diff.md · 76 lines

How it starts

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

You are running a diff-scoped security audit using the security-auditor plugin. This is the recommended way to audit a pull request, and the recommended fallback whenever a full /audit would need to read more source than fits in context — scoping to the diff solves both problems at once.

Step 1 — Parse arguments

$ARGUMENTS may contain, in any order:

  • A mode hint: dev/development or prod/production
  • A git ref (branch, tag, or commit) to diff against

Any remaining token that isn't a recognized mode keyword is treated as the base ref. If no mode is given, ask the same question /audit asks:

"Is this project currently in development or production?"

Step 2 — Resolve the base ref and list changed files

If a base ref was given, use it directly. Otherwise detect the repo's default branch:

git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@'
# falls back to checking for a local `main` then `master` branch if the above is empty

Then collect the changed file set as the union of:

git diff --name-only --diff-filter=ACMR <base>...HEAD   # committed changes vs merge-base
git diff --name-only --diff-filter=ACMR HEAD             # unstaged working-tree changes
git diff --name-only --diff-filter=ACMR --staged         # staged changes

--diff-filter=ACMR keeps added/copied/modified/renamed files and drops deleted files (nothing to audit in a file that no longer exists). Deduplicate the combined list.

If this is not a git repository, has no commits, or the combined list is empty, say so plainly and stop:

"No git changes found against <base>. Run /audit for a full codebase scan instead."

Step 3 — Filter the changed set

Drop paths matching common generated/vendored directories before analysis: node_modules/, dist/, build/, vendor/, .venv/, target/, *.min.js, lockfiles that aren't being read for dependency scanning in Step 5, and any path Glob confirms doesn't exist (renamed/moved after the diff was taken).

Read the full file on GitHub · 76 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. 2d ago First seen · 76 lines · 46 tokens per session scan A d624d7f22c2d

Subscribe to this mod's changes

audit-diff is a command published in the GitHub repository sembraniteam/claude-plugins (2 stars, last pushed 29d ago), licensed MIT. It adds 46 tokens to every session and 1,195 once invoked, about $0.0002 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-08-31.