-
Notifications
You must be signed in to change notification settings - Fork 72
Open
Description
Description
When running an agent with the Claude adapter, gitagent run maps hooks/hooks.yaml to a temporary Claude Code hooks JSON file. The generated JSON has an invalid structure — the hooks array is missing inside each matcher entry.
Error
Settings Error
/private/var/folders/.../gitagent-hooks-26f81911.json
└ hooks
├ PostToolUse
│ └ 0
│ └ hooks: Expected array, but received undefined
└ PreToolUse
└ 0
└ hooks: Expected array, but received undefined
Expected
Claude Code expects this format:
{
"hooks": {
"PostToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{ "type": "command", "command": "echo Done" }
]
}
]
}
}Source hooks.yaml
hooks:
on_session_start:
- script: scripts/on-start.sh
description: Initialize session context
timeout: 10
compliance: false
fail_open: true
on_error:
- script: scripts/on-error.sh
description: Handle errors and escalate if needed
timeout: 10
compliance: false
fail_open: trueSteps to Reproduce
gitagent init --template full --dir ./my-agentgitagent run -d ./my-agent
Workaround
Clear hooks: echo "hooks: {}" > hooks/hooks.yaml
Environment
- gitagent installed via
npm install -g @open-gitagent/gitagent - Adapter: claude
- OS: macOS
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels