Skip to content

Keep Claude hook installs path-stable#26

Merged
NagyVikt merged 1 commit intomainfrom
agent/codex/fix-claude-hook-path-independence-2026-04-24-03-15
Apr 24, 2026
Merged

Keep Claude hook installs path-stable#26
NagyVikt merged 1 commit intomainfrom
agent/codex/fix-claude-hook-path-independence-2026-04-24-03-15

Conversation

@NagyVikt
Copy link
Copy Markdown
Collaborator

Automated by gx branch finish (PR flow).

Claude hook failures showed up as exit 127 when the runtime had an empty or sparse PATH. The installer already knows the absolute Node and CLI paths, so preserve user hook entries while replacing only stale Colony hook commands with the absolute-node form. Uninstall now removes only Colony hook entries instead of deleting the user's adjacent Claude hooks.

Constraint: Claude Code stores hooks as shell command strings, so the installed command must not rely on PATH resolution.

Rejected: Re-run the old installer as-is | it would clobber custom PostToolUse and Stop hooks in ~/.claude/settings.json.

Confidence: high

Scope-risk: narrow

Directive: Do not replace entire Claude hook event arrays without preserving non-Colony user hooks.

Tested: pnpm --filter @colony/installers test

Tested: pnpm --filter @colony/installers typecheck

Tested: pnpm --filter @colony/installers build

Tested: pnpm exec biome check packages/installers/src/claude-code.ts packages/installers/test/installers.test.ts .changeset/claude-hook-path-independence.md

Tested: empty-PATH live Claude PostToolUse and Stop hook commands exit 0
@NagyVikt NagyVikt merged commit c0e3405 into main Apr 24, 2026
@NagyVikt NagyVikt deleted the agent/codex/fix-claude-hook-path-independence-2026-04-24-03-15 branch April 24, 2026 01:20
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