Problem
cn alerts controls only the Notification hook's matcher string (idle_prompt|permission_prompt|auth_success|elicitation_dialog). It does not register or expose the newer hook events Claude Code now emits, which became significant once teammateMode: auto and subagent-heavy workflows landed.
Result: with the default idle_prompt|permission_prompt matcher and teammateMode: auto + CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1, users get a notable jump in chimes — each subagent's tool call can surface a permission prompt that fires the Notification hook. The per-subtype rate limit (last_notification_${tool}_${project}_${subtype}) doesn't dampen this because permission prompts share their own bucket and arrive in bursts.
Hook events Claude Code emits that cn doesn't currently model
Per https://code.claude.com/docs/en/hooks:
| Event |
Currently in cn? |
Stop (main session only) |
yes (hardcoded, empty matcher, 10s rate-limit) |
Notification subtypes |
yes via cn alerts |
SubagentStop |
no |
SubagentStart |
no |
TeammateIdle (agent teams) |
no |
TaskCreated / TaskCompleted |
no |
CHANGELOG line 83 (Fixed agent-type hooks failing with "Messages are required for agent hooks" when configured for events other than Stop or SubagentStop) confirms Stop and SubagentStop are distinct events that need separate registration.
Proposed asks (in order of value)
- Extend
cn alerts to opt-in/out of additional events — SubagentStop, TeammateIdle, TaskCompleted as toggleable, same UX as today's idle_prompt/permission_prompt.
- Document agent-teams interaction in README — call out that the default matcher includes
permission_prompt and that this gets noisier under teammateMode: auto. Suggest cn alerts remove permission_prompt for users who only want idle-pings.
- (optional) Global cross-subtype rate limit via env var (e.g.
CODE_NOTIFY_GLOBAL_MIN_INTERVAL_SECONDS) so a permission-prompt burst is dampened even when subtypes differ.
Repro
# In ~/.claude/settings.json:
"teammateMode": "auto",
"env": { "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1" }
cn on # default matcher: idle_prompt|permission_prompt
# Run any task that spawns multiple subagents → multiple permission_prompt chimes per turn
Workaround
cn alerts remove permission_prompt && cn on — leaves only idle_prompt. Works but loses permission visibility entirely; finer-grained per-event controls would be better.
Environment
- code-notify 1.7.3 (Homebrew)
- Claude Code 2.1.119
- macOS (Darwin 25.4.0)
Problem
cn alertscontrols only theNotificationhook's matcher string (idle_prompt|permission_prompt|auth_success|elicitation_dialog). It does not register or expose the newer hook events Claude Code now emits, which became significant onceteammateMode: autoand subagent-heavy workflows landed.Result: with the default
idle_prompt|permission_promptmatcher andteammateMode: auto+CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1, users get a notable jump in chimes — each subagent's tool call can surface a permission prompt that fires theNotificationhook. The per-subtype rate limit (last_notification_${tool}_${project}_${subtype}) doesn't dampen this because permission prompts share their own bucket and arrive in bursts.Hook events Claude Code emits that
cndoesn't currently modelPer https://code.claude.com/docs/en/hooks:
cn?Stop(main session only)Notificationsubtypescn alertsSubagentStopSubagentStartTeammateIdle(agent teams)TaskCreated/TaskCompletedCHANGELOG line 83 (
Fixed agent-type hooks failing with "Messages are required for agent hooks" when configured for events other than Stop or SubagentStop) confirmsStopandSubagentStopare distinct events that need separate registration.Proposed asks (in order of value)
cn alertsto opt-in/out of additional events —SubagentStop,TeammateIdle,TaskCompletedas toggleable, same UX as today'sidle_prompt/permission_prompt.permission_promptand that this gets noisier underteammateMode: auto. Suggestcn alerts remove permission_promptfor users who only want idle-pings.CODE_NOTIFY_GLOBAL_MIN_INTERVAL_SECONDS) so a permission-prompt burst is dampened even when subtypes differ.Repro
Workaround
cn alerts remove permission_prompt && cn on— leaves onlyidle_prompt. Works but loses permission visibility entirely; finer-grained per-event controls would be better.Environment