Skip to content
Development
Hook

Hooks

What writ runs automatically, and when. A hook is a command Claude Code fires at a fixed moment, without you asking for it.

From plugin
writ
1735 agents1 command12 hooks
Install
> /plugin marketplace add infinri/Writ
> /plugin install writ@writ

Ships with writ. 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.

  • bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/writ-blackbox-capture.sh
  • bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/session-start-bootstrap.sh

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.

  • bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/writ-manual-test-grant.sh
  • bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/auto-approve-gate.sh
  • bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/writ-rag-inject.sh

SubagentStart

  • bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/writ-subagent-start.sh

SubagentStop

  • bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/writ-blackbox-capture.sh
  • bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/writ-subagent-stop.sh

Stop

  • bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/friction-logger.sh
  • bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/enforce-violations.sh
  • bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/writ-verify-before-claim.sh
  • bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/writ-run-pending-tests.sh
  • bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/writ-comms-output-gate.sh

PostToolUseFailure

  • Matches.*bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/writ-blackbox-capture.sh

PreCompact

  • bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/writ-precompact.sh

PostCompact

  • bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/writ-blackbox-capture.sh
  • bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/writ-postcompact.sh

SessionEnd

  • bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/writ-session-end.sh
  • bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/writ-pressure-audit.sh

CwdChanged

  • bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/writ-blackbox-capture.sh
  • bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/writ-cwd-changed.sh

PreToolUse

  • MatchesExitPlanModebash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/validate-exit-plan.sh
  • MatchesReadbash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/writ-read-junk-gate.sh
  • MatchesReadbash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/writ-read-rag.sh
  • MatchesGrep|Read|Globbash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/writ-debug-code-gate.sh
  • MatchesWrite|Edit|NotebookEditbash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/writ-state-write-gate.sh
  • MatchesWrite|Edit|NotebookEditbash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/writ-pre-write-dispatch.sh
  • MatchesWrite|Editbash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/pre-validate-file.sh
  • MatchesTaskbash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/writ-dispatch-discipline.sh
  • MatchesBashbash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/writ-worktree-safety.sh
  • MatchesBashbash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/writ-bash-write-gate.sh
  • MatchesWritebash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/validate-test-file.sh
  • MatchesWritebash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/validate-design-doc.sh
  • MatchesWritebash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/writ-memory-policy-guard.sh

PostToolUse

  • MatchesBashbash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/inject-tier-workflow.sh
  • MatchesWebFetch|WebSearchbash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/writ-web-capture.sh
  • MatchesWrite|Editbash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/validate-file.sh
  • MatchesWrite|Editbash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/writ-bible-authoring-push.sh
  • MatchesWrite|Editbash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/validate-handoff.sh
  • MatchesWrite|Editbash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/validate-rules.sh
  • MatchesWrite|Edit|NotebookEditbash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/writ-posttool-rag.sh
  • MatchesWritebash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/writ-quality-judge.sh
  • MatchesWrite|Editbash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/writ-mark-pending-test.sh
  • MatchesWrite|Editbash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/writ-memory-capture.sh
Read hooks/hooks.json
Ships withwrit

A Claude Code harness that enforces engineering discipline at the moment the AI acts, and delivers the rules that fit the work in front of it.

Get the whole plugin