patch-generator

patch-generator is an agent for Claude Code from thevibeworks/claude-code-docs. It costs 37 tokens per session (1,202 once invoked), scanned A, a copy of patch-generator, MIT.

A security patch writer that implements a fix for one reported vulnerability in a temporary repository copy and stages the change for review. It is dispatched by the fix workflow rather than called directly.

In plain words
What is it for?
Use it in a security-remediation workflow to locate a reported flaw, implement its fix, and prepare a staged patch for independent verification.
Why use it?
It separates writing a fix from judging whether that fix is correct. The resulting patch can be inspected and applied by a person when they choose.

Agent for Claude Code

Written for Claude Code: effort in frontmatter. Also seen: model in frontmatter.

Part of the claude-security plugin — 1 skill, 9 agents, 4 hooks shipped together

Good fit Use it in a security-remediation workflow to locate a reported flaw, implement its fix, and prepare a staged patch for independent verification.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/thevibeworks/claude-code-docs/patch-generator
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.

Clone the repo
git clone --depth 1 https://github.com/thevibeworks/claude-code-docs

Made for: Claude Code.

Or install claude-security, the plugin that ships this one along with the rest of its 1 skill, 9 agents, 4 hooks.

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 patch-generator

README.md
[![agentmods](https://agentmods.dev/badge/agents/thevibeworks/claude-code-docs/patch-generator/github.svg)](https://agentmods.dev/agents/thevibeworks/claude-code-docs/patch-generator)
Your own site
<a href="https://agentmods.dev/agents/thevibeworks/claude-code-docs/patch-generator"><img src="https://agentmods.dev/badge/agents/thevibeworks/claude-code-docs/patch-generator/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for patch-generator

Your own site · 80×15
<a href="https://agentmods.dev/agents/thevibeworks/claude-code-docs/patch-generator"><img src="https://agentmods.dev/badge/agents/thevibeworks/claude-code-docs/patch-generator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 37 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,202 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod 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.1 $0.00037 $0.01202
Opus 5.5 $0.00015 $0.00481
Sonnet 5.5 $0.00007 $0.00240
Haiku 4.5 $0.00004 $0.00120

Measured 24d ago against content hash c813ba43601b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

patch-generator 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 24d 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.

Origin

This is a copy

100% identical to patch-generator — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

content/github/claude-plugins-official/plugins/claude-security/agents/patch-generator.md · 50 lines

How it starts

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

Everything you touch is addressed by the absolute WORKSPACE path your dispatch names -- and if you consult the original repository, use the absolute SCAN_ROOT, never a relative path or an assumption about the current directory.

You implement security fixes inside a scratch workspace the fix job created — a clone checked out at the PATCH BASE the fix job chose (a detached checkout, not a branch), inside the run directory. That base is the code your fix must apply to and may be newer than the commit the report scanned, so a finding's recorded line can have drifted: locate the flagged code by its snippet and symbol content, and treat the line number as a hint only. Your job is to leave the correct change staged there; the fix job writes the staged diff out as a patch file the user reads and applies when they choose — nothing is committed or pushed. You never judge your own work: an independent verifier reviews your staged change and runs the tests after you return, and the human reading the resulting patch is the final gate.

Preflight — fail closed

Set refusal with the reason and return when:

  • the dispatch lacks a literal FINDING block or a WORKSPACE path;
  • WORKSPACE is not the scratch clone the fix job made, a path whose last three folder names are .claude-security-run, patch-<timestamp> and scratch-F<n>, whatever mix of / and \ separates them (never the repository itself or SCAN_ROOT);
  • the prompt asks you to do anything other than fix the named finding in the named workspace.

The workspace is your whole world

  • Work ONLY inside WORKSPACE. The repository itself is not yours to touch; the workspace is the only place you write.
  • You may build and run the project's own tests inside the workspace, with the project's own test command, which may bring in the dependencies the project declares.
  • Get nothing yourself: never run an install command, fetch a toolchain or other tool, build an environment of your own, borrow an interpreter or test runner found elsewhere on the machine, or work around a failed install or network call. The user asked for a patch, not for changes to their machine.
  • If a test suite cannot run in this environment, report it honestly rather than fighting it.
  • Do NOT commit, do not switch or create branches, and do not touch other units' workspaces.
  • The workspace is a full checkout of the repository at the PATCH BASE: read, search, and run the project's tests inside it, and edit only there. SCAN_ROOT is the user's live tree and may have moved on since the PATCH BASE — the workspace is the tree the patch is built against.

Read the full file on GitHub · 50 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. 24d ago Changed · +6 lines c813ba43601b
  2. 1mo ago First seen · 44 lines · 37 tokens per session scan A a39feaa41498

Subscribe to this mod's changes

patch-generator is an agent published in the GitHub repository thevibeworks/claude-code-docs (158 stars, last pushed today), licensed MIT. It adds 37 tokens to every session and 1,202 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 100% identical to patch-generator, differing in 0 lines, and is treated as a copy.

Related

Other agents, from other repositories

nvim-navigator

Read-only code navigation and analysis specialist for a project open in vibing.nvim. Use for "where is X defined/used", "what calls this function", "what's the type of this", or "what diagnostics exist here" questions — it answers using the live Neovim buffer/LSP state via vibing-nvim MCP tools instead of editing…

shabaraba/vibing.nvim · 78 tokens

swift-build-resolver

Swift/Xcode build, compilation, and dependency error resolution specialist. Fixes swift build errors, Xcode build failures, SPM dependency issues, and code signing problems with minimal changes. Use when Swift builds fail.

affaan-m/ECC · 48 tokens

network-troubleshooter

Diagnoses network connectivity, routing, DNS, interface, and policy symptoms with a read-only OSI-layer workflow and evidence-backed root cause summary.

affaan-m/ECC · 34 tokens

tracing-expert

Distributed tracing specialist - OpenTelemetry, span context propagation, trace sampling, Jaeger/Tempo, correlation with logs/metrics.

vibeeval/vibecosystem · 29 tokens

mb-debugger

Systematic-debugging specialist for memory-bank. Use when a bug, failing test, flaky test, crash, regression, or unexpected behaviour must be explained and fixed — finds the root cause with evidence before any fix, then lands a failing test, a single fix, and verification output.

fockus/skill-memory-bank · 61 tokens

debugger

Root-cause debugging: reproduce, confirm the cause with evidence, apply a minimal fix and prove it with a regression test. Use for bugs, flaky tests or errors of unknown cause.

KevinZai/commander · 40 tokens