Skip to content

Conversation

@xingyaoww
Copy link
Contributor

Summary

Update the hooks documentation to reflect the new 33_hooks.py example from the software-agent-sdk that demonstrates all four hook types.

Changes

  • Updated the Python example code to match the new 33_hooks.py structure
  • Added documentation for all four hook types:
    • PreToolUse: Block dangerous commands before execution
    • PostToolUse: Log tool usage after execution
    • UserPromptSubmit: Inject context into user messages
    • Stop: Enforce task completion criteria
  • Added expandable sections showing the external hook scripts in hook_scripts/ directory
  • Added a Hook Types reference table

Related

Notes

The new example uses external hook scripts in a hook_scripts/ directory rather than inline script creation, making it easier to understand and maintain.

@xingyaoww can click here to continue refining the PR

Update the hooks documentation to reflect the new 33_hooks.py example that
demonstrates all four hook types:
- PreToolUse: Block dangerous commands
- PostToolUse: Log tool usage
- UserPromptSubmit: Inject context into user messages
- Stop: Enforce task completion criteria

The new example uses external hook scripts in a hook_scripts/ directory
and includes a Hook Types reference table.

Related to: OpenHands/software-agent-sdk#1547

Co-authored-by: openhands <openhands@all-hands.dev>
@ak684 ak684 merged commit 78c2c50 into main Jan 6, 2026
2 checks passed
@ak684 ak684 deleted the update-hooks-example-33 branch January 6, 2026 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants