Problem
When using ZCode Agent (the native built-in agent), lifecycle hooks configured under hooks.events in ~/.zcode/cli/config.json are never triggered.
Config used
{
"hooks": {
"enabled": true,
"timeoutMs": 60000,
"maxOutputBytes": 32768,
"events": {
"UserPromptSubmit": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "node",
"args": ["/path/to/hook.js"]
}
]
}
]
}
}
}
The hook script writes to a debug log on entry (before any stdin read), so if it were invoked at all, the log would appear. After multiple ZCode Agent sessions with prompts and tool use, the log file is never written.
What was also tried
- Registering hooks via the plugin system (
~/.zcode/cli/plugins/) — same result, hooks not triggered for ZCode Agent sessions
- Hook command executes correctly when invoked manually via PowerShell
Expected behavior
Hooks in hooks.events should fire for ZCode Agent sessions (SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, Stop, etc.) the same way they work for external CLI subagents.
Question
Is this a known limitation? Is there a supported way to receive lifecycle events from ZCode Agent sessions externally (e.g., a local HTTP/WebSocket API, IPC, or log file)?
Problem
When using ZCode Agent (the native built-in agent), lifecycle hooks configured under
hooks.eventsin~/.zcode/cli/config.jsonare never triggered.Config used
{ "hooks": { "enabled": true, "timeoutMs": 60000, "maxOutputBytes": 32768, "events": { "UserPromptSubmit": [ { "matcher": "", "hooks": [ { "type": "command", "command": "node", "args": ["/path/to/hook.js"] } ] } ] } } }The hook script writes to a debug log on entry (before any stdin read), so if it were invoked at all, the log would appear. After multiple ZCode Agent sessions with prompts and tool use, the log file is never written.
What was also tried
~/.zcode/cli/plugins/) — same result, hooks not triggered for ZCode Agent sessionsExpected behavior
Hooks in
hooks.eventsshould fire for ZCode Agent sessions (SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, Stop, etc.) the same way they work for external CLI subagents.Question
Is this a known limitation? Is there a supported way to receive lifecycle events from ZCode Agent sessions externally (e.g., a local HTTP/WebSocket API, IPC, or log file)?