Repository navigation
Commit d1b4af0
Claude
fix(hookify): a missing hook script reports an error instead of blocking
Each hook ran 'python3 <script>'. When the script cannot be opened, python3
exits 2, and a hook that exits 2 blocks: every prompt (UserPromptSubmit) and
every tool call (PreToolUse) is refused, with no way out from inside the
session. This happens when the plugin directory moves under a running session,
as with an org-synced plugin re-synced to a new path.
The commands now check that the script exists; if not, they print the path to
stderr and exit 1, a non-blocking error Claude Code shows instead of a block.
The hookify scripts themselves only ever exit 0, so no intended block is lost.
Mitigates upstream issue 98839 for hookify. The root cause there, stale hook
paths in a live Cowork session and exit 2 from a missing file being treated as
a block, is in Claude Code itself.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoLAv3aLaRJocsRMcjFbpv1 parent 071d458 commit d1b4af0
2 files changed
Lines changed: 29 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | | - | |
| 228 | + | |
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
233 | 257 | | |
234 | 258 | | |
235 | 259 | | |
0 commit comments