You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Resolve a Version-Manager Shim Before Registering It as the Hook Launcher #4355
The host-safety installer can register a POSIX version-manager shim as every hook's launcher. Examples are pyenv's ~/.pyenv/shims/python3, or an asdf or mise shim. A shim picks its interpreter when the hook runs, from the session's working directory (.python-version, PYENV_VERSION). So the interpreter at hook time can differ from the one the installer probed.
Failure
Here is a constructed case:
A host has pyenv with 3.12 as its global version, and ~/.pyenv/shims comes first on PATH.
The installer resolves python3 to the shim, probes it as 3.12, and registers it.
A session then starts in a project whose .python-version pins 3.10.14.
Every kit hook now runs under 3.10, or fails to start where that version is not installed.
The guards need 3.11+, so each one exits non-zero. A non-zero PreToolUse exit is a non-blocking error, so the write guard fails open. --report probes the launcher from its own working directory, so it stays green.
Origin
This predates the exec-form registration in #4040. A bare python3 resolved to the same shim at hook time. The exec-form change in PR #4350 pins the path the installer resolves, but a shim still resolves per directory.
Done when
The installer resolves a shim to a concrete interpreter before registering it, or refuses a shim. A test pins whichever behavior is chosen.
Maintainer's answer, 2026-11-23 (recorded during backlog burndown round 5): approved. Have the installer detect a version-manager shim, refuse, and print the concrete interpreter path to pass instead, rather than resolving the shim or leaving it as is. This approves the design of an edit under host-setup/agent-safety/. Its pull request still merges only on the maintainer's own go-ahead, given after he reads the diff.
Activity
Register Claude Code Hooks in Exec Form and Rewrite Shell-Form Regist…
ptr727 commentedon Nov 23, 2026
Maintainer's answer, 2026-11-23 (recorded during backlog burndown round 5): approved. Have the installer detect a version-manager shim, refuse, and print the concrete interpreter path to pass instead, rather than resolving the shim or leaving it as is. This approves the design of an edit under
host-setup/agent-safety/. Its pull request still merges only on the maintainer's own go-ahead, given after he reads the diff.