Software DevelopmentOfficial · trailofbits

Prove Patch skill for Claude

Use when a local security patch commit needs independent scoped and three-arm proof.

Prove Patch SKILL.md

The full skill file from trailofbits/skills (CC-BY-SA-4.0).

Prove Patch

Use the original baseline, final patch commit, declared repair_scope, and unchanged reproduction package. Read the record contract. Do not edit the patch or validate an uncommitted tree. Return failures for a new attempt. Before target commands, follow its project guidance.

  1. Review the scoped cases and the patch without the patcher's conclusion. Execute each planned input on clean baseline and patched trees with the same retained harness source and command. The harness must print exactly one PATCH_CASE {"input": ..., "actual": ...} from the exercised input and observed result, then print PATCH_REACHED as its final stdout line immediately before the assertion. Representatives must fail on the baseline and pass on the patch. Valid controls must pass on both. Keep the baseline and patched stdout, stderr, exit status, elapsed time, command, and harness source under receipts/. A timeout, setup failure, missing marker, mismatched input, or ambiguous observation is an evidence gap. A trustworthy patched failure is a finding. Never relabel a gap as a pass.
  2. Run relevant project checks on the patch and retain the same raw receipts. Use baseline comparison for behavior checks and to attribute failed project checks; a passing patched suite may omit a baseline run. Include focused tests, regression and security checks where relevant. Record specific unproven limits; an empty list leaves the result inconclusive.
  3. Run the three-arm helper with the proof-type recipe in the record contract, reproduce.baseline_commit, and final patch_commit. Require the baseline to fail, patch to pass, and complete baseline revert to fail again. Require receipts/source.json to identify the pinned commits and the reverted tree to equal the original baseline tree. Require the type's build identity result. Retain all source-tree, build, and execution receipts.
  4. Write prove.json and a final manifest covering it and every receipt. Run uv run --no-project <script> manifest <prove-attempt-dir> and then uv run --no-project <script> check <run-dir> with the validator. Independently inspect the native proof assessment and raw receipts before reporting a result. A complete proof has no findings or gaps. Return exact failures and receipt paths to the orchestrator.

Prove record schema:

{
  "schema_version": 2,
  "attempt": 1,
  "failure_type": "runtime",
  "baseline_commit": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "patch_commit": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
  "reverted": "pass",
  "build_identity": "pass",
  "hashes": {
    "baseline": "1111111111111111111111111111111111111111111111111111111111111111",
    "patched": "2222222222222222222222222222222222222222222222222222222222222222",
    "reverted": "1111111111111111111111111111111111111111111111111111111111111111"
  },
  "reverted_hash_note": null,
  "cases": [{
    "check_id": "reported-input",
    "argv": ["python", "receipts/case.py", "reported-input"],
    "source": "receipts/case.py",
    "runs": {
      "baseline": {"exit_code": 1, "elapsed_ms": 15, "stdout": "receipts/case-base.stdout", "stderr": "receipts/case-base.stderr"},
      "patched": {"exit_code": 0, "elapsed_ms": 14, "stdout": "receipts/case-patched.stdout", "stderr": "receipts/case-patched.stderr"}
    }
  }],
  "project_checks": [{
    "check_id": "focused-suite",
    "kind": "suite",
    "argv": ["pytest", "tests/test_upload.py"],
    "baseline": null,
    "patched": {"exit_code": 0, "elapsed_ms": 860, "stdout": "receipts/suite.stdout", "stderr": "receipts/suite.stderr"}
  }],
  "unproven": ["Inputs outside the declared boundary were not assessed."],
  "agent": "prover-1"
}

For a bounded class, include at least two distinct failing representatives and a valid control. The record must cover every planned case by unique check_id. Use the same harness and command on both commits; do not reveal the side to the harness or change expectations by side. Review the selected cases for relevance; retained receipts establish only what those cases exercised.

How to install Prove Patch

Claude Code

Copy the skill into your personal skills folder (or into .claude/skills/ inside a project):

npx degit trailofbits/skills/plugins/patching-bugs/skills/prove-patch#main ~/.claude/skills/prove-patch

Codex

npx degit trailofbits/skills/plugins/patching-bugs/skills/prove-patch#main ~/.codex/skills/prove-patch

Claude.ai and Claude Desktop

Download the skill folder from GitHub, zip it, and upload it under Settings → Capabilities → Skills.

Frequently asked questions

+What does the Prove Patch skill do?

Use when a local security patch commit needs independent scoped and three-arm proof.

+How do I install Prove Patch in Claude Code?

Copy the skill folder into ~/.claude/skills/prove-patch, for example with "npx degit trailofbits/skills/plugins/patching-bugs/skills/prove-patch#main ~/.claude/skills/prove-patch". Claude Code loads it automatically and uses it when a task matches.

+Does Prove Patch work with ChatGPT or Codex?

Yes. Prove Patch uses the open SKILL.md format. In Codex, put the folder in ~/.codex/skills/prove-patch. In Claude.ai, zip the folder and upload it under Settings → Capabilities → Skills.

+Is Prove Patch free?

Prove Patch is published on GitHub by trailofbits under the CC-BY-SA-4.0 license, which allows free use.

Related software development skills

  1. Code Review

    Review the changes since a fixed point (commit, branch, tag, or merge-base) along two axes: Standards (does the code follow this repo's…

    mattpocock/skills★ 327k
  2. Using Agent Skills

    Discovers and invokes agent skills. Use when starting a session, or when you need to decide which skill or workflow applies to the piece of…

    addyosmani/agent-skills★ 119k
  3. Build

    Fully automate a coding task with make-plan, do, and babysit.

    thedotmack/claude-mem★ 118k
  4. Regression Hunt

    Official

    Use when investigating regressions in PRs or commits, coordinating a regression campaign, or resuming saved progress.

    trailofbits/skills★ 8.3k
  5. Report Regressions

    Official

    Use when assembling or refreshing an evidence-linked regression report from saved campaign decisions.

    trailofbits/skills★ 8.3k
  6. Reproduce Bug

    Official

    Use when a named runtime or compiler bug in a local repository needs independent reproduction.

    trailofbits/skills★ 8.3k
  7. Rust Review

    Official

    Performs comprehensive Rust security review for safe/unsafe boundary issues, memory safety in unsafe blocks, concurrency hazards,…

    trailofbits/skills★ 8.3k
  8. Second Opinion

    Official

    Gets independent code reviews from Codex or Antigravity for uncommitted changes, branch diffs, and commits.

    trailofbits/skills★ 8.3k
  9. Slicing Code Context

    Official

    Selects bounded, graph-informed source slices with Trailmark and delegates focused code analysis or patch-proposal work to a smaller…

    trailofbits/skills★ 8.3k

See all software development skills →

More skills from trailofbits

  1. Replay Regression

    Official

    Use when independently verifying a supplied PoC against fresh live before/after deployments.

    trailofbits/skills★ 8.3k

All skills by trailofbits →

Give your whole team an AI agent with skills

Cody runs managed AI agents your team can message in Slack, Teams, WhatsApp and the web, with 50+ business integrations, scheduled tasks and memory. No terminal required.