Skip to content

aparente/cast

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Cast πŸ¦€

A terminal UI (TUI) for managing your cast of Claude Code sessions. See which sessions need attention at a glance, with playful design touches that make managing AI assistants feel like play.

cast /kast/ noun β€” a group of crabs; also: the ensemble of characters in your terminal

Features

  • Real-time session tracking β€” All active Claude Code sessions in one dashboard
  • Smart session names β€” Auto-detects project name from package.json, git remote, or directory
  • Progress tracking β€” Shows task progress (X/Y completed) from Claude's TodoWrite tool
  • Status descriptions β€” See what Claude is currently doing via transcript parsing
  • Subagent tree view β€” See Task subagents as children of parent sessions with expandable rows
  • Status bubbling β€” If any subagent needs input, parent session shows alert indicator
  • Alert highlighting β€” Sessions needing input bubble to the top with ⚑ indicators
  • List & Kanban views β€” Toggle between views with l and k keys
  • Quick actions β€” Approve/deny/respond directly from dashboard (tmux sessions)
  • SQLite persistence β€” Sessions survive dashboard restarts
  • Playful design β€” Status verbs like "Cooking", "Scheming", "Paging you" + contextual emojis

Quick Start

# Install dependencies
bun install

# Start the dashboard
bun run src/cli.ts

# That's it! Sessions auto-register when you send messages.

Installation

1. Clone and install

git clone https://github.com/yourusername/cast.git
cd cast
bun install

2. Install Claude Code hooks

The hooks are what allow the dashboard to "see" your Claude Code sessions.

Option A: Run the installer (recommended)

bun run src/cli.ts install-hooks
# Copy the JSON output to ~/.claude/settings.json

Option B: Manual installation - add to ~/.claude/settings.json:

{
  "hooks": {
    "SessionStart": [{"hooks": [{"type": "command", "command": "/path/to/scripts/session-start.sh", "timeout": 5}]}],
    "SessionEnd": [{"hooks": [{"type": "command", "command": "/path/to/scripts/session-end.sh", "timeout": 5}]}],
    "Notification": [{"hooks": [{"type": "command", "command": "/path/to/scripts/notification.sh", "timeout": 5}]}],
    "PostToolUse": [{"matcher": "*", "hooks": [{"type": "command", "command": "/path/to/scripts/tool-use.sh", "timeout": 5}]}],
    "UserPromptSubmit": [{"hooks": [{"type": "command", "command": "/path/to/scripts/user-prompt.sh", "timeout": 5}]}]
  }
}

3. Use your Claude Code sessions

Sessions automatically register when:

  • A new session starts (SessionStart hook)
  • You send a message (UserPromptSubmit hook)
  • Claude uses any tool (PostToolUse hook)

No need to restart existing sessions - just send a message in each one.

Usage

CLI Commands

# Launch the interactive dashboard (default)
bun run src/cli.ts

# Run server only (headless mode)
bun run src/cli.ts server

# List sessions from command line
bun run src/cli.ts list

# Clear all sessions from database
bun run src/cli.ts clear

# Remove sessions older than N minutes
bun run src/cli.ts prune -m 60

# Show hook installation instructions
bun run src/cli.ts install-hooks

Keyboard Shortcuts

Key Action
↑ / ↓ Navigate sessions
← / β†’ Collapse/expand subagent tree
Enter Toggle expand (if has children) or open detail
Space Open detail view
l Switch to list view
k Switch to kanban view
r Refresh
q Quit

Quick Actions (in detail view)

Key Action
y Approve (sends "y")
n Deny (sends "n")
r Type custom response
Esc Back to list

