MCPcopy Index your code
hub / github.com/shareAI-lab/learn-claude-code / register_hook

Function register_hook

s04_hooks/code.py:161–162  ·  view source on GitHub ↗
(event: str, callback)

Source from the content-addressed store, hash-verified

159HOOKS = {"UserPromptSubmit": [], "PreToolUse": [], "PostToolUse": [], "Stop": []}
160
161def register_hook(event: str, callback):
162 HOOKS[event].append(callback)
163
164def trigger_hooks(event: str, *args):
165 for callback in HOOKS[event]:

Callers 1

code.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected