⌨️Setup Hook
Also known as Setup
An event that fires only on a set-up run.
Think of it like
It is like you set up a tent once. You do it before the camp starts.
Example
Lucy's CI job runs claude --init-only before the real work. Her Setup hook installs the packages once.
Why it matters
It keeps slow, one-off setup out of the hooks that run every session.
Definition
Example code
json
{
"hooks": {
"Setup": [
{ "matcher": "init", "hooks": [{ "type": "command", "command": "npm ci" }] }
]
}
}Common mistake
Key takeaways
- 1Only with flags. --init and more.
- 2Two kinds. init, maintenance.
- 3Cannot block. Runs and moves on.