Installs a local hook that stops Claude Code or Codex sessions when the agent repeats the same tool call, fails 5 times in a row, or exceeds a dollar cap. Useful for spending limits and loop detection in interactive sessions.
Ships in harness-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
An agent left alone can repeat a failing command, retry broken calls, or keep spending long after the
work stopped paying off, and Claude Code's --max-budget-usd cap works only in print mode. This skill
installs a hook (a command the harness runs before every tool call) that steps in at three trip
wires: the same call a third time with nothing changed, five failed calls in a row, and a dollar cap.
The hook reads the session's transcript files on this machine, keeps only counts and hashes, and sends
nothing anywhere.
session-waste-report.guardrail-tester.rules-to-guards.claude -p): its own --max-budget-usd and --max-turns flags cap it.references/harness-hooks.md says what each lacks.<skill-dir> means the folder that holds this SKILL.md (Claude Code shows it as the skill's base
directory). Run every command through python3 exactly as written, with the path in double quotes:
skill folders can sit under paths with spaces.
Explain the three trip wires and their defaults in plain words:
Done when the user has heard all three wires and the $10 default cap.
Ask for three choices: the dollar cap, the harness (Claude Code or Codex), and the scope (user: every session of this user; project: only sessions in the current project). Say that on a subscription plan the dollar figure measures usage at API prices, not the bill. Done when you have all three answers, or the user accepted the defaults: Claude Code, user scope, $10.
Show the dry run with the user's choices:
python3 "<skill-dir>/scripts/install.py" --harness claude-code --scope user --cap 10
It prints the headline, the settings file it would change, the diff, and notes, and writes nothing.
Add --project <folder> for project scope when the agent's working folder is not the project.
Done when the user has seen the headline and the diff and has said yes or no.
Install only on a clear yes: run the same command with --write added. Done when the output
starts with the headline and says "Done". Exit code 2 means a settings file could not be read as
JSON, has an unexpected shape, or could not be written; nothing was changed. Quote the message,
and leave the file for the user to fix.
Relay the notes printed under "Notes", in particular:
/hooks.--uninstall, then install again
from the new place: the hook entry points at this folder.Done when every note is passed on.
Offer status:
python3 "<skill-dir>/scripts/status.py"
Done when the user has the headline, or declined.
To remove the guard, run python3 "<skill-dir>/scripts/install.py" --uninstall, show the diff, and
add --write on a clear yes. With no --harness, --scope, or --settings, it checks all four places
the guard can be (Claude Code and Codex, user and project) and names each file it changes. It removes
only the guard's own entries, and puts a file back exactly as it was when nothing else changed it.
A blocked call comes back as a tool error that starts with "Runaway guard". Stop and pass the message to the user in your own words, naming the trip wire.
status.py included, and in Claude Code the turn ends.
Answer in text only. Give the user the two ways on that the message names, for them to use in their
own terminal: the setting that holds the cap (the file, or the RUNAWAY_GUARD_CAP_USD variable), and
the status.py ... --reset command. To see the counts, they run python3 "<skill-dir>/scripts/status.py"
there too. The cap is theirs to lift.install.py:
--cap, the guard's settings
files, and any RUNAWAY_GUARD_* variable set in the shell.disableAllHooks.--json for an install: headline, action, settings_path, config_path, command, cap_usd,
limits, changed, written, other_hooks, notes. For --uninstall: headline, action,
hook_entries_removed, changed, written, notes, and targets (each file checked, with
removed and restored_exactly).status.py (defaults to the session the guard checked most recently; --session takes an id or its
first characters, --list shows every session):
--json: session, spent_usd, total_usd, cap_usd, limits, trips, recent_trips,
failure_streak, transcripts, estimated_usd, estimated_tokens, estimated_models, resets,
errors_logged.references/how-it-decides.md has every rule, threshold, setting, and safeguard, with calibration on
real sessions; references/harness-hooks.md has what each harness's hooks allow, with sources.
After an install or a dry run:
--cap was given.For status:
scripts/guard.py: the hook. Reads the hook input on stdin and prints a decision. Always exits 0,
and lets the call through on any internal error, logging it to errors.log in the state folder.scripts/install.py: prints the settings change and applies it with --write; --uninstall
removes only the guard's entries. Flags: --harness, --scope, --project, --cap, --settings,
--json, --out.scripts/status.py: spend and trip counts per session; --list, --session, --reset, --json,
--out.scripts/transcripts.py, scripts/pricing.py, scripts/safe.py: the shared transcript reader, price
table, and text cleaner that puts session ids, tool names, and model ids in the report inside inline
code, copied from this repository's shared code.references/how-it-decides.md: the trip wires, thresholds, settings, safeguards, and speed.references/harness-hooks.md: hook support in Claude Code, Codex, Gemini CLI, Cursor, and OpenCode.LICENSE.txt (opens in a new tab)README.md (opens in a new tab)references/harness-hooks.md (opens in a new tab)references/how-it-decides.md (opens in a new tab)scripts/guard.py (opens in a new tab)scripts/install.py (opens in a new tab)scripts/pricing.py (opens in a new tab)scripts/safe.py (opens in a new tab)scripts/status.py (opens in a new tab)scripts/transcripts.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/harness-skills:runaway-guardfrom harness-skills
npx claudepluginhub ryanalberts/best-of-agent-harnesses --plugin harness-skills10 skills in this plugin
/agents-md-checkerChecks which instruction files (AGENTS.md, CLAUDE.md, GEMINI.md, Cursor rules, Copilot instructions) each coding agent loads from a repo, what gets cut or skipped, and whether the commands those files document still work. Use when the user asks whether Claude Code, Codex, Gemini CLI, Cursor, OpenCode, Copilot, or Aider reads their AGENTS.md or CLAUDE.md; why an agent ignores or truncates part of a context file; whether the build, test, or lint commands and paths in AGENTS.md are stale; or wants to audit context files across agents. Reads local files and makes no network calls; runs documented test, lint, and build commands only with --run after the user agrees./claim-checkClaim checker that audits a coding agent's statements that tests pass or a build is clean against its own session transcripts: whether a matching run happened before the claim, whether it passed, and whether code changed after it. Use when the user asks whether the agent really ran the tests, how often it said tests passed without proof, or whether "all tests pass" was true; wants to catch false or stale success claims; asks whether the agent deleted, skipped, or xfailed failing tests or loosened assertions in the current diff; or wants a Stop hook that sends the agent back to rerun tests before finishing. Runs locally: reads Claude Code, Codex, Gemini CLI, and OpenCode transcripts and the git diff; sends nothing./guardrail-testerGuardrail tester that checks whether the permission rules and PreToolUse hooks already set up in Claude Code, Codex, Gemini CLI, OpenCode, or Cursor stop a battery of dangerous commands, including wrapped, reordered, and full-path forms that slip past prefix rules, and measures prompt friction on the latest tool calls. Use when the user asks whether deny rules or hooks block force pushes, rm -rf, secret reads, or downloads piped into a shell; wants to test or audit guardrails, or find a bypass in permission settings or exec policy; asks how many prompts or blocks the rules cause; or just installed a guard hook and wants proof it holds. Local only, no network; executes the user's own hook commands only with their yes./harness-test-driveTest-drives coding agents (Claude Code, Codex, Gemini CLI) on tasks mined from the user's own git history: each agent gets a past commit message in a fresh copy of the repo, and the repo's own tests score how many tasks it completes, dollars per task, minutes, and change size. Use when the user asks which coding agent or harness works best on their codebase; wants to compare or benchmark agents on their own repository instead of trusting leaderboards such as SWE-bench; wants to trial one agent against another before switching; or asks what each agent costs per fixed bug. Spends money: the harness CLIs call their model providers, so a dollar cap is required. The scripts make no network calls./regression-finderRegression check for coding agents: shows how the agent behaved before and after each harness update, model switch, or week in the user's own Claude Code or Codex history, and finds the point where it changed. Use when the user says the agent's quality dropped or it got worse, dumber, lazier, or degraded since an update or since they upgraded; asks whether a new Claude Code or Codex version or model made it worse than the old one; wants to know which release, version, or week it regressed in; or wants numbers to report a regression, such as reads before edits, interruptions, and corrections per version. Runs locally and reads transcripts only; nothing goes over the network./rules-to-guardsRule enforcer that finds which written rules in AGENTS.md, CLAUDE.md, and GEMINI.md a coding agent keeps breaking, counts every violation in recent Claude Code, Codex, Gemini CLI, and OpenCode sessions, and turns each broken rule into a hook that blocks it, tested by replaying the past violations. Use when the user says the agent keeps breaking or disobeying a rule (such as "use pnpm, never npm"); asks how often agents violate their rules; wants a rule enforced by a hook instead of repeated in text; or wants to convert rules into hooks or permission rules. Runs locally: reads AGENTS.md-style rules and session transcripts, and changes settings only with --write after the user agrees.2 plugins ship this exact skill · first indexed Oct 9, 2026
Other plugins' skills for the same job