Skip to content

Guard analyzing-data Stop hook against missing uv - #248

Draft
Purple-Drain wants to merge 1 commit into
astronomer:mainfrom
Purple-Drain:fix/stop-hook-uv-not-found
Draft

Guard analyzing-data Stop hook against missing uv#248
Purple-Drain wants to merge 1 commit into
astronomer:mainfrom
Purple-Drain:fix/stop-hook-uv-not-found

Conversation

@Purple-Drain

Copy link
Copy Markdown

Problem

The analyzing-data skill's Stop hook is registered directly in plugin.json
as:

"command": "uv run ${CLAUDE_PLUGIN_ROOT}/skills/analyzing-data/scripts/cli.py stop"

On a machine where uv isn't installed / isn't on PATH, the shell fails to
exec uv before cli.py ever starts — so cli.py's own
check_uv_installed() helpful-error path never runs. Instead every Stop hook
invocation surfaces a raw, unhelpful error:

Stop hook error: Failed with non-blocking status code: /bin/sh: 1: uv: not found

This fires on every single turn for any user without uv on PATH, in both
Claude Code and Cursor (both plugin manifests have the same unguarded
command).

Fix

Move the command into a small co-located skills/analyzing-data/hooks/stop.sh
script — the same pattern already used by
skills/airflow/hooks/warm-uvx-cache.sh elsewhere in this repo — that checks
for uv on PATH and no-ops (exit 0) if it's missing, since a kernel could
never have been started without uv in the first place, so there's nothing
to stop.

Both .claude-plugin/plugin.json and .cursor-plugin/plugin.json now point
at this script instead of embedding the raw uv run command inline.

Testing

Ran the new script directly, both with uv present and with PATH
restricted to simulate uv missing:

$ ./skills/analyzing-data/hooks/stop.sh
...
Kernel not running
exit: 0

$ env PATH="/usr/bin:/bin" ./skills/analyzing-data/hooks/stop.sh
exit: 0

No error output in the missing-uv case, clean exit in both.

The Stop hook ran `uv run ${CLAUDE_PLUGIN_ROOT}/skills/analyzing-data/scripts/cli.py stop`
directly from plugin.json with no guard. On a machine without `uv` on PATH,
the shell fails before cli.py's own check_uv_installed() helper ever runs,
surfacing a raw "uv: not found" error on every Stop hook invocation instead
of failing gracefully.

Move the command into a co-located hooks/stop.sh script (matching the
skills/airflow/hooks/warm-uvx-cache.sh pattern already used elsewhere in
this repo) that no-ops when uv isn't installed, since there's nothing to
stop if the kernel could never have been started in the first place.
@Purple-Drain
Purple-Drain requested a review from a team as a code owner July 29, 2026 05:37
@Purple-Drain
Purple-Drain marked this pull request as draft August 10, 2026 06:22
@Purple-Drain

Copy link
Copy Markdown
Author

@claude thoughts on these?

@Purple-Drain

Copy link
Copy Markdown
Author

@copilot pls help resolve and revie wpls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant