Files
claude-adam/settings.json.example
lukaszraczylo f418afa275 feat(observe): record real tool failures from PostToolUseFailure
Claude Code sends failed tool calls to the PostToolUseFailure event.
ADAM registered only PostToolUse, so it never saw a real failure, and
every tool_error_loop came from ERROR_RE matching successful output.

Handle PostToolUseFailure in adam-observe.mjs through the PostToolUse
detectors. Shape the error string as an is_error response. An interrupt
is an abort, so it counts as a tool event but gets no fingerprint.
Register the event in settings.json.example.

Tests 9b and 9c added: 150 passed, 0 failed.

Claude-Session: https://claude.ai/code/session_014prTNuJnKuwcAd28vUZAnN
2026-09-25 03:16:01 +01:00

60 lines
1.3 KiB
JSON

{
"_comment": "Merge these four hook entries into your ~/.claude/settings.json under the existing 'hooks' key. Preserve any existing hooks you have — ADAM's entries are additive.",
"hooks": {
"UserPromptSubmit": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "node \"$HOME/.claude/hooks/adam-observe.mjs\""
}
]
}
],
"PreToolUse": [
{
"matcher": "Skill|Agent",
"hooks": [
{
"type": "command",
"command": "node \"$HOME/.claude/hooks/adam-observe.mjs\""
}
]
}
],
"PostToolUse": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "node \"$HOME/.claude/hooks/adam-observe.mjs\""
}
]
}
],
"PostToolUseFailure": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "node \"$HOME/.claude/hooks/adam-observe.mjs\""
}
]
}
],
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "node \"$HOME/.claude/hooks/adam-nudge.mjs\""
}
]
}
]
}
}