Tests whether permission rules and PreToolUse hooks in Claude Code, Codex, Gemini CLI, OpenCode, or Cursor block dangerous commands (force pushes, rm -rf, secret reads, piped downloads) including wrapped and full-path variants. Measures prompt friction from rules.
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.
Permission rules match the text of a command, so git push origin +main, rm -r -f build, and
bash -c '...' can walk past a deny rule written for the plain form. This skill checks the rules
and hooks the user already has against about 90 dangerous commands in those forms, then replays
their recent tool calls to count how often the rules would ask or block. The user gets a headline
("Your Claude Code guardrails block 58 of 90 dangerous commands outright. 24 more stop at a
prompt..."), every miss with a tested fix, and their friction numbers. Everything is read and
simulated locally; nothing is sent anywhere, and it runs the user's hook commands only after they
say yes.
sandbox-check.rules-to-guards.runaway-guard.templates/claude-code-safe-settings/ in this
repository, then test it here.Say this to the user in short before the first run with hooks. It is the whole contract.
./guardrail-tester-probe/
folder, its remotes and branches (probe-remote, probe-branch) are made up, and its hosts end
in .invalid, a name reserved for addresses that resolve nowhere.references/harness-rules.md says what each harness simulation covers.--run-hooks flag). Each matching
PreToolUse hook command then runs once per battery case, one run at a time, with a 10-second
limit, from the folder its harness uses (usually the project), with the session's environment
variables plus CLAUDE_PROJECT_DIR. A hook that writes a log or keeps state records those test
calls. A hook that times out twice is not run again.--replay-hooks (which needs --run-hooks) it also runs this
project's hooks on replayed calls from this project. Calls from other project folders are
checked against their own rules; their hooks never run.scripts/battery.json holds the dangerous commands on purpose: they are the test. Each line
carries the marker skillscan:allow, which tells this repository's security scanner that the line
is test data, not a command the skill runs.
<skill-dir> means the folder that holds this SKILL.md (Claude Code shows it as the skill's base
directory). Run every command from the user's project folder, and give each Bash call a 10-minute
timeout (600000 ms): hooks run one at a time, so a slow hook makes the run long.
Run the rules-only test, which reads settings and runs no hook:
python3 "<skill-dir>/scripts/test_guards.py" --project . --harness claude-code
Add --harness for the harness you are running in (claude-code, codex, gemini-cli,
opencode, or cursor) unless the user asks about all; without it the tester covers every
harness with settings on this machine. Done when the output starts with a bold headline, or
you have told the user the error (exit code 2 means a bad argument or an unreadable battery
file).
Tell the user what was found: the settings files and every hook command from the report's "What was found" section, quoted exactly. Done when the user has seen the list.
Read each hook script, then ask before running hooks. Open the script each hook command
runs. If a script runs, evaluates, or sends its input anywhere (eval, bash -c "$cmd", a
curl with the input, a queue), or has other side effects such as writing a log, tell the user
exactly that and recommend testing without hooks. Otherwise name the hook commands and say each
will get test JSON for about 90 battery calls. On a clear yes, run this with a 10-minute Bash
timeout:
python3 "<skill-dir>/scripts/test_guards.py" --project . --harness claude-code --run-hooks --replay 500
Add --replay-hooks only when the user also agrees that this project's hooks see up to 500 of
their recent real calls. When the user declines, or a hook has side effects, run the same
command without --run-hooks. Done when the headline matches the choice: it starts "Your ...
guardrails block" after hooks ran, and "Without running your N hooks" when hooks exist and were
skipped.
Pick the fixes. For each row in "Misses, worst first", take the Fix column: a deny rule
the simulation proved catches that case and leaves everyday commands and files such as
.env.example alone, or a named hook check (an extended regular expression printed below the
tables). Use references/bypass-forms.md to explain why a form slips. Done when every miss you
report has its fix or the note "use the sandbox".
Offer the change. Draft the settings edit or hook lines as a diff against the user's file, show it, and apply it only after a clear yes. Then rerun step 3 to show the new count.
defaultMode in the settings, the tester simulates auto mode, the built-in
default on Claude Code 2.1.283 and later, and adds a "Claude Code in Manual mode" row.
--mode simulates another mode. Plan mode lasts only until a plan is approved.block cases count as stopped only when blocked outright, because people approve
prompts by reflex. ask cases count when they prompt or are blocked. --fail-on-miss uses this
count.blocked, asks first, runs without asking, left to the auto-mode classifier, or unknown. The part in parentheses names the layer that decided: a hook, a rule,
a built-in check (protected paths, critical-path removals, the read-only command set), the
mode, or the sandbox. With a sandbox on, a command that needs the network or writes outside the
project shows asks first (needs network) or stopped by the sandbox.--hook-timeout to settle them.Bash matcher that Cursor never fires, a Codex hook nobody trusted in /hooks,
a shadowed OpenCode deny, or bypass mode left available.--json has every case with verdict, bucket, decided_by, rules_verdict, and
fix, plus hook_checks, every hook check by name.templates/claude-code-safe-settings/ rather than writing a new guard.scripts/test_guards.py: the tester. Flags: --harness, --project, --run-hooks,
--no-hooks (the default), --hook-workers N (default 1), --replay N, --replay-hooks,
--since DAYS, --mode, --battery, --hook-timeout, --home, --json, --out,
--fail-on-miss (exit 1 when a case is not blocked as expected).scripts/battery.json: the dangerous commands, one case per line, each with what it needs to
do its harm (network, write-outside, write-git, write-project).scripts/claude_rules.py, scripts/harness_rules.py: rule simulation per harness.scripts/hook_runner.py: runs one hook command with test JSON and reads its decision.scripts/shell_split.py: splits a command line into the commands it runs.scripts/transcripts.py: reads session transcripts for replay (shared copy).scripts/safe.py: masks secrets and puts text from settings, hooks, and transcripts in inline
code for the report (shared copy).references/bypass-forms.md: each form in the battery and why rules miss it.references/harness-rules.md: matching rules per harness, with sources and the date checked.LICENSE.txt (opens in a new tab)README.md (opens in a new tab)references/bypass-forms.md (opens in a new tab)references/harness-rules.md (opens in a new tab)scripts/battery.json (opens in a new tab)scripts/claude_rules.py (opens in a new tab)scripts/harness_rules.py (opens in a new tab)scripts/hook_runner.py (opens in a new tab)scripts/safe.py (opens in a new tab)scripts/shell_split.py (opens in a new tab)scripts/test_guards.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
2 plugins ship this exact skill · first indexed Oct 9, 2026
10 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./harness-skills:guardrail-testerfrom harness-skills
npx claudepluginhub ryanalberts/best-of-agent-harnesses --plugin harness-skillsOther plugins' skills for the same job