hook
Dispatch a lifecycle hook event manually.
gwt hook <event>
Arguments
| Argument | Description |
|---|---|
event | Hook event name (e.g., post-create, pre-merge) |
Available events
| Event | Triggered by | Blocking |
|---|---|---|
post-create | gwt create, gwt switch (auto-create) | Yes |
post-switch | gwt switch | Yes |
pre-remove | gwt remove | Yes |
pre-merge | gwt verify, gwt merge | Yes |
post-merge | gwt merge | No |
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
- Hooks configuration for configuring custom hook commands