Skip to content

fix(claude-init): write hooks with full binary path instead of bare 'agentguard' #964

@jpleva91

Description

@jpleva91

Problem

agentguard claude-init writes hooks in .claude/settings.json that reference bare agentguard:

"command": "agentguard claude-hook stop --store sqlite"

This fails with agentguard: not found when the binary isn't on PATH (common in npm projects where it's only in node_modules/.bin/).

Expected

Hooks should use the resolved binary path:

"command": "bash -c '\${AGENTGUARD_BIN:-./node_modules/.bin/agentguard} claude-hook stop --store sqlite'"

Impact

Every repo that installs AgentGuard via npm gets broken Stop/PostToolUse/Notification hooks. PreToolUse works because it goes through claude-hook-wrapper.sh.

Workaround

Manually edit .claude/settings.json to use the full path (done in workspace, cloud, analytics).


Filed via dogfood — discovered during rollout pipeline setup

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions