claude-calibration / hooks
CLAUDE.md1 starsChanged 6 months agoMITView on GitHub
The plugin's two PreToolUse write-guards plus a SessionStart workflow installer, and their wiring. They ship with the plugin; the guards protect the audited project from unintended writes during a calibration run, and the installer makes the bundled Workflow script(s) runnable. - hooks.json — wires both guards on Edit|Write|MultiEdit and the installer on SessionStart, using ${CLAUDE_PLUGIN_ROOT}. - calibrator-write-guard.sh — fires only when the active subagent is calibration-calibrator; blocks writes outside the calibrator's allow-list. - audit-write-guard.sh — fires only during a calibration-audit…
In this repository25 other files it gives its agents.
- agents/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- .claude/skills/CLAUDE.mdCLAUDE.md
- rules/CLAUDE.mdCLAUDE.md
- skills/CLAUDE.mdCLAUDE.md
- docs-statusSkill
- docs-updateSkill
- plugin-updateSkill
- calibrate-claude-mdSkill
- calibrate-generalSkill
- calibrate-hooksSkill
- calibrate-mcpSkill
- calibrate-pluginsSkill
- calibrate-rulesSkill
- calibrate-settingsSkill
- calibrateSkill
- calibrate-skillsSkill
- calibrate-subagentsSkill
- calibration-auditSkill
- calibration-diffSkill
- calibration-doctorSkill
- calibration-flowSkill
- calibration-onboardingSkill
- calibrationSkill
- calibration-trackSkill
The file
We split this CLAUDE.md into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 28
Commands resolve: Every command in hooks.json must point at an existing executable under hooks/ (gate G13).
- Very specific: line 30
Blocking is
exit 2: Only exit code 2 blocks a tool call.
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md — hooks
Scope
The plugin's two PreToolUse write-guards plus a SessionStart workflow installer, and their wiring.
They ship with the plugin; the guards protect the audited project from unintended writes during a
calibration run, and the installer makes the bundled Workflow script(s) runnable.
hooks.json— wires both guards onEdit|Write|MultiEditand the installer onSessionStart, using${CLAUDE_PLUGIN_ROOT}.calibrator-write-guard.sh— fires only when the active subagent iscalibration-calibrator; blocks writes outside the calibrator's allow-list.audit-write-guard.sh— fires only during acalibration-auditrun (intent_source: audit-flow); blocks writes outside the run folder (the read-only contract).install-workflows.sh—SessionStart; copies../workflows/*.mjsinto the project's.claude/workflows/registry (so/workflowslists them). Idempotent and never clobbers local edits: copies when missing, silent when identical, warns when a present copy differs. Alwaysexit 0(never blocks a session); no network.
Invariants you must not break
- Zero-cost when not applicable. Each guard exits early and silently when its condition isn't met
(wrong subagent / not an audit run). Preserve the early-exit; a guard that does work on every
Edittaxes every session. - No network at fire time. No
curl/wget/ remotenpx. Enforced three ways: gate G12 (12-hooks-no-remote.sh), thehook:remote-untrustedsignature, and this repo's own.claude/hooks/plugin-dev-guard.sh. - Commands resolve. Every
commandinhooks.jsonmust point at an existing executable underhooks/(gate G13). Keep the${CLAUDE_PLUGIN_ROOT}/hooks/...form. - Blocking is
exit 2. Only exit code 2 blocks a tool call;exit 1is non-blocking (thehook:exit-1-non-blockinganti-pattern).
Editing checklist
- Guard still early-exits when its condition is absent.
- No
curl/wget/remote fetch added. shellcheck -S errorclean (gate G8 lintshooks/*.sh).bash tests/gates/run-all.shgreen (G12 + G13 cover this dir).
How to test this area
bash tests/gates/12-hooks-no-remote.shandbash tests/gates/13-hooks-json-resolves.sh.claude --plugin-dir .→/reload-plugins→/hookslists the twoclaude-calibrationentries;/claude-calibration:calibration-auditexercises the audit guard.
When in doubt
Hook semantics (matchers, exit codes, scoping) live in
../docs/features/hooks.md; the house rule against remote fetches is in
../.claude/rules/plugin-dev.md.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

