remediate

remediate is a command for coding agents from omermaksutii/RugProof. It costs 23 tokens per session (606 once invoked), scanned A, original, MIT.

A code-fixing workflow that turns one or more audit findings into concrete patches, delivered as a unified diff and optionally applied. A unified diff is a standard text format showing the exact file changes.

In plain words
What is it for?
Use it to resolve findings from a recent audit, generate patches, run project checks such as Foundry or npm tests, and verify that the reported issue is gone.
Why use it?
It helps move from a reported security or code problem to a reviewable fix, with compilation, tests, and a follow-up check where supported.

Command

Part of the rugproof plugin — 35 commands, 23 agents 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/omermaksutii/rugproof/remediate
Clone the repo
git clone --depth 1 https://github.com/omermaksutii/RugProof

Or install rugproof, the plugin that ships this one along with the rest of its 35 commands, 23 agents.

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 remediate

README.md
[![agentmods](https://agentmods.dev/badge/commands/omermaksutii/rugproof/remediate.svg)](https://agentmods.dev/commands/omermaksutii/rugproof/remediate)
Your own site
<a href="https://agentmods.dev/commands/omermaksutii/rugproof/remediate"><img src="https://agentmods.dev/badge/commands/omermaksutii/rugproof/remediate.svg" alt="Measured on agentmods" height="20"></a>
Per session 23 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 606 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.00023 $0.00606
Opus 5 $0.00012 $0.00303
Sonnet 5 $0.00005 $0.00121
Haiku 4.5 $0.00002 $0.00061

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

Security

Grade A, and why

remediate 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 4d 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/remediate.md · 64 lines

How it starts

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

/remediate — write the fix

For each finding ID in $ARGUMENTS, produce a concrete code patch.

Procedure

Step 1 — Resolve finding(s)

Pull the finding(s) from the most recent audit. If not available, ask the user to re-run /audit or pipe in a findings.json.

Step 2 — Dispatch remediation-suggester subagent

For each finding, the subagent:

  • Reads the affected file and the relevant skill from skills/
  • Generates the fix as a unified diff against the file
  • Cross-references known-good implementations (OZ, Solady) for the canonical fix shape
  • Adds a // rugproof: fixed REENT-001 comment? No — do not add comments about the fix. Just fix it. (CLAUDE.md rule: no "fixed X" comments.)

Step 3 — Validate the patch

Before output:

  • Check the patch compiles (run forge build if Foundry project).
  • Run any existing tests (forge test or npm test) to make sure the fix doesn't break them.
  • Re-run the relevant vuln skill against the patched file — confirm the finding is gone.

Step 4 — Output

Remediation for REENT-001:

--- a/src/Vault.sol
+++ b/src/Vault.sol
@@ -140,10 +140,10 @@ function withdraw() external {
-    uint256 amt = balance[msg.sender];
-    (bool ok,) = msg.sender.call{value: amt}("");
-    require(ok);
-    balance[msg.sender] = 0;
+    uint256 amt = balance[msg.sender];
+    balance[msg.sender] = 0;
+    (bool ok,) = msg.sender.call{value: amt}("");
+    require(ok, "withdraw failed");
}

Verification:
  forge build:    ✓
  forge test:     12 passing, 0 failing
  re-audit:       REENT-001 no longer reported

If --apply flag passed, also apply the patch to the file in place. Otherwise just print it.

Notes

  • One patch per finding by default. If multiple findings are in the same function, you may combine them in one diff with a clear note.
  • If the fix requires architectural change (e.g. "move from push to pull payments"), the patch may span multiple files. Tell the user.
  • Never add comments to the patched code beyond what was there.
  • If the fix isn't safely automatable (e.g. needs a multi-sig deployment), output advice instead of a diff.

Read the full file on GitHub · 64 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. 4d ago First seen · 64 lines · 23 tokens per session scan A 518c225d3044

Subscribe to this mod's changes

remediate is a command published in the GitHub repository omermaksutii/RugProof (9 stars, last pushed 1mo ago), licensed MIT. It adds 23 tokens to every session and 606 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.