hooks
Skill0 starsChanged 3 months agoMITView on GitHub
Use for Catalyst's two plugin-native lifecycle hooks (PreCompact → handoff WRITE, SessionStart → auto-render brief on clear/compact (one-line announce on startup/resume)) — checking hook status, disabling or re-enabling a Catalyst hook, scaffolding new hooks, or linting hook scripts. Trigger phrases: 'hook status', 'disable a Catalyst hook', 'wire up handoff', 'ambient mode', '/hooks', 'hook scaffold', 'hook lint', 'author a hook'.
13 other projects use a version of this.
Adopted by
Most recently taken up by
- Samin12/skillstheir own version, first seen Aug 14, 2026
- Data-Wise/crafttheir own version, first seen Aug 8, 2026
- donatassimkus/claude-ai-skillstheir own version, first seen Jul 23, 2026
- hzblj/skillstheir own version, first seen Jul 15, 2026
- nimadorostkar/Claude-Skills-collectiontheir own version, first seen Jul 14, 2026
- duncan-buildroom/profit-room-skillstheir own version, first seen Jul 8, 2026
Other versions13 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 13
- parcadei/Continuous-Claude-v3★ 3.9ksame name
- nimadorostkar/Claude-Skills-collection★ 28same name
- AI-Answer/ContentRepurposeSystem★ 20same name
- duncan-buildroom/profit-room-skills★ 18same name
- coopersimson96/ai-content-system★ 17same name
- Samin12/skills★ 9same name
- Data-Wise/craft★ 4same name
- Epistates/sparX★ 3same name
- donatassimkus/claude-ai-skills★ 1same name
- hzblj/skills★ 1same name
3 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 13 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 69
If Claude Code makes lifecycle-aware skills first-class, much of hooks becomes vestigial.
“Common” is measured: kept by at least 6 in 10 of the 13 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
hooks
Wires Catalyst into the lifecycle of Claude Code, Codex and GitHub Copilot via one root hooks.json. Both hooks run from the plugin cache — nothing to install.
What the hooks do
| Hook | Event | What it triggers |
PreCompact-handoff-write.sh | About to /compact | Asks Claude to invoke handoff WRITE before compaction destroys state |
SessionStart-handoff-read.sh | New session opens | Detects <branch>.json in the centralized store. Auto-renders on clear/compact; prompts handoff READ on startup/resume |
Both hooks are POSIX bash + jq, and fail-open on infrastructure errors (missing jq, no git repo).
Setup
None — hooks are active as soon as the plugin is installed.
Disabling a hook
/hooks disable precompact
/hooks disable sessionstartWrites hooks.precompact_prompt / hooks.sessionstart_resume to false in .catalyst/config.json — the only state (a legacy .claude/catalyst.json is still read when no canonical file exists, never written). /hooks enable <hook> reverses it. Falsy, case-insensitive: false, 0, no, off. Anything else — including the word "disabled" — is truthy; the hook stays enabled.
Authoring and linting
/hooks new PostToolUse my-custom-checker
/hooks lint hooks/SessionStart-handoff-read.shnew scaffolds hooks/<event>-<name>.sh: stdin JSON, jq check, exit-code semantics, fail-open default, TODO marker. lint checks matcher breadth (.*/empty), set -euo pipefail, jq check, fail-open behavior, event-prefix naming, bash -n syntax, and hardcoded paths instead of $CLAUDE_PROJECT_DIR. Exit code 0 = clean.
Commands
| Command | What it does |
/hooks status | Report the two hooks and their state (deterministic, zero tokens) |
/hooks enable <precompact|sessionstart> | Turn an advisory hook back on |
/hooks disable <precompact|sessionstart> | Turn an advisory hook off |
/hooks new <event> <name> | Scaffold a new hook from template |
/hooks lint <path> | Validate a hook script |
Composition with other Catalyst skills
- Both hooks are registered by the root
hooks.json— nothing is installed or uninstalled. handoffmodes are what the lifecycle hooks invoke — the hooks are messengers, not a reimplementation.- Multiple PreToolUse / PostToolUse hooks compose: most-restrictive wins (deny > defer > ask > allow).
Hook contract reference
See hooks/README.md for stdin/output shape, exit codes, matcher conventions.
Anti-patterns
- Editing
.claude/settings.jsonor.catalyst/config.jsonby hand for hook state. Use/hookscommands. - Writing a hook that depends on Python/Node, or skipping
set -euo pipefail. POSIX bash + jq only; the strict mode catches typos that would otherwise silently misfire. - Returning JSON without
hookEventName. Claude Code, Codex and Copilot use it to route output; missing it means the decision is ignored.
Model evolution
If Claude Code makes lifecycle-aware skills first-class, much of hooks becomes vestigial. If it adds native per-hook enable/disable, the two knobs and the enable/disable sub-commands retire and this skill shrinks to authoring alone. Review annually.
Retired 2026-09-02 (v0.7.0): UserPromptSubmit-orient.sh and Stop-commit-backstop.sh. Archived in the private planning repo.
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.

