{ "hooks": { "PreToolUse": [ { "matcher": "Write|Edit|MultiEdit|NotebookEdit|Bash", "hooks": [ { "type": "command", "command": "m=\"$(git -C \"${CLAUDE_PROJECT_DIR:-.}\" rev-parse --absolute-git-dir 2>/dev/null)/ticket-guard/marker.json\"; [ -f \"$m\" ] || exit 0; u=\"$(command -v uv)\"; for c in \"$HOME/.local/bin/uv\" \"$HOME/.cargo/bin/uv\"; do [ -n \"$u\" ] || { [ -x \"$c\" ] && u=\"$c\"; }; done; [ -n \"$u\" ] || { echo \"ticket-guard: uv not found on the PATH Claude Code runs hooks with, or in ~/.local/bin or ~/.cargo/bin. A ticket is in progress, so the guard blocks this instead of letting it through unchecked. Put uv on that PATH and retry (see Goal Runs, 'When something goes wrong'). In a goal run, end your turn with BLOCKED: guard could not run and quote this message; a goal line that rejects that stop is out of date, so the owner relaunches with the current /goal line.\" >&2; exit 2; }; exec \"$u\" run -q --no-project --python \">=3.11\" \"${CLAUDE_PLUGIN_ROOT}/runtime/guard.pyz\" hook pre-tool-use" } ] } ], "PostToolUse": [ { "matcher": "Write|Edit|MultiEdit|NotebookEdit", "hooks": [ { "type": "command", "command": "m=\"$(git -C \"${CLAUDE_PROJECT_DIR:-.}\" rev-parse --absolute-git-dir 2>/dev/null)/ticket-guard/marker.json\"; [ -f \"$m\" ] || exit 0; u=\"$(command -v uv)\"; for c in \"$HOME/.local/bin/uv\" \"$HOME/.cargo/bin/uv\"; do [ -n \"$u\" ] || { [ -x \"$c\" ] && u=\"$c\"; }; done; [ -n \"$u\" ] || { echo \"ticket-guard: uv not found on the PATH Claude Code runs hooks with, or in ~/.local/bin or ~/.cargo/bin. A ticket is in progress, so the guard blocks this instead of letting it through unchecked. Put uv on that PATH and retry (see Goal Runs, 'When something goes wrong'). In a goal run, end your turn with BLOCKED: guard could not run and quote this message; a goal line that rejects that stop is out of date, so the owner relaunches with the current /goal line.\" >&2; exit 2; }; exec \"$u\" run -q --no-project --python \">=3.11\" \"${CLAUDE_PLUGIN_ROOT}/runtime/guard.pyz\" hook post-tool-use" } ] } ], "Stop": [ { "hooks": [ { "type": "command", "command": "m=\"$(git -C \"${CLAUDE_PROJECT_DIR:-.}\" rev-parse --absolute-git-dir 2>/dev/null)/ticket-guard/marker.json\"; [ -f \"$m\" ] || exit 0; u=\"$(command -v uv)\"; for c in \"$HOME/.local/bin/uv\" \"$HOME/.cargo/bin/uv\"; do [ -n \"$u\" ] || { [ -x \"$c\" ] && u=\"$c\"; }; done; [ -n \"$u\" ] || { e=\"ticket-guard: uv not found on the PATH Claude Code runs hooks with, or in ~/.local/bin or ~/.cargo/bin, so the guard did not run and GREEN was not checked. A ticket is in progress, so the guard blocks one stop per ticket; the next stop goes through unchecked. Put uv on that PATH and retry (see Goal Runs, 'When something goes wrong'). In a goal run, end your turn with BLOCKED: guard could not run and quote this message; a goal line that rejects that stop is out of date, so the owner relaunches with the current /goal line.\"; set -- $(cksum <\"$m\"); f=\"${m%/*}/uv-missing-stop.$1\"; [ -n \"$1\" ] && [ -f \"$f\" ] && { printf '{\"systemMessage\":\"%s\"}\\n' \"$e\"; exit 0; }; echo \"$e\" >&2; [ -z \"$1\" ] || true 2>/dev/null >\"$f\"; exit 2; }; exec \"$u\" run -q --no-project --python \">=3.11\" \"${CLAUDE_PLUGIN_ROOT}/runtime/guard.pyz\" hook stop" } ] } ], "SessionStart": [ { "matcher": "compact", "hooks": [ { "type": "command", "command": "m=\"$(git -C \"${CLAUDE_PROJECT_DIR:-.}\" rev-parse --absolute-git-dir 2>/dev/null)/ticket-guard/marker.json\"; [ -f \"$m\" ] || exit 0; u=\"$(command -v uv)\"; for c in \"$HOME/.local/bin/uv\" \"$HOME/.cargo/bin/uv\"; do [ -n \"$u\" ] || { [ -x \"$c\" ] && u=\"$c\"; }; done; [ -n \"$u\" ] || { echo \"ticket-guard: uv not found on the PATH Claude Code runs hooks with, or in ~/.local/bin or ~/.cargo/bin. A ticket is in progress, so the guard blocks this instead of letting it through unchecked. Put uv on that PATH and retry (see Goal Runs, 'When something goes wrong'). In a goal run, end your turn with BLOCKED: guard could not run and quote this message; a goal line that rejects that stop is out of date, so the owner relaunches with the current /goal line.\" >&2; exit 2; }; exec \"$u\" run -q --no-project --python \">=3.11\" \"${CLAUDE_PLUGIN_ROOT}/runtime/guard.pyz\" hook session-start" } ] } ] } }