Move in_review flag set before try block so it is always visible,
and consolidate per-session state writes into a single batch to
avoid repeated disk I/O during list. Also guard against missing
status entries with fallback defaults.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move in_review flag set inside try block so finally always clears it,
and actively clear stale flags in list when Claude is no longer active.
Previously a crash between setting the flag and entering try would
leave the session stuck in review state.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Review status now requires Claude to be active, preventing stale flags
from showing after a crash. Consolidates icon/color maps into a single
styles record and defers setting in_review until the container is up.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The list command needs to show when a session is under active
review so users don't interrupt it. Wrapping the review body in
try/finally ensures the flag is always cleared on exit.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PostToolUseFailure incorrectly marked the session idle on transient tool
errors. PreToolUse keeps the active signal fresh throughout tool execution,
while Stop alone handles the transition to idle.