MCPcopy Index your code
hub / github.com/chaitanyagiri/munder-difflin

github.com/chaitanyagiri/munder-difflin @v0.3.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.3.3 ↗ · + Follow
1,730 symbols 4,169 edges 175 files 390 documented · 23%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Munder Difflin Inc — Multi-Agent Harness

Munder Difflin

Local multi-agent harness for the terminal coding CLIs you already runClaude Code, Antigravity (Gemini), OpenAI Codex, OpenCode, Crush, pi.dev, and GitHub Copilot CLI — with bring-your-own keys and local LLMs. Autonomous agents that message, route, and remember — coordinated by a GOD orchestrator you talk to, and visualized as avatars at work on a shared office floor.

Electron · React · TypeScript · Pixi.js · xterm.js · node-pty

License: MIT Version: 0.3.3 Status: prototype Platform: macOS | Windows | Linux PRs welcome

Munder Difflin — A hive of agents that message, route, and remember

▶ Watch the floor — Munder Difflin running a hive of Claude Code agents

[!NOTE] The world's best agents. The world's worst paper company. Munder Difflin takes the terminal-agent CLIs you already run — claude, agy, codex, opencode, crush, pi, and copilot — and turns them into a self-coordinating team: each agent gets long-term memory, a mailbox, and a desk on a 2D office floor — and a GOD orchestrator agent routes work between them while you watch.

Contents

What it is

Munder Difflin is a desktop app that wraps real terminal-agent CLIs as fully-capable agents, wires them into a hive mind, and puts a GOD orchestration agent in charge — the one agent you talk to in order to get things done. Under the hood it runs the fastest memory layer in the world so every agent remembers what it learns and recalls it instantly.

  • Every terminal is an agent. Each claude, agy, codex, opencode, crush, pi, copilot, or custom session runs as a real process in a pseudo-terminal (node-pty), byte-for-byte authentic, rendered with xterm.js.
  • Every agent is an avatar. Sessions appear as characters on a Pixi.js office floor — they walk to stations as they work, and envelopes fly desk-to-desk when they message each other.
  • The hive coordinates them. Agents read their memory and drain a mailbox; the router moves messages between inboxes; the GOD agent adjudicates, assigns, and escalates only when it needs you.
  • Memory that's instant. A markdown-first memory layer with a semantic recall index means agents remember across sessions and recall in milliseconds.

How it works

            you ── talk to ──►  ┌─────────────┐
                                │  GOD agent  │  orchestrator / supervisor
                                │ (Michael's  │  roster · routing · adjudication
                                │   office)   │  blackboard · task ledger
                                └──────┬──────┘
                                       │ assigns · routes · escalates
              ┌────────────────────────┼────────────────────────┐
              ▼                         ▼                         ▼
        ┌───────────┐            ┌───────────┐            ┌───────────┐
        │  agent A  │  message   │  agent B  │  message   │  agent C  │
        │ provider  │ ─────────► │ provider  │ ─────────► │ provider  │
        │  + memory │            │  + memory │            │  + memory │
        └───────────┘            └───────────┘            └───────────┘
              └──────── shared hive: memory · mailbox · blackboard · log ───────┘
  1. You spawn agents — each is a normal terminal process (claude, agy, codex, or custom) with its own working directory, identity, and provider-specific lifecycle.
  2. Agents collaborate through the hive — a local git repo of plain files. They write to their own outbox/; the harness's router delivers into recipients' inbox/. No agent ever touches git (single-committer design avoids index.lock corruption).
  3. The GOD agent runs the floor — it reads every request, resolves routine ones itself (keeping the system fully autonomous), and only escalates critical items (spend, destructive ops, scope changes) into an approvals queue you act on.
  4. Everything is visible — you watch avatars move, envelopes fly, and the live terminal stream; you can type back into any session, browse its files, and read its git history.

See HIVE.md for the full multi-agent design, SPEC.md for the terminal/event plane, and DESIGN.md for the visual system.

