agentleFS
odere-proodere-pro/claude-calibration/hooks/CLAUDE.md

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…

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
  1. Very specific:

    Commands resolve: Every command in hooks.json must point at an existing executable under hooks/ (gate G13).

    line 28
  2. Very specific:

    Blocking is exit 2: Only exit code 2 blocks a tool call.

    line 30

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

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 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 run (intent_source: audit-flow); blocks writes outside the run folder (the read-only contract).
  • install-workflows.sh — SessionStart; copies ../workflows/*.mjs into the project's .claude/workflows/ registry (so /workflows lists them). Idempotent and never clobbers local edits: copies when missing, silent when identical, warns when a present copy differs. Always exit 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 Edit taxes every session.
  • No network at fire time. No curl / wget / remote npx. Enforced three ways: gate G12 (12-hooks-no-remote.sh), the hook:remote-untrusted signature, and this repo's own .claude/hooks/plugin-dev-guard.sh.
  • Commands resolve. Every command in hooks.json must point at an existing executable under hooks/ (gate G13). Keep the ${CLAUDE_PLUGIN_ROOT}/hooks/... form.
  • Blocking is exit 2. Only exit code 2 blocks a tool call; exit 1 is non-blocking (the hook:exit-1-non-blocking anti-pattern).

Editing checklist

  • Guard still early-exits when its condition is absent.
  • No curl/wget/remote fetch added.
  • shellcheck -S error clean (gate G8 lints hooks/*.sh).
  • bash tests/gates/run-all.sh green (G12 + G13 cover this dir).

How to test this area

  • bash tests/gates/12-hooks-no-remote.sh and bash tests/gates/13-hooks-json-resolves.sh.
  • claude --plugin-dir . → /reload-plugins → /hooks lists the two claude-calibration entries; /claude-calibration:calibration-audit exercises 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.