Hooks Configuration
- Project Level:
{project_path}/.hcode/settings.json - User Level:
~/.hcode/settings.json
Matcher
Hooks support Matcher for matching tool names or Subagent names. Matching rules are as follows:
- Single Match: Match a single attribute, e.g.,
"Edit". - Multiple Matches: Use pipe
|to separate multiple attributes, e.g.,"Edit|Write". - Wildcard Match: Use
*for wildcard matching, e.g.,"mcp__memory__.*","mcp__.*__write.*","mcp__.*__write.*|Edit".
Available Hooks
- Stop - Triggered when the main Agent conversation ends
- SubagentStop - Triggered when the Subagent conversation ends
- SubagentStart - Triggered before the Subagent starts execution
- PostToolUse - Triggered after a tool is successfully executed
- PostToolUseFailure - Triggered when a tool execution fails
- SessionStart - Triggered when a session starts
- SessionEnd - Triggered when a session ends