patch
A Claude Code skill that turns verified security findings into candidate
fixes: ranks the queue, routes each finding to the right verification path,
and writes every diff as inert text for human review — it never applies a
patch to your repo. The last leg of the vulnerability cycle: consumes
/triage output (preferred) or any findings file the triage ingest
recognizes, and delegates vuln-pipeline results to the execution-verified
vuln-pipeline patch ladder. For how it fits the pipeline and how to
review what it produces, see docs/patching.md.
Requirements
- Claude Code CLI installed and authenticated
- A findings input:
TRIAGE.json(preferred — already verified and ranked),VULN-FINDINGS.json(unverified; the skill warns),INCIDENTS.json(untriaged D&R output; the skill warns), or a vuln-pipelineresults/<target>/<ts>/directory - A read-only checkout of the target codebase (
--repo, default cwd) — required for static mode - For pipeline input only: the vuln-pipeline installed and sandboxed, since
the skill shells out to
vuln-pipeline patch. The target'sconfig.yamlneeds abuild_command(the in-container rebuild step after applying a diff) and optionally atest_command(the regression suite for the regress tier). All four shipped C/C++ targets havebuild_command; only canary setstest_command— on the others the regress tier is skipped.
Usage
/patch results/<target>/<ts>/TRIAGE.json --repo ./my-service # canonical: triaged findings
/patch results/<target>/<ts>/TRIAGE.json --repo ./my-service --top 5 # only the 5 highest-severity
/patch results/<target>/<ts>/ --model <model-id> # pipeline results → verification ladder
/patch findings.json --repo ./src --id f003 # one finding by id
/patch results/<target>/<ts>/TRIAGE.json --repo ./src --fresh # ignore checkpoint, start overHow the input routes: a pipeline results directory delegates to the
vuln-pipeline patch CLI, whose ladder rebuilds the target, replays the
PoC, runs the test suite, and re-attacks the patched binary (a D&R results
directory containing INCIDENTS.json routes static instead). Static
findings (no PoC to replay) get a fresh-context patch subagent per finding
— root-cause-first, variant hunt, minimal diff, regression test emitted as
part of the diff — plus a separate reviewer agent that sees only
{file, line, category} and the diff bytes, never the scanner's prose.
--model is passed through to vuln-pipeline patch; in static mode
subagents inherit the session model.
You can also drive the pipeline CLI directly — same ladder, no skill in between (it ships with the pipeline; no extra install):
# After a find run has produced results/<target>/<ts>/:
bin/vp-sandboxed patch results/<target>/<ts>/ --model <m>
# Or try it standalone on the pre-baked canary fixture (no find run needed):
bin/vp-sandboxed patch targets/canary/fixtures/results_sample --model <m>Full flag reference (--bug, --parallel, --no-reattack, --style,
iteration and turn caps):
docs/patching.md § CLI reference.
Output
- Static mode:
./PATCHES/bug_NN/patch.diff(the candidate fix, never applied) and./PATCHES/bug_NN/patch_result.json(verdict and provenance) — relative to the directory the skill runs in, not to the findings file. - Execution-verified mode: the ladder writes the pipeline layout —
reports/bug_NN/{patch.diff, patch_result.json}inside the results directory, with transcripts streaming topatch_transcript_itN.jsonlandreattack_transcript_itN.jsonlper iteration — and the skill also mirrors each diff and verdict into./PATCHES/bug_NN/, so both modes land in the same place. PATCHES.md/PATCHES.json— run summary either way, one row per finding. Theverifiedfield in each./PATCHES/bug_NN/patch_result.jsonsays which path produced the diff:ladder_passed/ladder_failed(executable oracle) vsstatic_review_only(agent review). The pipeline-writtenreports/bug_NN/patch_result.jsonrecords the grader'sverdictinstead — it has noverifiedfield.
What it does and doesn't do
- Does: rank and filter findings, read the target source, generate diffs, review each diff independently, delegate pipeline input to the execution-verified ladder, write summaries.
- Does not: apply a diff, write anywhere in
--repo, rungit apply/patch, or execute the target in static mode. There is no--applyflag by design: the capability isn't present, so it can't be prompt-injected into use. Applying the fix is your move, after the review pass described in docs/patching.md#reviewing-generated-patches.
Questions
Reach out to your Anthropic contact.