The map

Every prompt passes through four checkpoints you control

SessionStart hook loads CLAUDE.md + memory once You type a prompt UserPrompt- Submit hook adds memories Model decides on a tool Permission rules deny, ask or allow PreToolUse hook your script can block Tool runs Bash, edit, MCP or a subagent result goes back to the model, and the loop repeats exit 2 = blocked deny wins first
Orange boxes are the places you can change behaviour without touching your prompt.