Skip to content

Commit 3eb9a54

Browse files
grimmerkclaude
andcommitted
docs: add hook events comparison with claude-control
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 50b49c3 commit 3eb9a54

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

docs/session-status-hooks-design.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,22 @@ The `get-session-statuses` IPC handler internally calls `detectActiveSessions()`
176176
- Cache hit already makes the duplicate cost ~0ms.
177177
- Keeping the handler self-contained is simpler and more maintainable.
178178

179+
### Hook events: comparison with claude-control
180+
181+
claude-control uses the same hook mechanism with a similar script. Comparison:
182+
183+
| Event | claude-control | CodeV | Notes |
184+
|---|---|---|---|
185+
| SessionStart ||| Not added — purple (init) dot is acceptable for the few seconds before first prompt |
186+
| SessionEnd ||| Removes status file |
187+
| Stop ||| → idle |
188+
| UserPromptSubmit ||| → working |
189+
| PermissionRequest ||| → needs-attention |
190+
| SubagentStart ||| → working |
191+
| PostToolUseFailure ||| Not added — tool failures aren't always severe; no separate error color needed yet |
192+
193+
Key difference: claude-control keys status files by PID (`$PPID`), CodeV keys by sessionId. SessionId is more stable across resume cycles.
194+
179195
### Bug fix: merge vs replace on status update
180196

181197
`onSessionStatusesUpdated` must **merge** into existing state (`{...prev, ...newStatuses}`), not replace. JSONL-scanned statuses (for sessions without status files) exist only in React state. A replace would clear them when fs.watch fires for unrelated status file changes.

0 commit comments

Comments
 (0)