Toasty can be triggered by any hook event from Claude Code, Gemini CLI, or GitHub Copilot CLI. This guide documents all available hooks so you can customize when you get notifications.
| Use Case | Claude Code | Gemini CLI | GitHub Copilot |
|---|---|---|---|
| Task finished | Stop |
AfterAgent |
sessionEnd |
| Needs approval | PermissionRequest |
— | — |
| Error occurred | — | — | errorOccurred |
| Session ended | SessionEnd |
SessionEnd |
sessionEnd |
Location: ~/.claude/settings.json (user) or .claude/settings.json (project)
| Event | Description | Notification Ideas |
|---|---|---|
SessionStart |
Session begins or resumes | — |
UserPromptSubmit |
User submits a prompt | — |
PreToolUse |
Before any tool runs (Bash, Edit, etc.) | — |
PostToolUse |
After a tool completes successfully | — |
PostToolUseFailure |
After a tool fails | "Claude tool failed" |
PermissionRequest |
When Claude asks for permission | "Claude needs approval" |
Stop |
Claude finishes responding | "Claude finished" ✓ |
SubagentStart |
Subagent spawned | — |
SubagentStop |
Subagent finished | — |
SessionEnd |
Session terminates | "Claude session ended" |
Notification |
System notifications | Varies |
PreCompact |
Before context compaction | — |
{
"hooks": {
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "toasty.exe \"Claude finished\"",
"timeout": 5000
}
]
}
],
"PermissionRequest": [
{
"hooks": [
{
"type": "command",
"command": "toasty.exe \"Claude needs approval\" -t \"Action Required\"",
"timeout": 5000
}
]
}
]
}
}For tool-specific hooks, use matcher to filter by tool name:
{
"hooks": {
"PostToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "toasty.exe \"Command finished\""
}
]
}
]
}
}Tool names: Bash, Edit, MultiEdit, Write, Read, Glob, Grep, LS, WebFetch, etc.
Location: ~/.gemini/settings.json
Important: You must enable hooks in settings:
{
"hooks": {
"enabled": true
}
}| Event | Description | Notification Ideas |
|---|---|---|
SessionStart |
Session begins | — |
SessionEnd |
Session ends | "Gemini session ended" |
BeforeAgent |
After prompt, before planning | — |
AfterAgent |
Agent loop finishes | "Gemini finished" ✓ |
BeforeModel |
Before LLM call | — |
AfterModel |
After LLM response | — |
BeforeToolSelection |
Before tool choice | — |
Notification |
System notifications | Varies |
PreCompress |
Before history compression | — |
⚠️ Note:AfterAgentdoes not fire if the response is text-only (no tool calls were made).
{
"hooks": {
"enabled": true,
"AfterAgent": [
{
"matcher": "*",
"hooks": [
{
"name": "toasty-finished",
"type": "command",
"command": "toasty.exe \"Gemini finished\""
}
]
}
],
"SessionEnd": [
{
"matcher": "*",
"hooks": [
{
"name": "toasty-session-end",
"type": "command",
"command": "toasty.exe \"Gemini session ended\""
}
]
}
]
}
}Location: .github/hooks/*.json (per-repo)
| Event | Description | Notification Ideas |
|---|---|---|
sessionStart |
Session begins or resumes | — |
sessionEnd |
Session ends | "Copilot finished" ✓ |
userPromptSubmitted |
User submits a prompt | — |
preToolUse |
Before any tool runs | — |
postToolUse |
After a tool completes | — |
errorOccurred |
On errors | "Copilot error!" |
{
"version": 1,
"hooks": {
"sessionEnd": [
{
"type": "command",
"bash": "toasty 'Copilot finished'",
"powershell": "toasty.exe 'Copilot finished'",
"timeoutSec": 5
}
],
"errorOccurred": [
{
"type": "command",
"bash": "toasty 'Copilot error!' -t 'Error'",
"powershell": "toasty.exe 'Copilot error!' -t 'Error'",
"timeoutSec": 5
}
]
}
}Copilot passes JSON data via stdin to your hooks:
sessionStart:
{
"timestamp": 1704614400000,
"cwd": "/path/to/project",
"source": "new",
"initialPrompt": "Create a new feature"
}sessionEnd:
{
"timestamp": 1704618000000,
"cwd": "/path/to/project",
"reason": "complete"
}Since toasty accepts any message and title, you can create contextual notifications:
# Different urgency levels
toasty "Task complete" -t "Info"
toasty "Needs your attention" -t "Action Required"
toasty "Something went wrong" -t "Error"
# With app presets (auto-icon)
toasty "Build passed" --app claude
toasty "Tests failed" --app copilot
toasty "Query done" --app geminiIf toasty --install doesn't fit your needs, copy the examples above and customize:
- Find the config file for your agent (paths listed above)
- Add the hook configuration
- Adjust the message text and events to your preference