Skip to content

Bidirectional session communication and multi-machine support via Channels #4

@amahpour

Description

@amahpour

Problem

The Command Center currently has one-way communication — hooks push session events to the dashboard, but there's no way to send prompts or instructions back to running Claude Code sessions. Additionally, the architecture is limited to a single machine.

Original problem (terminal launch)

The previous "New Session" implementation that launched sessions via tmux had a fundamental architectural issue:

Session ID mismatch: The Command Center creates a tmux session with a short UUID (e.g., 35ef0abc), but Claude Code assigns its own internal session UUID (e.g., 82e3f6e7-36db-4435-b1b5-a1cfe24133e1) when it starts. Hook events fire with Claude's UUID, not ours. This creates two DB records for the same logical session — one from our launch, one from hooks — causing:

  • Duplicate session cards on the dashboard
  • "Session not found" errors when navigating back to a launched session
  • No way to map our tmux ID to Claude's session ID

Additional complication: Claude Code shows an interactive trust dialog on first launch in a directory that requires manual Enter to proceed.

Broader problem

  • No way to send prompts/instructions to running sessions from the dashboard
  • Architecture is tightly coupled to local tmux — single machine only
  • No path to orchestrating sessions across multiple developer machines

Desired Behavior

  1. Dashboard can send prompts to any connected Claude Code session
  2. Claude Code can reply back to the dashboard
  3. Sessions on multiple machines can all report to a single dashboard
  4. Clicking a session card shows a chat-like interface (not a terminal)
  5. Optionally provide an initial prompt from the dashboard

Proposed Solution: Claude Code Channels

Use Claude Code's Channels system (research preview, v2.1.80+) to build a custom MCP-based channel server that bridges the dashboard and running sessions. See the comment below for the detailed proposal.

Context

  • Hooks already handle monitoring (SessionStart, PreToolUse, PostToolUse, Stop, etc.)
  • The channel would add the "write back" capability
  • Channels are MCP servers that Claude Code spawns as subprocesses
  • They communicate over stdio (MCP protocol) and can expose HTTP endpoints
  • This supersedes the tmux-based approach entirely

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions