post-patch-validation — Claude Code skill: prove a security patch
Runs exploits and regression checks against both the vulnerable and patched revisions, so you can see whether a security fix actually holds.
npx skills add trailofbits/skills --skill post-patch-validation -a claude-codeWhat post-patch-validation does
This skill takes an existing security patch and builds a validation plan around it. You pin the vulnerable base and the patched side, using commits where possible; uncommitted work gets turned into a binary patch file first, because the skill does not validate inside your working tree. The agent then reads the finding, the diff, callers, sibling paths and error handling before writing the checks.
A diff, an author name or the original proof of concept prove nothing on their own. So the plan needs at least one check of each kind: a control, the original exploit, a variant of the same root cause, unchanged behavior, a targeted regression, an adjacent-vulnerability check and the project suite. The bundled scripts/post_patch_validation.py offers scaffold, print-schema, validate-plan and run. Commands are argv arrays rather than shell strings, the runner pins locale, timezone and hash seed, and it never edits the original worktree. Exploit and variant checks must flush PPV_REACHED to stdout on both sides; a run without it leaves a marker_missing gap. Each check times out after 300 seconds by default, with 1 to 3600 allowed.
You need uv on the machine. Put complex setup in a script and call it through {plan_dir}. The runner only touches local code, so this is the wrong tool for a remote host or production, and running a repository's test suite still needs the owner's go-ahead.
What it helps with
- Show that a patch stops the original exploit, not just that it builds
- Catch sibling paths to the same root cause the fix missed
- Detect behavior changes caused by a security edit
- Spot a new weakness the patch itself introduced
- Hand the author failing checks and logs before the next revision
Example prompts for the agent
- Validate the patch in
patch.diffagainst commita1b2c3d, scaffold a plan and run it - Scaffold a validation plan for this fix PR and add a variant that enters through a different input
- Re-run the earlier validation and list the checks that came back as gaps
How to install post-patch-validation
1Skills CLI (Vercel)
npx skills add trailofbits/skills --skill post-patch-validation -a claude-code2Manually: put the files in place
~/.claude/skills/post-patch-validation/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/post-patch-validation/
1Skills CLI (Vercel)
npx skills add trailofbits/skills --skill post-patch-validation -a codex2Manually: put the files in place
.agents/skills/post-patch-validation/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add trailofbits/skills --skill post-patch-validation -a cursor2Manually: put the files in place
.cursor/skills/post-patch-validation/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install trailofbits/skills post-patch-validation2Manually: put the files in place
.github/skills/post-patch-validation/SKILL.md1Skills CLI (Vercel)
npx skills add trailofbits/skills --skill post-patch-validation -a gemini-cli2Platform CLI
gemini skills install https://github.com/trailofbits/skills --path plugins/post-patch-validation/skills/post-patch-validationManually: put the files in place
.devin/skills/post-patch-validation/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add trailofbits/skills --skill post-patch-validation -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about post-patch-validation
How do I install post-patch-validation in Claude Code?
Run npx skills add trailofbits/skills --skill post-patch-validation -a claude-code, then confirm ~/.claude/skills/post-patch-validation/SKILL.md exists.
What does post-patch-validation do?
It builds an evidence plan for a finished security patch and executes it on the vulnerable and patched revisions. The output is result.json and report.md listing failures and coverage gaps.
Does it work on a remote server or production?
No. It executes local code and tests only, and running a repository's suite requires the owner's authorization.