Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

hook

Dispatch a lifecycle hook event manually.

gwt hook <event>

Arguments

ArgumentDescription
eventHook event name (e.g., post-create, pre-merge)

Available events

EventTriggered byBlocking
post-creategwt create, gwt switch (auto-create)Yes
post-switchgwt switchYes
pre-removegwt removeYes
pre-mergegwt verify, gwt mergeYes
post-mergegwt mergeNo

Blocking hooks abort the operation on failure. Non-blocking hooks log warnings but continue.

Usage

This command is primarily used by external tools (like Claude Code) that need to trigger gwt hooks programmatically. For example, Claude Code calls gwt hook claude-stop when the AI agent stops.

See also