Blame

bc7b82 Claude (MCP) 2026-03-16 04:43:54
[mcp] Recreate Agent IRC Architecture design doc (lost during wiki dev work)
1
---
2
category: reference
3
tags: [agents, irc, mcp, architecture]
731b96 Claude (MCP) 2026-03-16 17:37:43
[mcp] Update Agent IRC Architecture with refined design decisions from brainstorming session
4
last_updated: 2026-03-16
bc7b82 Claude (MCP) 2026-03-16 04:43:54
[mcp] Recreate Agent IRC Architecture design doc (lost during wiki dev work)
5
confidence: medium
6
---
7
8
# Agent IRC Architecture
9
10
An architecture for multi-agent coordination over IRC, where a human (the PM) and AI agents share a message bus. The goal is to externalize the coordination layer that currently lives inside Claude Code's context window, so that agents preserve context for their actual work, the human can participate from a phone or terminal, and the whole system is observable by just reading the chat.
11
12
## The problem
13
731b96 Claude (MCP) 2026-03-16 17:37:43
[mcp] Update Agent IRC Architecture with refined design decisions from brainstorming session
14
The current agent workflow runs everything inside a single Claude Code session tree. The orchestrator dispatches managers via `Task`, managers dispatch workers, questions relay back up the chain. This works, but:
bc7b82 Claude (MCP) 2026-03-16 04:43:54
[mcp] Recreate Agent IRC Architecture design doc (lost during wiki dev work)
15
16
- The orchestrator's context fills up relaying messages it doesn't need to reason about.
17
- The human is behind a three-hop relay for every question (worker → manager → orchestrator → human → back). You have to be at the terminal.
18
- There's no way to observe what agents are doing without being the orchestrator. No dashboard, no logs, no lurking.
19
- You can't intervene in a task without going through the orchestrator.
20
21
## The idea
22
23
Put everyone on IRC. The PM, the EM, the workers — all peers on a shared message bus. The coordination protocol moves from in-process function calls to channel messages. Everything is observable by joining the channel. The human can participate from a phone IRC client, a terminal, or both.
24
25
## Org structure
26
27
**PM (you)** — sets priorities, answers product questions, makes scope decisions. Hangs out in `#project-{slug}`. Doesn't manage the sprint — that's the EM's job. Can peek into any channel but mostly watches the project channel for decisions that need input.
28
88448e Claude (MCP) 2026-03-16 17:45:47
[mcp] Comprehensive update: research findings, wiki shared state, git strategy, polling, PM delegate, resolved open questions
29
**PM delegate** — optionally, a Claude.ai session connected to the IRC MCP, acting as the PM's mouthpiece when the PM is AFK. The PM talks to Claude.ai from their phone or browser; Claude.ai speaks on the PM's behalf in the channels. This sidesteps the mobile IRC client problem entirely — the PM's interface is whatever Claude.ai runs on.
30
31
**EM (coordinator)** — a long-running Claude Code SDK session (Opus) that runs the team. Breaks down requirements into tasks, assigns work, tracks progress, makes implementation decisions, surfaces product questions to the PM (or PM delegate). Lives in `#project-{slug}` and `#standup-{slug}`. Shields the PM from implementation noise.
bc7b82 Claude (MCP) 2026-03-16 04:43:54
[mcp] Recreate Agent IRC Architecture design doc (lost during wiki dev work)
32
731b96 Claude (MCP) 2026-03-16 17:37:43
[mcp] Update Agent IRC Architecture with refined design decisions from brainstorming session
33
**Managers** — Claude Code SDK sessions (Opus) that own individual tasks. Follow the proceed workflow: plan, implement, test, review, fix, document. Each manager gets a `#work-{task-id}` channel for its workers. Reports status and completions to `#standup-{slug}`.
bc7b82 Claude (MCP) 2026-03-16 04:43:54
[mcp] Recreate Agent IRC Architecture design doc (lost during wiki dev work)
34
731b96 Claude (MCP) 2026-03-16 17:37:43
[mcp] Update Agent IRC Architecture with refined design decisions from brainstorming session
35
**Workers** — Claude Code SDK sessions (Sonnet/Haiku) dispatched by managers for specific jobs: implementation, testing, review, documentation. Operate in `#work-{task-id}` channels. Disposable — when context fills up, they summarize and exit.
bc7b82 Claude (MCP) 2026-03-16 04:43:54
[mcp] Recreate Agent IRC Architecture design doc (lost during wiki dev work)
36
37
The EM decides what needs the PM's input vs. what it can handle itself. Rule of thumb: anything that changes scope, user-facing behavior, or architecture goes to `#project-{slug}`. Anything that's purely implementation strategy, the EM decides. The EM should also push back on the PM when something is technically inadvisable, just like a real EM would.
38
39
## Channel topology
40
41
All channels exist on a single IRC server. Multiple projects share the server, namespaced by slug.
42
88448e Claude (MCP) 2026-03-16 17:45:47
[mcp] Comprehensive update: research findings, wiki shared state, git strategy, polling, PM delegate, resolved open questions
43
- **#project-{slug}** — PM + EM coordination. Product decisions, priority calls, scope questions. Low traffic, high signal.
bc7b82 Claude (MCP) 2026-03-16 04:43:54
[mcp] Recreate Agent IRC Architecture design doc (lost during wiki dev work)
44
- **#standup-{slug}** — EM + managers. Task assignments, status updates, completion reports. The sprint board. PM can lurk here if they want more detail.
45
- **#work-{task-id}** — manager + workers for a specific task. Implementation discussion, test results, review feedback. Noisy and disposable. Created when a task starts, abandoned when it completes.
46
- **#errors** — dead-letter channel. Any agent that hits an unrecoverable failure posts here. Monitored by the EM and optionally by the PM.
47
48
## Agent naming
49
50
Agents get human names, not mechanical identifiers. A conversation between `schuyler`, `Harper`, and `Dinesh` is immediately readable. A conversation between `em-robot`, `mgr-e2-cdn`, and `worker-3` is a SCADA dashboard.
51
52
Names also help with the shift-change problem. When `Ramona` hits context exhaustion and hands off to `Jules`, that's a legible event — new person joined, picked up the thread. If `worker-3` gets replaced by another `worker-3`, it's invisible, and that invisibility is exactly the kind of thing that causes confusion.
53
731b96 Claude (MCP) 2026-03-16 17:37:43
[mcp] Update Agent IRC Architecture with refined design decisions from brainstorming session
54
A names file (`names.txt`, one per line) lives in the repo. The supervisor pops a name off the list when spawning a process and passes it as the IRC nick. The name also goes into the agent's system prompt so it knows who it is. Names are not reused within a session — once `Ramona` exits, that name is retired until the list resets.
bc7b82 Claude (MCP) 2026-03-16 04:43:54
[mcp] Recreate Agent IRC Architecture design doc (lost during wiki dev work)
55
56
The EM gets a persistent name that doesn't rotate — it's the one constant in the channel. Think of it as the team lead who's always there. Managers and workers get fresh names each time they're spawned.
57
58
## Transport abstraction
59
60
IRC is the first backend, but the architecture shouldn't be welded to it. A thin transport interface keeps options open:
61
62
```python
63
class Transport(Protocol):
64
async def send(self, channel: str, message: str, sender: str) -> None: ...
65
async def read(self, channel: str, since: datetime | None = None) -> list[Message]: ...
66
async def create_channel(self, name: str) -> None: ...
67
async def list_channels(self) -> list[str]: ...
68
async def get_members(self, channel: str) -> list[str]: ...
69
70
@dataclass
71
class Message:
72
channel: str
73
sender: str
74
text: str
75
timestamp: datetime
76
```
77
78
The IRC implementation wraps an async IRC client library (`bottom` or `irc`). A Zulip or Matrix implementation could be swapped in later — Zulip's topic-per-stream model maps particularly well (stream = project, topic = task).
79
731b96 Claude (MCP) 2026-03-16 17:37:43
[mcp] Update Agent IRC Architecture with refined design decisions from brainstorming session
80
## MCP bridge
bc7b82 Claude (MCP) 2026-03-16 04:43:54
[mcp] Recreate Agent IRC Architecture design doc (lost during wiki dev work)
81
82
A FastMCP server wraps the transport and exposes tools to agents. This is the only interface agents use — they never touch IRC directly.
83
84
### Design principle: conversational, not structured IPC
85
86
A core goal of this architecture is that a human can join any channel and immediately understand what's happening. If agents are posting JSON blobs, the channels are just as opaque as Claude Code's `Task` tool — you've traded one black box for a noisier one.
87
88
Agents communicate in natural language. The EM assigns a task by saying so in plain English. The manager reports a plan the same way. The PM can read `#standup-{slug}` on their phone and immediately follow the state of the sprint without parsing anything.
89
731b96 Claude (MCP) 2026-03-16 17:37:43
[mcp] Update Agent IRC Architecture with refined design decisions from brainstorming session
90
The only concession to machine-parseability is **lightweight conventions** for the supervisor — the EM prefixes task assignments with `TASK:` so the supervisor can pattern-match without NLP. Everything else is natural language.
bc7b82 Claude (MCP) 2026-03-16 04:43:54
[mcp] Recreate Agent IRC Architecture design doc (lost during wiki dev work)
91
92
### Tools
93
94
| Tool | Description |
95
|------|-------------|
96
| `send_message(channel, text)` | Post a message to a channel. |
97
| `read_messages(channel, since?, limit?)` | Read recent messages from a channel. Returns newest-first. |
98
| `create_channel(name)` | Create a new channel (used by EM when spinning up task channels). |
99
| `list_channels()` | List active channels. |
100
| `get_members(channel)` | List who's in a channel. |
101
731b96 Claude (MCP) 2026-03-16 17:37:43
[mcp] Update Agent IRC Architecture with refined design decisions from brainstorming session
102
That's it. No `post_task`, `claim_task`, `poll_for_task`. Task assignment, claiming, and completion are conversational acts, not structured API calls. The EM says "do this," the manager says "on it," the manager says "done."
bc7b82 Claude (MCP) 2026-03-16 04:43:54
[mcp] Recreate Agent IRC Architecture design doc (lost during wiki dev work)
103
104
Task state is tracked by the EM reading channel history and reasoning about it, not by a state machine. This is less reliable than a database but vastly more observable and simpler to build. If it breaks, you can see exactly where it broke by reading the channel.
105
88448e Claude (MCP) 2026-03-16 17:45:47
[mcp] Comprehensive update: research findings, wiki shared state, git strategy, polling, PM delegate, resolved open questions
106
### Message length
107
108
ergo supports the IRCv3 `maxline` capability, allowing messages up to ~8KB (vs. the traditional 512-byte limit). The MCP bridge should negotiate `maxline` on connect. For messages that still exceed the limit, the bridge chunks transparently — agents don't need to worry about it.
109
bc7b82 Claude (MCP) 2026-03-16 04:43:54
[mcp] Recreate Agent IRC Architecture design doc (lost during wiki dev work)
110
### Configuration
111
112
```
113
TRANSPORT_TYPE=irc
731b96 Claude (MCP) 2026-03-16 17:37:43
[mcp] Update Agent IRC Architecture with refined design decisions from brainstorming session
114
IRC_SERVER=<proxmox-host-ip>
bc7b82 Claude (MCP) 2026-03-16 04:43:54
[mcp] Recreate Agent IRC Architecture design doc (lost during wiki dev work)
115
IRC_PORT=6667
116
IRC_NICK=mcp-bridge
117
MCP_PORT=8090
118
```
119
120
The MCP server maintains a single IRC connection and multiplexes tool calls from multiple agents. Agents identify themselves via a `sender` parameter so messages get the right nick attribution.
121
88448e Claude (MCP) 2026-03-16 17:45:47
[mcp] Comprehensive update: research findings, wiki shared state, git strategy, polling, PM delegate, resolved open questions
122
## Shared state: robot.wtf wiki
123
124
IRC is ephemeral conversation. Durable shared state lives on a robot.wtf project wiki, accessed by agents via the wiki MCP.
125
126
- **Sprint state** — EM writes current task assignments, status, and blockers to a project wiki page. Survives EM shift-changes without replaying IRC history.
127
- **Handoff summaries** — outgoing agents write their handoff doc to the wiki. Incoming agent reads it as initial context.
128
- **Task specs and plans** — managers write plans to wiki pages before implementing. PM can review from anywhere.
129
- **Decision log** — architectural decisions, scope changes, PM rulings captured durably.
130
131
This means agents get **two MCP servers** in their config: the IRC bridge for communication, and robot.wtf for persistent shared state. IRC is the conversation, the wiki is the record.
132
133
EM recovery after a crash or shift-change: read the project wiki pages to reconstruct sprint state. No dependence on IRC `chathistory` depth.
134
731b96 Claude (MCP) 2026-03-16 17:37:43
[mcp] Update Agent IRC Architecture with refined design decisions from brainstorming session
135
## Agent lifecycle: long-running with shift-changes
136
137
Agents are long-running Claude Code SDK sessions. They persist across tasks, preserving context — a worker that just finished refactoring the auth module still has that code in context when the next auth-related task comes in.
138
139
### Why the SDK, not the CLI
140
141
The Claude Code CLI is designed for a human at a terminal — prompt handling, display rendering, keybindings are all overhead when the consumer is a daemon. The Claude Code SDK gives programmatic conversation management: send messages, get responses, and critically — start a new conversation with a handoff summary when context gets thin. That's the "compaction" equivalent: not clearing context, but gracefully retiring the agent and spawning a fresh one with the summary.
142
88448e Claude (MCP) 2026-03-16 17:45:47
[mcp] Comprehensive update: research findings, wiki shared state, git strategy, polling, PM delegate, resolved open questions
143
### Polling and dispatch
bc7b82 Claude (MCP) 2026-03-16 04:43:54
[mcp] Recreate Agent IRC Architecture design doc (lost during wiki dev work)
144
88448e Claude (MCP) 2026-03-16 17:45:47
[mcp] Comprehensive update: research findings, wiki shared state, git strategy, polling, PM delegate, resolved open questions
145
Two-layer approach:
146
147
**Layer 1 — Supervisor push (primary).** The supervisor watches IRC directly for `TASK:` prefixes and immediately injects a "check your channels" message into the target agent's SDK session. Near-zero dispatch latency.
148
149
**Layer 2 — Polling (fallback/health).** The supervisor periodically injects heartbeat prompts into idle agents. This catches messages the supervisor missed (e.g., during its own restart) and proves the agent is still alive.
150
151
MVP polling strategy: flat 30s interval when idle, no polling when active. Add backoff (30s → 60s → 120s cap) later if idle token costs warrant it.
bc7b82 Claude (MCP) 2026-03-16 04:43:54
[mcp] Recreate Agent IRC Architecture design doc (lost during wiki dev work)
152
731b96 Claude (MCP) 2026-03-16 17:37:43
[mcp] Update Agent IRC Architecture with refined design decisions from brainstorming session
153
### Idle detection
bc7b82 Claude (MCP) 2026-03-16 04:43:54
[mcp] Recreate Agent IRC Architecture design doc (lost during wiki dev work)
154
731b96 Claude (MCP) 2026-03-16 17:37:43
[mcp] Update Agent IRC Architecture with refined design decisions from brainstorming session
155
A Haiku-class classifier determines whether an agent is idle. No conversation state needed — just a single SDK `create_message` call:
bc7b82 Claude (MCP) 2026-03-16 04:43:54
[mcp] Recreate Agent IRC Architecture design doc (lost during wiki dev work)
156
731b96 Claude (MCP) 2026-03-16 17:37:43
[mcp] Update Agent IRC Architecture with refined design decisions from brainstorming session
157
> "Here's the last 5 minutes of this agent's IRC activity. Is it idle? yes/no"
bc7b82 Claude (MCP) 2026-03-16 04:43:54
[mcp] Recreate Agent IRC Architecture design doc (lost during wiki dev work)
158
88448e Claude (MCP) 2026-03-16 17:45:47
[mcp] Comprehensive update: research findings, wiki shared state, git strategy, polling, PM delegate, resolved open questions
159
Pennies per evaluation. This keeps the supervisor dumb — it doesn't need to understand task semantics, just whether to send a heartbeat or let the agent work.
160
161
### Context monitoring
162
163
The Claude Code SDK does not expose a "% context used" metric. Each response includes per-turn `usage.input_tokens`. The supervisor accumulates these across turns and compares against the known context window size (200K for Sonnet, 1M for Opus) to estimate fullness.
164
165
The `result` message also provides `cost_usd`, useful for per-agent budget tracking.
bc7b82 Claude (MCP) 2026-03-16 04:43:54
[mcp] Recreate Agent IRC Architecture design doc (lost during wiki dev work)
166
731b96 Claude (MCP) 2026-03-16 17:37:43
[mcp] Update Agent IRC Architecture with refined design decisions from brainstorming session
167
### Context exhaustion and shift-changes
bc7b82 Claude (MCP) 2026-03-16 04:43:54
[mcp] Recreate Agent IRC Architecture design doc (lost during wiki dev work)
168
88448e Claude (MCP) 2026-03-16 17:45:47
[mcp] Comprehensive update: research findings, wiki shared state, git strategy, polling, PM delegate, resolved open questions
169
When an agent's estimated context usage crosses a threshold (e.g., 80% of window):
bc7b82 Claude (MCP) 2026-03-16 04:43:54
[mcp] Recreate Agent IRC Architecture design doc (lost during wiki dev work)
170
731b96 Claude (MCP) 2026-03-16 17:37:43
[mcp] Update Agent IRC Architecture with refined design decisions from brainstorming session
171
1. Supervisor tells the agent to produce a handoff summary.
88448e Claude (MCP) 2026-03-16 17:45:47
[mcp] Comprehensive update: research findings, wiki shared state, git strategy, polling, PM delegate, resolved open questions
172
2. Agent writes the summary to the project wiki.
173
3. Agent posts a notice to its task channel and `#standup-{slug}` that it's handing off.
731b96 Claude (MCP) 2026-03-16 17:37:43
[mcp] Update Agent IRC Architecture with refined design decisions from brainstorming session
174
4. Supervisor kills the session.
88448e Claude (MCP) 2026-03-16 17:45:47
[mcp] Comprehensive update: research findings, wiki shared state, git strategy, polling, PM delegate, resolved open questions
175
5. Supervisor spawns a replacement with a new name from the names file and the wiki handoff page as initial context.
bc7b82 Claude (MCP) 2026-03-16 04:43:54
[mcp] Recreate Agent IRC Architecture design doc (lost during wiki dev work)
176
731b96 Claude (MCP) 2026-03-16 17:37:43
[mcp] Update Agent IRC Architecture with refined design decisions from brainstorming session
177
This is the "shift change" pattern — natural for an org metaphor. When `Ramona` leaves and `Jules` arrives, everyone in the channel can see the transition.
bc7b82 Claude (MCP) 2026-03-16 04:43:54
[mcp] Recreate Agent IRC Architecture design doc (lost during wiki dev work)
178
88448e Claude (MCP) 2026-03-16 17:45:47
[mcp] Comprehensive update: research findings, wiki shared state, git strategy, polling, PM delegate, resolved open questions
179
## Git strategy
180
181
Multiple agents edit the same repos simultaneously. Branch isolation via git worktrees.
182
183
### Worktree lifecycle
184
185
The **supervisor** creates worktrees before spawning agents. Agents never touch `git worktree add/remove`.
186
187
```
188
~/projects/repo/ # bind-mounted, main branch (protected)
189
~/projects/repo/.worktrees/
190
agent-task-42/ # worktree for task 42
191
agent-task-71/ # worktree for task 71
192
```
193
194
Supervisor sequence per task:
195
1. `git worktree add .worktrees/agent-task-{id} -b task/{id}`
196
2. Spawn agent session with `cwd` set to the worktree
197
3. Pass the branch name in the agent's system prompt
198
199
### Branch and merge strategy
200
201
- **Main branch is protected.** Agents never get the main worktree path, only task worktree paths.
202
- **Agents commit freely** to their `task/{id}` branch and push when done.
203
- **Human PM merges.** No auto-merge for MVP. The supervisor or EM can rebase branches and annotate PRs, but the merge button stays with the human.
204
- **Conflict prevention:** the EM avoids assigning overlapping file sets to concurrent agents. When conflicts happen anyway, the supervisor flags them for human resolution.
205
206
### Cleanup
207
208
- **Normal completion:** supervisor waits for push, then `git worktree remove`. Branch retained until merged.
209
- **Agent crash:** supervisor commits any uncommitted work with `[INCOMPLETE]` prefix, removes worktree, flags task for reassignment.
210
- **On supervisor restart:** reconcile state against `git worktree list`, clean up orphans.
211
731b96 Claude (MCP) 2026-03-16 17:37:43
[mcp] Update Agent IRC Architecture with refined design decisions from brainstorming session
212
## Architecture components
213
214
Three independent components, deployed separately for independent failure domains:
215
216
### 1. ergo IRCd
217
88448e Claude (MCP) 2026-03-16 17:45:47
[mcp] Comprehensive update: research findings, wiki shared state, git strategy, polling, PM delegate, resolved open questions
218
- Runs in an LXC container on a Proxmox server (16GB RAM).
731b96 Claude (MCP) 2026-03-16 17:37:43
[mcp] Update Agent IRC Architecture with refined design decisions from brainstorming session
219
- Set-and-forget after initial configuration.
88448e Claude (MCP) 2026-03-16 17:45:47
[mcp] Comprehensive update: research findings, wiki shared state, git strategy, polling, PM delegate, resolved open questions
220
- IRCv3 `chathistory` enabled for convenience, but not load-bearing — sprint state lives on the wiki.
221
- `maxline` capability enabled for longer messages.
731b96 Claude (MCP) 2026-03-16 17:37:43
[mcp] Update Agent IRC Architecture with refined design decisions from brainstorming session
222
- No TLS needed for LAN traffic in MVP.
223
224
### 2. IRC MCP bridge (FastMCP)
225
226
- ~200 lines of Python.
227
- Wraps the transport abstraction with IRC backend.
228
- Exposes the five tools above.
88448e Claude (MCP) 2026-03-16 17:45:47
[mcp] Comprehensive update: research findings, wiki shared state, git strategy, polling, PM delegate, resolved open questions
229
- Negotiates `maxline` with ergo; chunks messages transparently if needed.
731b96 Claude (MCP) 2026-03-16 17:37:43
[mcp] Update Agent IRC Architecture with refined design decisions from brainstorming session
230
- Connects to ergo over LAN.
231
- Runs in a Docker container on the desktop.
232
233
### 3. Agent supervisor
234
235
- Python process using the Claude Code SDK.
236
- Spawns and manages agent sessions (EM, managers, workers).
88448e Claude (MCP) 2026-03-16 17:45:47
[mcp] Comprehensive update: research findings, wiki shared state, git strategy, polling, PM delegate, resolved open questions
237
- Watches IRC for `TASK:` prefixes to push-dispatch agents.
238
- Monitors context usage (accumulated input tokens per session).
239
- Handles shift-changes (summarize to wiki → kill → respawn with wiki context).
731b96 Claude (MCP) 2026-03-16 17:37:43
[mcp] Update Agent IRC Architecture with refined design decisions from brainstorming session
240
- Runs the Haiku idle-checker.
88448e Claude (MCP) 2026-03-16 17:45:47
[mcp] Comprehensive update: research findings, wiki shared state, git strategy, polling, PM delegate, resolved open questions
241
- Creates and cleans up git worktrees.
731b96 Claude (MCP) 2026-03-16 17:37:43
[mcp] Update Agent IRC Architecture with refined design decisions from brainstorming session
242
- Runs in a Docker container on the desktop, alongside the bridge.
88448e Claude (MCP) 2026-03-16 17:45:47
[mcp] Comprehensive update: research findings, wiki shared state, git strategy, polling, PM delegate, resolved open questions
243
- Bind-mounts the project directory from the host.
731b96 Claude (MCP) 2026-03-16 17:37:43
[mcp] Update Agent IRC Architecture with refined design decisions from brainstorming session
244
245
```
246
Desktop (128GB RAM) Proxmox (16GB RAM)
247
┌──────────────────────────────┐ ┌──────────────────┐
248
│ docker-compose │ │ LXC container │
249
│ ┌────────────┐ ┌───────────┐│ │ ┌──────────────┐ │
250
│ │ Supervisor │ │ IRC MCP ││ LAN │ │ ergo │ │
251
│ │ (SDK) │ │ Bridge ││◄────►│ │ IRCd │ │
252
│ └────────────┘ └───────────┘│ │ └──────────────┘ │
253
│ bind: ~/projects │ └──────────────────┘
254
└──────────────────────────────┘
255
88448e Claude (MCP) 2026-03-16 17:45:47
[mcp] Comprehensive update: research findings, wiki shared state, git strategy, polling, PM delegate, resolved open questions
256
│ IRC client (terminal) or Claude.ai (PM delegate)
731b96 Claude (MCP) 2026-03-16 17:37:43
[mcp] Update Agent IRC Architecture with refined design decisions from brainstorming session
257
PM
258
```
bc7b82 Claude (MCP) 2026-03-16 04:43:54
[mcp] Recreate Agent IRC Architecture design doc (lost during wiki dev work)
259
88448e Claude (MCP) 2026-03-16 17:45:47
[mcp] Comprehensive update: research findings, wiki shared state, git strategy, polling, PM delegate, resolved open questions
260
Agents receive two MCP server configs:
261
1. **IRC bridge** — communication with other agents and the PM
262
2. **robot.wtf wiki** — persistent shared state (sprint status, handoff summaries, task specs, decisions)
263
bc7b82 Claude (MCP) 2026-03-16 04:43:54
[mcp] Recreate Agent IRC Architecture design doc (lost during wiki dev work)
264
## Relationship to existing Agent_Workflow
265
266
What carries forward unchanged:
267
268
- Role definitions (manager, implementer, test runner, Groucho/Chico/Zeppo/Fixer/Documenter)
269
- The proceed workflow (plan → implement → test → review → fix → document)
731b96 Claude (MCP) 2026-03-16 17:37:43
[mcp] Update Agent IRC Architecture with refined design decisions from brainstorming session
270
- Model assignments (Opus for EM and managers, Sonnet for workers, Haiku for idle detection and documentation)
bc7b82 Claude (MCP) 2026-03-16 04:43:54
[mcp] Recreate Agent IRC Architecture design doc (lost during wiki dev work)
271
- Review and fix loop limits (3 attempts before escalating)
272
- Worker dispatch guidance (what context to give each worker type)
273
274
What changes:
275
276
- Coordination moves from in-process `Task`/`run_in_background` to IRC channel messages via MCP
277
- The orchestrator role splits: strategic coordination stays with the EM, human interaction moves to the channel
88448e Claude (MCP) 2026-03-16 17:45:47
[mcp] Comprehensive update: research findings, wiki shared state, git strategy, polling, PM delegate, resolved open questions
278
- Question relay is replaced by direct channel participation — the PM is in the room (or their Claude.ai delegate is)
279
- Task state lives on the wiki, conversation happens on IRC
731b96 Claude (MCP) 2026-03-16 17:37:43
[mcp] Update Agent IRC Architecture with refined design decisions from brainstorming session
280
- Claude Code CLI replaced by Claude Code SDK for programmatic lifecycle management
bc7b82 Claude (MCP) 2026-03-16 04:43:54
[mcp] Recreate Agent IRC Architecture design doc (lost during wiki dev work)
281
282
## MVP scope
283
88448e Claude (MCP) 2026-03-16 17:45:47
[mcp] Comprehensive update: research findings, wiki shared state, git strategy, polling, PM delegate, resolved open questions
284
1. **ergo IRCd** in LXC on Proxmox. Single binary, default config, enable `chathistory` and `maxline`.
285
2. **IRC MCP bridge** (~200 lines Python). FastMCP wrapping the transport abstraction. Five tools. Docker container.
286
3. **Agent supervisor** — Python, Claude Code SDK, Haiku idle-checker, shift-change logic, worktree management. Docker container.
731b96 Claude (MCP) 2026-03-16 17:37:43
[mcp] Update Agent IRC Architecture with refined design decisions from brainstorming session
287
4. **docker-compose** for bridge + supervisor on the desktop, bind-mounting the project directory.
88448e Claude (MCP) 2026-03-16 17:45:47
[mcp] Comprehensive update: research findings, wiki shared state, git strategy, polling, PM delegate, resolved open questions
288
5. **robot.wtf project wiki** for shared state (already exists).
289
6. **One EM process** — Opus, system-prompted as the engineering manager.
290
7. **One manager process** — spawned when the EM posts a task.
291
8. **PM** — connected to ergo from terminal (weechat/irssi).
292
9. **One end-to-end task** — EM assigns, manager runs the proceed workflow, PM observes from IRC, state persisted to wiki.
293
294
Not in MVP: multiple parallel workers, TLS, remote MCP auth (for Claude.ai PM delegate), multi-project namespacing, Matrix/Zulip backends, polling backoff.
295
296
## Future: PM delegate via Claude.ai
297
298
Once the IRC MCP bridge is exposed as a remote MCP server (with auth), a Claude.ai session can connect to it and act as the PM's delegate. The PM talks to Claude.ai from their phone or browser; Claude.ai participates in IRC channels on their behalf. This replaces the need for a mobile IRC client entirely.
bc7b82 Claude (MCP) 2026-03-16 04:43:54
[mcp] Recreate Agent IRC Architecture design doc (lost during wiki dev work)
299
88448e Claude (MCP) 2026-03-16 17:45:47
[mcp] Comprehensive update: research findings, wiki shared state, git strategy, polling, PM delegate, resolved open questions
300
This requires the bridge to be internet-accessible with authentication — not in MVP scope, but the architecture supports it naturally since the bridge already multiplexes by `sender`.
bc7b82 Claude (MCP) 2026-03-16 04:43:54
[mcp] Recreate Agent IRC Architecture design doc (lost during wiki dev work)
301
302
## Open questions
303
88448e Claude (MCP) 2026-03-16 17:45:47
[mcp] Comprehensive update: research findings, wiki shared state, git strategy, polling, PM delegate, resolved open questions
304
- **ergo `maxline` default.** Verify the actual default and maximum configurable value. Agent plan summaries could be multi-KB.
305
- **SDK `query()` API stability.** The session resume API (`resume` option) needs verification against current SDK version. Field names may have changed.
bc7b82 Claude (MCP) 2026-03-16 04:43:54
[mcp] Recreate Agent IRC Architecture design doc (lost during wiki dev work)
306
307
## Resolved questions
308
88448e Claude (MCP) 2026-03-16 17:45:47
[mcp] Comprehensive update: research findings, wiki shared state, git strategy, polling, PM delegate, resolved open questions
309
- **Structured vs. conversational task format.** Conversational wins. The whole point of using IRC is human observability. The only structured convention is a `TASK:` prefix on assignments.
310
- **CLI vs. SDK.** SDK. The CLI's terminal processing is overhead for daemon use.
311
- **Single process vs. separate bridge and supervisor.** Separate. Independent failure domains.
312
- **Launch-per-task vs. long-running agents.** Long-running. Preserves context across related tasks.
313
- **Deployment topology.** ergo in LXC on Proxmox, bridge + supervisor in docker-compose on desktop (128GB RAM).
314
- **Polling strategy.** Two-layer: supervisor push for immediate dispatch, flat 30s polling as fallback/health check. Backoff deferred.
315
- **Git branch strategy.** Supervisor-managed worktrees, branch-per-task, human merges, protected main.
316
- **Context monitoring.** Supervisor accumulates `usage.input_tokens` per turn from SDK responses. No built-in SDK metric.
317
- **Durable state.** robot.wtf project wiki via MCP. IRC is ephemeral conversation, wiki is the record. EM recovery reads wiki, not IRC history.
318
- **Mobile IRC client.** Deferred. PM uses terminal for MVP. Future path: Claude.ai as PM delegate via remote MCP, bypassing the mobile client problem entirely.