pub enum Event {
Notify,
Done,
Idle,
Working,
Unknown(String),
}Expand description
Lifecycle state the producing hook reported for a session.
On the wire this is a plain JSON string — the four known values
(notify, done, working, idle) round-trip through their named
variants, and anything else is preserved verbatim in Unknown(String)
so new hook event types added by future agents don’t break older
binaries. The variant order matches the switcher’s display priority
(most-attention-needing first): Notify, Done, Idle, Working,
Unknown.
Variants§
Notify
Agent explicitly signals the user (Claude Code Notification /
PermissionRequest, pi before_user_input analogues).
Done
Agent just finished a turn (Claude Code Stop, pi agent_end).
Idle
Session is alive but not interacting (Claude Code SessionStart
placeholder, pi session_start).
Working
Agent is in the middle of working — typing, calling tools
(Claude Code UserPromptSubmit / PreToolUse, pi
before_agent_start / tool_execution_start).
Unknown(String)
Forward-compat: a hook reported an event string we don’t recognize. Kept verbatim so re-serialization is lossless.
Implementations§
Source§impl Event
impl Event
Sourcepub fn needs_attention(&self) -> bool
pub fn needs_attention(&self) -> bool
Whether this event represents a session asking for the user’s eyes
right now. Notify is an explicit “blocked on you” signal; Done
is the just-finished state the next prompt will move on from. Any
future / unknown event value is treated as attention-worthy so a
new hook type added by an agent does not silently disappear from
the tmux indicator. Working and Idle are alive-but-not-asking.