Skip to content

Claude/agent teams communication yt18t#18

Open
amDosion wants to merge 8 commits intopengchengneo:mainfrom
amDosion:claude/agent-teams-communication-YT18t
Open

Claude/agent teams communication yt18t#18
amDosion wants to merge 8 commits intopengchengneo:mainfrom
amDosion:claude/agent-teams-communication-YT18t

Conversation

@amDosion
Copy link
Copy Markdown

@amDosion amDosion commented Apr 5, 2026

No description provided.

claude and others added 7 commits April 4, 2026 15:44
Introduces Unix domain socket based communication allowing two independent
Claude Code CLI terminals to exchange messages in real-time without polling.

- pipeTransport.ts: PipeServer/PipeClient classes using Node.js net module
- pipeRepl.ts: Interactive REPL with chat, remote cmd, ping, pipe discovery
- pipe-demo.ts: Quick launcher script for testing

https://claude.ai/code/session_01EAD69BAKKWnThvTZhMLK2N
Implements a full attach/detach protocol allowing one CLI terminal (master)
to forward user input to another CLI terminal (slave) and receive streamed
AI output back, while both can still operate independently when detached.

Changes:
- Extended pipe protocol with attach/detach/prompt/stream/done message types
- Added pipeIpc state to AppState (role, serverName, attachedTo, attachedBy)
- Created usePipeIpc hook (slave: auto-start PipeServer, handle attach, inject prompts)
- Created useMasterRelay hook (master: receive slave output, inject into conversation)
- Added /attach, /detach, /pipes slash commands
- Mounted hooks in REPL.tsx alongside useInboxPoller and useMailboxBridge

https://claude.ai/code/session_01EAD69BAKKWnThvTZhMLK2N
…output relay

Closes the two remaining gaps in the pipe bridge:

1. Master-mode input intercept (REPL.tsx onSubmit):
   When role=master, user input is forwarded to the slave via pipe
   instead of being sent to the local AI. Slash commands still run
   locally so /detach works.

2. Slave-mode output relay (REPL.tsx onQueryEvent + turn-end):
   When role=slave, assistant text blocks are streamed back to the
   master as they arrive. A 'done' message is sent when the turn
   completes. Tool starts are also relayed.

Uses globalThis.__pipeSendToMaster bridge to avoid circular deps
between the REPL callbacks and the usePipeIpc hook.

https://claude.ai/code/session_01EAD69BAKKWnThvTZhMLK2N
Add a complete inter-terminal communication system where:
- Every CLI auto-starts a PipeServer (standalone by default)
- Master CLI can /attach to multiple slaves, monitoring their sessions
- Slave CLI auto-reports all session data (AI output, tool calls) to master
- Master can /send tasks to slaves and review with /history, /pipe-status

New commands: /attach, /detach, /pipes, /send, /history, /pipe-status
New hooks: usePipeIpc (every CLI), useMasterMonitor (master only)
Transport: NDJSON over Unix domain sockets (~/.claude/pipes/*.sock)

https://claude.ai/code/session_01EAD69BAKKWnThvTZhMLK2N
Tests the complete master-slave communication flow with two independent
processes over real Unix domain sockets: attach, prompt, session data
relay (stream/tool_start/tool_result/done), detach, and re-attach.

All 11 test cases pass.

https://claude.ai/code/session_01EAD69BAKKWnThvTZhMLK2N
Comprehensive document covering requirements (12 items), architecture
design (transport/state/hooks/commands), implementation details for all
modified files, and test verification results.

https://claude.ai/code/session_01EAD69BAKKWnThvTZhMLK2N
@amDosion amDosion force-pushed the claude/agent-teams-communication-YT18t branch 6 times, most recently from ee1bab0 to 17c20c7 Compare April 5, 2026 18:45
… definitions

Phase 1 — Pipe IPC master-slave system:
- Named pipe transport (pipeTransport.ts) with NDJSON protocol
- UDS client/messaging (udsClient.ts, udsMessaging.ts)
- React hooks: usePipeIpc, useMasterRelay, useMasterMonitor, useSlaveNotifications
- Commands: /attach, /detach, /peers, /send, /pipes, /pipe-status
- Safe getPipeIpc() accessor with default state

Phase 2 — 9 PARTIAL feature flag implementations (P0-P8)
Phase 3 — 12 null tool stubs replaced with full buildTool() implementations

All stub call() return explicit error/unavailable messages.
All imports verified. Safe pipeIpc state access throughout.

https://claude.ai/code/session_01EAD69BAKKWnThvTZhMLK2N
@amDosion amDosion force-pushed the claude/agent-teams-communication-YT18t branch from 17c20c7 to 6d9cede Compare April 6, 2026 04:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants