-
Notifications
You must be signed in to change notification settings - Fork 86
Closed
Labels
P2-importantDevrait être fixé bientôtDevrait être fixé bientôtbugSomething isn't workingSomething isn't workingeffort-smallQuelques heures, 1 fichierQuelques heures, 1 fichiergood first issueGood for newcomersGood for newcomers
Description
Problem
The generated hook script (rtk init -g) has two related PATH issues:
1. Guard check fails silently when ~/.cargo/bin is not in Claude Code's shell PATH
Claude Code's shell environment does not inherit ~/.cargo/bin from the user's profile. The guard at the top of the hook:
if ! command -v rtk &>/dev/null || ! command -v jq &>/dev/null; then
exit 0
fi...silently exits because rtk can't be found. The hook never fires.
2. Rewritten commands use bare rtk instead of absolute path
Even after fixing the PATH for the guard check, the rewritten commands use bare rtk:
REWRITTEN="${ENV_PREFIX}$(echo "$CMD_BODY" | sed 's/^git status/rtk git status/')"When Claude Code executes the rewritten command, rtk is not found because ~/.cargo/bin isn't in the execution PATH either.
Fix
Add to the top of the hook:
export PATH="$HOME/.cargo/bin:$PATH"
RTK="$(command -v rtk)"Then use $RTK in all sed substitutions instead of the bare word rtk.
Environment
- rtk 0.15.3
- macOS (Tahoe)
- Claude Code CLI
- rtk installed via
cargo install
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2-importantDevrait être fixé bientôtDevrait être fixé bientôtbugSomething isn't workingSomething isn't workingeffort-smallQuelques heures, 1 fichierQuelques heures, 1 fichiergood first issueGood for newcomersGood for newcomers