Hooks
What razor runs automatically, and when. A hook is a command Claude Code fires at a fixed moment, without you asking for it.
$ npx -y skills add V-Songbird/razor --agent claude-codeShips with razor. Installing the plugin gets these hooks.
What fires, and when
SessionStart
Fires once when a session begins, and again after a context compaction. It is where a plugin sets up its environment, or restores state the compaction dropped.
- Runs node.
SubagentStart
- Runs node.
PreToolUse
- Runs node.
Stop
- Runs node.
UserPromptSubmit
Fires before Claude sees each prompt you send. A plugin can use it to inject context, so the same instruction reaches the model every turn instead of only at session start.
- Runs node.
SessionEnd
- Runs node.
Where it lives
- hooks/build-ledger.jsGitHub
- hooks/dep-guard.jsGitHub
- hooks/file-meter.jsGitHub
- hooks/import-guard.jsGitHub
- hooks/manifest-guard.jsGitHub
- hooks/mode-toggle.jsGitHub
- hooks/pre-tool-use.jsGitHub
- hooks/razor-lib.jsGitHub
- hooks/search-meter.jsGitHub
- hooks/session-end.jsGitHub
- hooks/session-start.jsGitHub
- hooks/subagent-start.jsGitHub
Showing the source of 6 of 12 scripts. Every one is linked above.
Read the script before you install anything that runs on your machine. This is the one part of a plugin that acts without being asked.
🪒 YAGNI enforcement at the harness level, nudges toward the simplest solution and gates against unnecessary dependencies, file sprawl, and unchecked build growth.
Repo: V-Songbird/razor

