@@ -44,7 +44,9 @@ disallow the use of Haskell (but we love you, Simon Peyton Jones).
4444### Config
4545
4646The first thing we need to do is hook up our hook. Let's add the following to
47−our local `crush.json`. You can, of course, do this globally, too.
47+our **project-level** `crush.json`. Relative paths like `./no-haskell.sh` work
48+here because the project root is your working directory. If you're configuring
49+a global hook (`~/.config/crush/crush.json`), use an absolute path instead.
4850
4951```jsonc
5052{
@@ -146,6 +148,28 @@ and project-level, with project level hooks taking precedence.
146148}
147149```
148150
151+> [!IMPORTANT]
152+> The `command` is resolved relative to your **current working directory** —
153+> not relative to the config file. Relative paths like `./hooks/whatever.sh`
154+> work fine in project-level `crush.json` because the project root is also
155+> your working directory. For **global** config (`~/.config/crush/`),
156+> however, you must use either an absolute path or an inline command:
157+>
158+> ```jsonc
159+> // Global ~/.config/crush/crush.json
160+> {
161+> "hooks": {
162+> "PreToolUse": [
163+> {
164+> "command": "/home/you/.config/crush/hooks/no-haskell.sh"
165+> // or use an inline command:
166+> // "command": "echo '{\"decision\":\"allow\"}'"
167+> }
168+> ]
169+> }
170+> }
171+> ```
172+
149173Remember, hooks will run in parallel but resolve in config order. Last hook
150174wins when rewriting input, but first deny wins when blocking.
151175