scan-diff

scan-diff is a command for coding agents from tinoimammp/vantage-security-agent. It costs 28 tokens per session (1,144 once invoked), scanned A, original, MIT.

A command that checks only the files changed by a commit or pull or merge request for newly introduced security vulnerabilities. SAST means checking source code without running the application.

In plain words
What is it for?
Use it to review a commit or PR/MR before merging, using a commit hash, a pull or merge request number, or the current commit by default.
Why use it?
It provides a faster, focused security check than scanning the entire project, while keeping its reports separate from the main scan results.

Command

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the vantage plugin — 1 skill, 6 commands shipped together

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/tinoimammp/vantage-security-agent/scan-diff
Clone the repo
git clone --depth 1 https://github.com/tinoimammp/vantage-security-agent

Or install vantage, the plugin that ships this one along with the rest of its 1 skill, 6 commands.

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 scan-diff

README.md
[![agentmods](https://agentmods.dev/badge/commands/tinoimammp/vantage-security-agent/scan-diff.svg)](https://agentmods.dev/commands/tinoimammp/vantage-security-agent/scan-diff)
Your own site
<a href="https://agentmods.dev/commands/tinoimammp/vantage-security-agent/scan-diff"><img src="https://agentmods.dev/badge/commands/tinoimammp/vantage-security-agent/scan-diff.svg" alt="Measured on agentmods" height="20"></a>
Per session 28 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,144 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.00028 $0.01144
Opus 5 $0.00014 $0.00572
Sonnet 5 $0.00006 $0.00229
Haiku 4.5 $0.00003 $0.00114

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

Security

Grade A, and why

scan-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 3d 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.

commands/scan-diff.md · 71 lines

What it actually says

Scan only the changed files in $ARGUMENTS — a commit hash, a bare PR/MR number (e.g. 42 or #42), or empty (defaults to HEAD) — for vulnerabilities that change itself introduced. Fast, incremental check, not the full /vantage:scan-web/scan-mobile pipeline. Same SAST-only rule applies: read the diff and resulting file content, never run the application. Bash here is scoped to read-only git/PR history commands only — never used to build, run, or test the target app.

All output for this run lives under one self-contained root, artifacts/commit-scans/<id>/ (<id> = the commit hash, or pr-<number>/mr-<number>) — never touching the main pipeline's artifacts/findings/, artifacts/poc/, or artifacts/reports/ paths. These accumulate across runs by design — this command doesn't prune old ones; delete a specific artifacts/commit-scans/<id>/ folder yourself whenever you no longer need it.

  1. Resolve what to diff:
    • $ARGUMENTS empty -> use HEAD.
    • $ARGUMENTS looks like a commit hash and git rev-parse resolves it -> treat as a commit.
    • $ARGUMENTS is a bare number or #<number> -> treat as a PR/MR: try gh pr diff <number> first (GitHub); if gh isn't available or errors, try glab mr diff <number> (GitLab). If neither works, stop and tell the user to pass an explicit commit hash instead.
    • Nothing resolves -> stop, don't guess.
  2. Get the changed files + diff:
    • Commit: git diff --name-only <hash>^..<hash> for the file list, git show <hash> -- <files> for the actual diff.
    • PR/MR: the gh pr diff/glab mr diff output already is the diff; derive the changed-file list from its diff --git a/... b/... headers.
    • Drop deletions and anything matching scope.json.analysis_scope.exclude_paths if scope.json exists. If zero source files remain, stop and report "nothing to scan."
  3. Read platform from ./.vantage/artifacts/recon/scope.json if it exists (default web). Don't auto-generate a full scope.json for this fast path.
  4. Dispatch the platform's 10 testing agents (see ${CLAUDE_PLUGIN_ROOT}/workflow/orchestration.md Platform Routing for the list) as parallel Task calls. Override their normal input for this run: instead of reading artifacts/mapping/attack-surface.json, give each agent the diff from step 2 directly in its dispatch prompt and instruct it to analyze only the changed/added lines — pre-existing unchanged code in the same file was already covered by a full scan and is out of scope here. Each agent writes its own file at artifacts/commit-scans/<id>/raw-findings.<agent-name>.json.
  5. Dispatch validator-agent the same way, reading + writing inside artifacts/commit-scans/<id>/ (validated-findings.json).
  6. For every validated:true Medium-Critical finding, dispatch poc-agent the same way, writing to artifacts/commit-scans/<id>/poc/<finding-id>.md — same PoC contract as the full pipeline (code evidence + manual test steps a human runs later). Do not dispatch report-agent or generate a report.md for this fast path — that's the one full-pipeline artifact this command skips.
  7. Report directly in chat: what was resolved (commit hash, or PR/MR number plus its head commit — this is the <commit-scan-id> used below), which agents ran, candidate count, the validated findings (severity, file:line, one-line description), and a pointer to each one's PoC file for manual test steps.
  8. To fix one of these findings, tell the user to run /vantage:fix-diff <commit-scan-id> <finding-id> — a separate command, not part of this one. Never dispatch fix-agent from inside this command.

Do not treat a clean result ("0 candidates") as proof the change is safe — this only checked the diff, not the whole attack surface (e.g. a new call site into an already-vulnerable existing function elsewhere in the repo).

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. 3d ago First seen · 71 lines · 28 tokens per session scan A 03c20ae5a464

Subscribe to this mod's changes

scan-diff is a command published in the GitHub repository tinoimammp/vantage-security-agent (4 stars, last pushed 1mo ago), licensed MIT. It adds 28 tokens to every session and 1,144 once invoked, about $0.0001 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.