@andrewh this confirms that bug I’m waiting for someone to fix - it was documented and implemented in the parameters, but the source code in your product (I asked Claude to look at the CLI install folder) simply discards it:
More Claude research:
Summary of Findings
1. Which hooks are actually implemented and working in the CLI?
Working hooks (these have executor wrappers that call them):
-
beforeShellExecution
- via ShellExecutorWithHooks / ShellStreamExecutorWithHooks -
afterShellExecution
- via same -
beforeMCPExecution
- via McpToolExecutorWithHooks -
afterMCPExecution
- via same -
afterFileEdit
- via WriteExecutorWithHooks
NOT implemented in CLI (types exist but no code calls them):
-
stop
- No caller found -
beforeSubmitPrompt
- No caller found -
afterAgentResponse
- No caller found -
afterAgentThought
- No caller found -
beforeReadFile
- No caller found -
beforeTabFileRead
- Tab-specific, not relevant to CLI -
afterTabFileEdit
- Tab-specific, not relevant to CLI
The hooksConfigLease with hasHookForStep() is returned from the shared services, but it’s only used to check if any hooks are configured - the agent loop itself never calls any hooks directly. It only works through the resource accessor wrappers.