Note: Quick actions currently only work with tmux sessions. VS Code terminal and iTerm2 support is planned.

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      Claude Code Sessions                            β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”              β”‚
β”‚  β”‚ Session 1    β”‚  β”‚ Session 2    β”‚  β”‚ Session N    β”‚              β”‚
β”‚  β”‚ (project-a)  β”‚  β”‚ (project-b)  β”‚  β”‚ (project-n)  β”‚              β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜              β”‚
β”‚         β”‚                 β”‚                 β”‚                       β”‚
β”‚         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                       β”‚
β”‚                          β”‚                                          β”‚
β”‚                    Hook Scripts                                     β”‚
β”‚         SessionStart, SessionEnd, Notification,                     β”‚
β”‚         PostToolUse, UserPromptSubmit                               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚ HTTP POST /event
                           β–Ό
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚   Dashboard Server     β”‚
              β”‚   localhost:7432       β”‚
              β”‚                        β”‚
              β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
              β”‚  β”‚ SQLite Store     β”‚  β”‚
              β”‚  β”‚ ~/.claude-       β”‚  β”‚
              β”‚  β”‚ session-manager  β”‚  β”‚
              β”‚  β”‚ .db              β”‚  β”‚
              β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
              β”‚                        β”‚
              β”‚  Endpoints:            β”‚
              β”‚  POST /event           β”‚
              β”‚  POST /action          β”‚
              β”‚  GET  /sessions        β”‚
              β”‚  GET  /health          β”‚
              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          β”‚
                          β–Ό
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚   Terminal UI (Ink)    β”‚
              β”‚                        β”‚
              β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
              β”‚  β”‚ List View        β”‚  β”‚
              β”‚  β”‚ Kanban View      β”‚  β”‚
              β”‚  β”‚ Detail View      β”‚  β”‚
              β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Hook Events

Hook When it fires What it does
SessionStart New session begins Registers session with terminal context
SessionEnd Session terminates Removes session from dashboard
Notification Claude needs input Sets alerting=true, status=needs_input
PostToolUse After any tool call Updates status=working, tracks TodoWrite
UserPromptSubmit User sends message Ensures session is registered
Stop Claude's turn ends Parses transcript for status description

Data Flow

  1. Hook fires β†’ Shell script reads JSON from stdin
  2. Script extracts session_id, cwd, terminal context
  3. Script POSTs to dashboard server at localhost:7432
  4. Server updates SQLite database + in-memory cache
  5. Store notifies React components via pub/sub
  6. UI re-renders with new session state

Configuration

Environment Variables

Variable Default Description
CSM_PORT 7432 Server port
CSM_HOST localhost Server host

Files

Path Purpose
~/.cast.db SQLite database for session persistence
~/.claude/settings.json Claude Code hooks configuration

Terminal Support for Quick Actions

Quick actions (approve/deny/respond from dashboard) require the ability to send input to the terminal running Claude Code.

Terminal Status How it works
tmux βœ… Supported tmux send-keys -t <pane>
VS Code πŸ”œ Planned Needs VS Code extension
iTerm2 πŸ”œ Planned AppleScript integration
Other ❌ View only No way to send input

The dashboard detects terminal type via environment variables:

  • $TMUX / $TMUX_PANE for tmux
  • $TERM_PROGRAM=vscode for VS Code
  • $TERM_PROGRAM=iTerm.app for iTerm2

Tech Stack

Design Philosophy

Inspired by the "design delight" of Claude Code itself:

  • Playful status verbs β€” "Cooking", "Scheming", "Tinkering" instead of "working"
  • Contextual emojis β€” 🧬 for bio projects, πŸ’° for finance, πŸ€– for AI
  • Animated elements β€” Spinner for working sessions, walking crab for empty state
  • Human-friendly messages β€” "Someone needs you!" instead of "1 session alerting"

Future Plans

  • Subagent tree view (Tasks as children of parent sessions)
  • TodoWrite progress tracking
  • Smart session naming (package.json, git, directory)
  • Transcript parsing for status descriptions
  • Quick actions for tmux sessions
  • VS Code extension for quick actions
  • iTerm2 AppleScript integration
  • Sound/visual alerts integration
  • Improved quick action UX (visible input field)

License

MIT

About

πŸ¦€ A terminal UI for managing your cast of Claude Code sessions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors