Follow-up to #1832.
v1.6.1 skips prompts that are a single <task-notification>...</task-notification> envelope (isTaskNotification, #1884). Claude Code also delivers subagent results to the parent session as UserPromptSubmit prompts in a different envelope:
<agent-message from="<agent-id>">
[Subagent hand-back] ...full report text...
</agent-message>
These prompts are not user input. They are also usually long, because they carry a subagent's full report. prompt-hook runs a full explore on them. In one session, two hand-backs of about 5-8 KB each made the hook go past Claude Code's default 30 s hook timeout:
UserPromptSubmit hook [codegraph.cmd prompt-hook] timed out after 30s -- output discarded.
When the hook finishes in time, the injected context is unrelated to the prompt (symbols matched from words in the prose report).
Expected: prompt-hook exits immediately on <agent-message ...>...</agent-message> prompts, the same way it does for <task-notification>.
Suggested fix: extend isTaskNotification (or add isAgentMessage) to match ^\s*<agent-message\b[^>]*>[\s\S]*<\/agent-message>\s*$.
Environment: Windows 11, Claude Code CLI, CodeGraph v1.6.0 (the #1884 fix in v1.6.1 does not match this envelope; checked against the PR diff).
Follow-up to #1832.
v1.6.1 skips prompts that are a single
<task-notification>...</task-notification>envelope (isTaskNotification, #1884). Claude Code also delivers subagent results to the parent session asUserPromptSubmitprompts in a different envelope:These prompts are not user input. They are also usually long, because they carry a subagent's full report.
prompt-hookruns a full explore on them. In one session, two hand-backs of about 5-8 KB each made the hook go past Claude Code's default 30 s hook timeout:When the hook finishes in time, the injected context is unrelated to the prompt (symbols matched from words in the prose report).
Expected:
prompt-hookexits immediately on<agent-message ...>...</agent-message>prompts, the same way it does for<task-notification>.Suggested fix: extend
isTaskNotification(or addisAgentMessage) to match^\s*<agent-message\b[^>]*>[\s\S]*<\/agent-message>\s*$.Environment: Windows 11, Claude Code CLI, CodeGraph v1.6.0 (the #1884 fix in v1.6.1 does not match this envelope; checked against the PR diff).