Repository navigation
Description
Split out of #1416 / the shell-form fix, which covered only the two wired hooks in hooks/hooks.json.
The latent defect
plugins/disk-hygiene/skills/clean/SKILL.md registers the skill-scoped belt guard in exec form:
- type: command
command: "python3"
args: ["${CLAUDE_PLUGIN_ROOT}/skills/clean/scripts/destructive_guard.py", "--plugin-root", "${CLAUDE_PLUGIN_ROOT}"]Per the hooks reference, exec form resolves command as an executable on PATH, and "On Windows, exec form requires command to resolve to a real executable such as a .exe."
This plugin already documents the failure mode in its own README: on Windows python3 frequently resolves to the zero-length WindowsApps\python3.exe App Execution Alias stub. That is not a real executable, so the spawn fails — and a failed hook launch is non-blocking, so the skill-scoped guard fails open exactly like the wired ones did.
hooks/run-python-hook.sh exists precisely to solve this (it rejects the alias stub before exec-ing), but only the wired hooks route through it. The skill hook has been on bare python/python3 since #215, predating the launcher.
Why it was NOT fixed in the wired-hook PR
Not-proven-broken on the reporting host (python3 there resolves to a real 45 KB binary), while the wired hooks were proven dead. Converting a currently-working safety guard on an unverified premise risks killing a live guard — the exact harm being fixed. Deferred deliberately for a change that can be verified in a live session.
What a fix needs to establish
- Route the skill hook through
hooks/run-python-hook.shin shell form, mirroring the wired hooks. - Confirm
${CLAUDE_PLUGIN_ROOT}substitutes for a skill-frontmatter hook in shell form. fix(disk-hygiene): stop guard hook fail-open on skill-hook data-root token #1014 found empirically that skill hooks are more restricted than documented (${CLAUDE_PLUGIN_DATA}and${user_config.*}are unavailable and cause launch refusal). Do not add--authorized-data-root— fix(disk-hygiene): stop guard hook fail-open on skill-hook data-root token #1014 removed it for that reason. - Update
_skill_hook_command_and_args()inskills/clean/scripts/test_hygiene.py, which currently requires anargs:line and would raise on shell form. The form-agnostic_hook_argv()helper added alongside the wired fix is the model. - Verify in a live Claude Code session that the guard still blocks, since neither form is fully verifiable in CI.
Related
- disk-hygiene: the destructive-operation guard has never launched — 73 recorded runs, all hook_non_blocking_error #1416 — the wired-hook instance of this defect class
- fix(disk-hygiene): stop guard hook fail-open on skill-hook data-root token #1014 — established the skill-hook substitution allowlist
- fix(repo-hygiene): destructive-guard fail-open on Windows — shell-form hook launch + jq fail-closed degraded mode #1006 — the original shell-form fix for this class
Activity
docs(disk-hygiene): assess shell-form launch in the security records (#…
docs(disk-hygiene): state what #2568 tracks, not how it will be fixed
fix(disk-hygiene): launch wired hooks in shell form, reviving the dea…
kyle-sexton commentedon Aug 13, 2026
Ordering note from #2571 (the CI gate for #2569).
The gate in #2571 covers skill/agent frontmatter
hooks:blocks, so it reports exactly one violation againstmaintoday — this issue's instance:That is red by construction, not a defect in the gate. #2571 deliberately does not touch
plugins/disk-hygiene/skills/clean/SKILL.mdand does not grandfather it in a baseline or allowlist — this issue owns the fix. #2571 is draft +do-not-mergeand will rebase ontomainand go green once this lands.Nothing is needed from this issue's fix beyond what it already plans: shell form (
commandcarrying the whole command line, noargs,shell: bash), per #2570. A${CLAUDE_PLUGIN_ROOT}-rooted exec-formcommandwould also satisfy the gate.feat(ci): gate exec-form hooks against bare command names (#2569) (#2571
fix(disk-hygiene): re-land tidiness-first reporting and correct the b…