From a63423d7a8b8bdb1342e00c918ae80705de1433a Mon Sep 17 00:00:00 2001 From: "fangyuan.han" Date: Wed, 29 Apr 2026 18:57:41 +0800 Subject: [PATCH] fix(examples): use UserPromptSubmit in hooks example callback output Align add_custom_instructions hookEventName with the UserPromptSubmit matcher and UserPromptSubmitHookSpecificOutput. Made-with: Cursor --- examples/hooks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/hooks.py b/examples/hooks.py index a8001d4db..99686c9c1 100644 --- a/examples/hooks.py +++ b/examples/hooks.py @@ -73,10 +73,10 @@ async def check_bash_command( async def add_custom_instructions( input_data: HookInput, tool_use_id: str | None, context: HookContext ) -> HookJSONOutput: - """Add custom instructions when a session starts.""" + """Add custom context when the user submits a prompt.""" return { "hookSpecificOutput": { - "hookEventName": "SessionStart", + "hookEventName": "UserPromptSubmit", "additionalContext": "My favorite color is hot pink", } }