Features

Area What works today
Real terminals Spawn Claude Code, Antigravity (agy / Gemini), OpenAI Codex, or a custom command in a node-pty PTY. Full read/write/resize/kill, live streaming over IPC, multi-agent.
Built-in Monaco IDE (new in v0.3.3) A title-bar IDE button opens a full-window Monaco editor (the VS Code editor engine, self-hosted — no CDN) over the floor: git CHANGES rail with side-by-side diffs vs HEAD, workspace file tree, editor tabs with dirty-state tracking, Cmd/Ctrl+S save. All fs/git access is brokered through the main process.
Multi-provider hive Claude Code, Antigravity, and Codex workers can all participate in the same hive. Claude uses native hooks; Antigravity gets a native agy-hook bridge; Codex receives the protocol as its initial prompt and participates through inbox/outbox routing.
The hive On-disk multi-agent layer: per-agent identity + long-term memory, atomic-file mailboxes, a shared blackboard, append-only event log, single-committer git.
GOD orchestrator An always-on supervisor agent that adjudicates traffic, routes tasks, scribes the blackboard, and escalates only critical items to you.
Memory layer Markdown-first long-term memory per agent, mined into a shared semantic palace for instant recall; searchable from the UI. Degrades gracefully when the index isn't installed.
Office floor Pixi.js scene with a Tiled office map, camera, recolored cast, pathfinding, seat assignment, and tool-bubble overlays.
Message handoffs When the hive routes a message, an envelope flies from sender to recipient (tinted by speech-act; escalations fly to the door) and pops an arrival sparkle.
Per-agent panel Live terminal, command bar to type back, fullscreen terminal, sandboxed file browser + CodeMirror editor, and a git tab (status, log, commit graph, branches).
Approvals & memory panels Human-in-the-loop approval queue for escalations; a memory search panel over the shared palace.
Onboarding wizard First-run setup: harness home, registered repos, default command, auto-mode.
Design system Fully tokenized SNES / Animal-Crossing aesthetic — pixel panels, buttons, badges, hand-drawn icons. See DESIGN.md.
Command Center Michael's control surface: Terminal, Floor (roster + dispatch + per-agent model selector + live fleet monitoring), Memory (MemPalace + text search + memory graph), Activity (log + board + real token telemetry + observability + CI watcher), Tasks (kanban board with dependencies + status tracking), and a dedicated Schedules tab (recurring missions + adaptive heartbeat).
Talk to Michael (Realtime Michael) A low-latency voice channel to the GOD orchestrator (OpenAI Realtime API over WebRTC), alongside the async terminal. Press Talk and Michael listens, answers, and acts in real time — reads the hive and, behind spoken echo-back confirmation for destructive verbs, creates/assigns tasks, dispatches, spawns/kills workers, and steers the floor (attributed to a distinct michael-voice actor). He greets you on connect, speaks task completions the moment they land ("respond when done"), and runs under a live cost meter with a hard spend cap + idle auto-disconnect. BYOK OpenAI key — decrypted main-only, minted into short-lived ephemeral session tokens, never read back to the renderer.
Per-agent git worktrees 'Git isolation' toggle in Add Agent auto-provisions a dedicated worktree per agent on spawn and tears it down on kill — agents never collide on branches.
Token & cost telemetry Activity tab reads ~/.claude/projects/ JSONL transcripts and surfaces real token counts + estimated USD cost per agent per session, backed by a durable cost ledger that survives restarts.
Per-agent token budgets Set a token budget per agent and watch live fleet monitoring track consumption across the whole roster — paired with the cost/runaway circuit breaker to keep spend in check.
Observability Live OpenTelemetry collector with per-model cost attribution, a fleet grid, and a per-agent tool-span waterfall — see exactly what every agent is doing and what it costs, in real time.
Context-window gauge Each agent card's progress bar is a context-window gauge — see how much of the model's context each agent has consumed at a glance.
Circuit breaker A cost/runaway guard with a steer → constrain → stop ladder: the breaker nudges, then constrains, then stops agents that loop, storm errors, or blow their budget.
HITL gate & mid-run control Human-in-the-loop gate, mid-run steer, and graceful stop — all driven through Claude Code hook returns, so you can intervene without killing the session.
Durable persistence SQLite-backed durable store keeps window bounds + history across restarts, alongside the durable cost ledger and persisted session IDs.
MemoryReflector Memory condensation that summarizes and bounds per-agent memory over time, so long-term memory doesn't grow without limit.
Configurable home folder Point the hive/memory home at any folder, with a safe move that relocates existing state without losing it.
Restore team One-click "Restore team" rebuilds last session's workers after a harness restart — no more re-adding agents by hand.
Selectable agent engines Each agent — and Michael himself — runs on a pluggable engine: Claude Code, Antigravity, OpenAI Codex, OpenCode, Crush, pi.dev, GitHub Copilot CLI (new in v0.3.3 — community-contributed, print-mode copilot -p with model picker and --resume), or a local provider (a claw/qwen backend proxy). Choose the engine per hire from a visual provider/hive picker; the orchestrator's own engine is swappable from onboarding or a change-engine flow. BYOK keys + local-LLM endpoints for the CLI engines live in Settings → AI Engines.
BYOK keys + local LLMs Settings → AI Engines collects per-provider API keys (Anthropic / OpenAI / Google / OpenRouter / Groq) stored write-only in the encrypted secret broker — never read back into the renderer, materialized main-only at spawn — plus per-engine local base-URLs (Ollama / LM Studio / vLLM) and default-model fields. The OpenCode / Crush / pi.dev engines pick these up at spawn.
OSS-model quick-picks Hiring a worker on a local-capable engine (OpenCode / Crush / pi.dev) surfaces curated open-source model quick-picks — a Local bucket (Mac-runnable Ollama tags: gpt-oss 20B/120B, Qwen3, DeepSeek-R1, Mistral Small, Llama 3.3 70B …) and a third-party OSS provider bucket (BYOK via Groq / OpenRouter) — that fill the engine-correct slug (local/<tag> for OpenCode, ollama/<tag> for Crush/pi) and rebuild the spawn command. Two how-to guides — run on open models and run on a Mac Mini — are linked inline.
Provider-agnostic idle backstop A PTY-quiescence fallback flips any silent-but-pinned-working agent back to idle, so the idle inbox-wake nudge always drains a non-Claude orchestrator even if a bridge's turn-end signal (Stop / session.idle / agent_end) never fires — the safety net under shipping every new engine as god-eligible.
Self-healing engine install When a chosen engine's CLI binary is missing, the harness runs its installer in the terminal, then auto restart-and-continues into the freshly-installed binary in place — no dead-end, no manual click, idempotent so the installer never fires twice.
Per-hire skills + MCP catalog Every hire carries a manifest of allowed skills + MCP servers (default-deny over a shared catalog). Bundled skills ship with the app, and a consent UI surfaces every skill/MCP a hi

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Function 960
Method 420
Interface 292
Class 58

Languages

TypeScript99%
Python1%

Modules by API surface

src/main/index.ts83 symbols
src/main/hive.ts82 symbols
src/renderer/src/scene/office/OfficeFloor.tsx65 symbols
src/renderer/src/scene/office/Character.ts59 symbols
src/main/realtimeActions.ts51 symbols
src/renderer/src/scene/office/portraitArt.ts41 symbols
src/preload/index.ts40 symbols
src/main/telemetry.ts40 symbols
src/main/realtimeCompletionWatcher.ts38 symbols
src/main/slack.ts34 symbols
src/renderer/src/components/CommandCenterPanel.tsx28 symbols
src/renderer/src/scene/office/TiledMapRenderer.ts27 symbols

For agents

$ claude mcp add munder-difflin \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page