agentleFS
joris887joris887/exosuit/.claude/hooks/CLAUDE.md

exosuit / hooks

CLAUDE.md9 starsChanged 3 months agoMITView on GitHub

POSIX shell hook scripts with text-based rule configuration. No Python or other runtime required. See README.md for full hook documentation including profiles, runtime disabling, and pattern severity. All hooks call lib/hook-guard.sh to check: - EXOSUIT_PROJECT_PROFILE (lean/standard/strict) — project complexity profile; controls skill behavior and derives default hook profile. Read from env var, then CLAUDE.md **Profile:** line, then defaults to standard. - EXOSUIT_HOOK_PROFILE (minimal/standard/strict) — explicit hook profile override; if not set, derived from project profile (lean→minimal, standard→standard, strict→strict) - EXOSUIT_DISABLED_HOOKS…

The file

We split this CLAUDE.md into the rules it gives an agent

6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Create <event-name>.sh (POSIX sh) that reads JSON from stdin

    line 12
  2. Very specific:

    Add "$HOOKS_DIR/lib/hook-guard.sh" "<hook-id>" "<min-profile>" || exit 0 near the top

    line 13
  3. Very specific:

    Add rules in rules/<name>.patterns if needed

    line 14
  4. Very specific:

    All hooks call lib/hook-guard.sh to check:

    line 22
  5. Distinctive:

    Use staged-only file checks, not full repo scans

    line 31
  6. Distinctive:

    If a hook consistently exceeds 5s, split into fast (local hook) and comprehensive (CI) checks

    line 33

≈ “Common” is an estimate: at least 1 in 5 of the 26,980 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

Hooks Directory

POSIX shell hook scripts with text-based rule configuration. No Python or other runtime required.

  • Each hook event has its own .sh script (self-contained)
  • Rules in rules/*.patterns (@@-delimited) and rules/*.conf (key=value)
  • State in state/ directory (plain text files: counters, timestamps)
  • JSON extraction: tries jq, falls back to sed (no hard dependency on jq)
  • Profile gating via lib/hook-guard.sh and EXOSUIT_HOOK_PROFILE env var

Adding a new hook:

  1. Create <event-name>.sh (POSIX sh) that reads JSON from stdin
  2. Add "$HOOKS_DIR/lib/hook-guard.sh" "<hook-id>" "<min-profile>" || exit 0 near the top
  3. Add rules in rules/<name>.patterns if needed
  4. Register the event in .claude/settings.json
  5. Document in README.md

See README.md for full hook documentation including profiles, runtime disabling, and pattern severity.

Hook Guard

All hooks call lib/hook-guard.sh to check:

  • EXOSUIT_PROJECT_PROFILE (lean/standard/strict) — project complexity profile; controls skill behavior and derives default hook profile. Read from env var, then CLAUDE.md **Profile:** line, then defaults to standard.
  • EXOSUIT_HOOK_PROFILE (minimal/standard/strict) — explicit hook profile override; if not set, derived from project profile (lean→minimal, standard→standard, strict→strict)
  • EXOSUIT_DISABLED_HOOKS (comma-separated IDs) — skips individually disabled hooks
  • EXOSUIT_EXPLAIN_MODE (off/brief/verbose) — controls message verbosity (brief = default)
  • EXOSUIT_STOP_MAX_ITERATIONS — overrides stop hook safety valve (default 5, strict profile defaults to 10, ≤0 = no limit)

Performance

  • Pre-edit and post-edit hooks MUST complete in <5 seconds — slow hooks get disabled
  • Use staged-only file checks, not full repo scans
  • Format only the edited file, not the entire project
  • If a hook consistently exceeds 5s, split into fast (local hook) and comprehensive (CI) checks

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.