33
hooks wired into Claude Code
Session Prompt Pre-Tool Post-Tool Stop
8
can block
3
rewrite cmds
4
fire confetti
12
telemetry
20
async
▼ scroll
🌿
Event
 
SessionStart
Claude wakes up
Fires once at the start of every session. Sets the stage.
🌿
Git context inject
inline shell command
Prints current branch + last 5 commits directly into Claude's context window. Claude always knows what branch it's on before it says a word.
Mac Stay-Awake
caffeinate.sh start
Spawns a background caffeinate process. Your Mac will not sleep while Claude is working.
async
async claude-hindsight session-start — telemetry, records the session start timestamp
🏁
Event
 
SessionEnd
Claude shuts down
Fires when the session closes. Cleanup + analytics.
Release Mac sleep
caffeinate.sh stop
Kills the caffeinate PID from session start. Your Mac can sleep again.
async
async claude-hindsight session-end — telemetry, records session end
💬
Event
 
UserPromptSubmit
You type something
Every single message you send passes through these first.
🎉
Yay → Confetti
yay-confetti.sh
Scans your prompt for the word yay (case-insensitive). If found, fires Raycast confetti cannon immediately. That's the whole hook.
async claude-hindsight user-prompt-submit — telemetry
🛡
Event
 
PreToolUse
Before every tool call
Claude's hands get checked before touching anything. Most blocking logic lives here.
🔱
The Bash Gauntlet
pretool-bash.sh
Bash only

Three checks run in sequence on every Bash command:

① Catastrophe blocker — kills commands like rm -rf /, disk formats, or anything that would destroy the machine. Exit 2 = blocked.

② Test output filter — if the command runs a test suite, only failures come back. 500 passing lines get dropped. Claude sees what matters.

③ RTK token rewrite — transparently rewrites git statusrtk git status, git diffrtk git diff, etc. Saves 60–90% of tokens on dev operations. You never see it happen.

can block can rewrite
🧪
Pre-push test gate
pre-push-tests.sh
Bash only
Only activates when the command is git push. Auto-detects project type and runs whatever applies: tsc --noEmit, vite build, vitest. Push is blocked if any step fails.
can block
🔒
Config file guard
guard-settings-json.sh
Edit / Write
Two protections: blocks all writes to ~/.claude/CLAUDE.md (must edit manually), and rejects settings.json writes containing invalid keys like mcpServers.
can block
🚫
Off-limits domain guard
project settings.json
Edit / Write / MultiEdit
Scans every write for keywords belonging to a protected domain. Any match → hard block. The domain does not exist as far as Claude is concerned.
blocks alwaysproject: etc
🪨
Block .typ artifacts
block-typ-reads.sh
Read only
Blocks reads of compiled .typ files inside jobs/. These are generated output — not source. Read report_state.json instead.
can block
📖
Read-once dedup
read-once/hook.sh
Read only
Tracks which files Claude has already read this session. If Claude tries to re-read the same file, it's blocked — the content is already in context. Cache resets after compaction.
can block
async claude-hindsight pre-tool-use — telemetry, logs every tool call attempt
Event
 
PostToolUse
After a tool succeeds
Lint, celebrate, record. Runs after every successful tool call.
🧹
Auto-lint on save
inline command
Edit / Write
Triggers on every file write. Picks the right tool for the extension:

.pyruff check --fix + ruff format
.shshellcheck
.tstsc --noEmit (first 20 lines)
🎉
Git push → Confetti
push-confetti.sh
Bash only
Checks if the Bash command that just ran was a git push. If yes, fires Raycast confetti. Ships deserve a celebration.
🎊
/simplify → Confetti
simplify-confetti.sh
Skill only
Fires Raycast confetti when the /simplify skill completes. Code cleanup is worth celebrating too.
async claude-hindsight post-tool-use — telemetry on every successful tool call  |  claude-hindsight post-tool-use-failure — telemetry on failures
🔔
Event
 
Stop
Claude finishes responding
Every time Claude finishes a turn — done thinking, done coding, done talking.
🔔
You're done — look here
notify-done.sh
Fires a terminal bell \a AND a macOS native notification: "Claude Code finished" with the Glass sound. So you can tab away while it works. Skipped in claude -p mode.
🎊
Celebratory confetti
confetti.sh
Reads the last assistant message. If the content is celebratory (shipped, done, fixed, etc.) → Raycast confetti. Otherwise silent. Skipped headless.
async
async claude-hindsight stop — telemetry
Events
 
PermissionRequest
 
PreCompact
 
PostCompact
 
ConfigChange
Everything else
Edge-case events that still get hooks.
📖
Reset read-once cache
read-once/compact.sh
After context compaction, Claude's memory of what it's already read is gone. This clears the read-once blocklist so it can read those files fresh.
async claude-hindsight fires on: permission-request · pre-compact · config-change · task-completed
What the tags mean
async

Fires and forgets. Claude doesn't wait for it. Can't block or rewrite anything.

can block

Returns exit code 2 to completely stop the tool call. Claude sees the error message and must change course.

can rewrite

Returns a modified version of the input. Claude runs the new version, not the original. Transparent to Claude.

project

Configured in etc/ project settings. Doesn't apply in other projects.