Affected file: engineering-team/self-improving-agent/hooks/hooks.json
Observed behaviour: every Bash tool call in any Claude Code session whose working directory is not the plugin root emits:
/bin/sh: ./hooks/error-capture.sh: No such file or directory
The error-capture feature therefore never executes (its whole purpose — learning from failed commands — silently doesn't happen), and every session's tool output is spammed with the failure line.
Root cause: hooks.json registers the PostToolUse hook with a cwd-relative path:
"command": "./hooks/error-capture.sh"
Hook commands run from the session's cwd, not the plugin directory, so the relative path can never resolve in normal use.
Fix (one line):
"command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/error-capture.sh\""
${CLAUDE_PLUGIN_ROOT} is the documented variable for plugin hook paths; quoting handles plugin roots containing spaces. Verified working locally with exactly this change.
Secondary: the same relative-path pattern appears in the plugin's settings.json install example ("hooks/error-capture.sh") and in the script's own header comment (./skills/self-improving-agent/hooks/error-capture.sh) — worth updating for consistency.
Affected file:
engineering-team/self-improving-agent/hooks/hooks.jsonObserved behaviour: every Bash tool call in any Claude Code session whose working directory is not the plugin root emits:
The error-capture feature therefore never executes (its whole purpose — learning from failed commands — silently doesn't happen), and every session's tool output is spammed with the failure line.
Root cause:
hooks.jsonregisters the PostToolUse hook with a cwd-relative path:Hook commands run from the session's cwd, not the plugin directory, so the relative path can never resolve in normal use.
Fix (one line):
${CLAUDE_PLUGIN_ROOT}is the documented variable for plugin hook paths; quoting handles plugin roots containing spaces. Verified working locally with exactly this change.Secondary: the same relative-path pattern appears in the plugin's
settings.jsoninstall example ("hooks/error-capture.sh") and in the script's own header comment (./skills/self-improving-agent/hooks/error-capture.sh) — worth updating for consistency.