Dashboard: Send instructions to running agent from browser #354

Open
opened 2026-04-15 08:44:39 +00:00 by mprihoda · 0 comments
mprihoda commented 2026-04-15 08:44:39 +00:00 (Migrated from github.com)

Layer: 3 — Agent Integration
Parent: #343

Problem

When an agent finishes and needs input, you currently have to switch to the tmux session to respond. With 9-10 concurrent worktrees, this context switching is the primary workflow bottleneck.

Solution

  1. Input field in transcript viewer — type a response/instruction and send it to the running Claude Code session
  2. Use claude-code-query Session APIsession.send(prompt) to send input, session.stream() to receive responses
  3. SSE streaming for real-time response display (same pattern as procedures project chat)
  4. Session lifecycle — handle cases where the session has ended (offer to start a new one) or is mid-turn (queue the input)

Architecture

  • Dashboard server manages Claude Code sessions via claude-code-query library
  • Browser ↔ Server communication via SSE (server-sent events) for streaming responses
  • Server ↔ Claude Code communication via the Session trait (send/stream)
  • Sessions survive browser tab close (server-side process management)

Dependencies

  • works.iterative:claude-code-query-direct_3 (or effectful) for session management
  • Transcript viewer (#353) for display
**Layer:** 3 — Agent Integration **Parent:** #343 ## Problem When an agent finishes and needs input, you currently have to switch to the tmux session to respond. With 9-10 concurrent worktrees, this context switching is the primary workflow bottleneck. ## Solution 1. **Input field in transcript viewer** — type a response/instruction and send it to the running Claude Code session 2. **Use claude-code-query Session API** — `session.send(prompt)` to send input, `session.stream()` to receive responses 3. **SSE streaming** for real-time response display (same pattern as procedures project chat) 4. **Session lifecycle** — handle cases where the session has ended (offer to start a new one) or is mid-turn (queue the input) ## Architecture - Dashboard server manages Claude Code sessions via `claude-code-query` library - Browser ↔ Server communication via SSE (server-sent events) for streaming responses - Server ↔ Claude Code communication via the Session trait (send/stream) - Sessions survive browser tab close (server-side process management) ## Dependencies - `works.iterative:claude-code-query-direct_3` (or effectful) for session management - Transcript viewer (#353) for display
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
iterative-works/iw-cli#354
No description provided.