Skip to content

Integrate Claude Code hooks and event system for session activity tracking #2

@dhilgaertner

Description

@dhilgaertner

Summary

Integrate with Claude Code's hook and event system to surface real-time activity notifications from each session's Claude Code instance. This would enable the app to understand what's happening inside each terminal without the user needing to switch tabs.

Motivation

Currently, the only way to know what Claude Code is doing in a session is to click on that session's tab and read the terminal output. With multiple active sessions, this creates a "check each tab" workflow. Claude Code has a hook system that emits events we can listen to — integrating with it would let us build intelligent notifications and a session activity timeline.

Proposed Features

1. Hook Integration

  • Register as a Claude Code hook consumer for each session's Claude Code process
  • Listen for events: SessionStart, Stop, Notification, tool use, permission requests, plan completion
  • Map events to session IDs so we know which session generated each event

2. Session Activity Notifications

Surface notifications for key events:

  • Permission requests — Claude needs approval to run a command or edit a file
  • Questions/input needed — Claude is waiting for user input (e.g., AskUserQuestion)
  • Plan completed — Claude has finished creating a plan and is waiting for approval
  • Task completed — Claude has finished working and is presenting results
  • Errors/blockers — Claude encountered an error and needs guidance

3. Status Dot Enhancement

The sidebar session status dot already tracks terminal readiness (gray → yellow → blue → green). Extend this to reflect Claude's activity state:

  • Green — Claude is actively working
  • Orange/pulsing — Claude needs attention (permission, question, plan review)
  • Blue — Claude is idle, waiting for a prompt
  • Red — Claude encountered an error

4. Activity Timeline View

A timeline or feed view (possibly in the Ticket Board area or a new tab) showing:

  • Chronological list of events across all sessions
  • Grouped by session with timestamps
  • Quick-jump to the relevant session tab
  • Filterable by event type (permissions, questions, completions)

5. Plan Tracking

When Claude produces a plan:

  • Extract the plan content from the terminal or hook event
  • Store it as session metadata
  • Display it in the session detail header or a dedicated panel
  • Track plan status: proposed → approved → in progress → completed

Technical Investigation Needed

  • Study Claude Code's hook system documentation and available event types
  • Determine how hooks are registered per-session (via --settings flag or config)
  • Evaluate whether hooks can emit structured JSON that we can parse
  • Design the event ingestion pipeline (hook → socket/file → app state)
  • Consider whether we need a persistent event store or just in-memory
  • Prototype with one event type (e.g., Notification) before building the full system

References

  • Claude Code hooks are configured via settings.json under the hooks key
  • Current CMUX-based sessions already pass hook config: --settings {"hooks":{"SessionStart":[...], "Stop":[...], "Notification":[...]}}
  • The ride send command and ride new-terminal --command could inject hook configuration when launching Claude

Labels

Enhancement, Investigation

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions