patchfeld

A Textual TUI that turns N parallel Claude Code sessions into one orchestrator-managed workspace — and lets the agent reshape the UI to fit the work.

$ pip install patchfeld copied
View on GitHub

Python 3.11+ · MIT · a studio for orchestrating agents

/* why use it */

One window. One orchestrator.
Many agents under your supervision.

Three Claude Code sessions across three terminal tabs is fine — until you're the one mentally juggling which is waiting on what. Patchfeld is a studio for orchestrating agents.

Run several Claude sessions side by side

The orchestrator spawns children with their own prompts, allowed tools, and cwd. Each gets a transcript you can scroll, a state machine you can introspect, and a direct-message input box when you want to bypass the orchestrator.

Talk to the UI like you talk to the agent

“Open a diff viewer for the last edit”, “give me a 3-pane layout with file tree on the left”, “save that as review” — all of it routes through orchestrator tools and persists.

Structured introspection, not screen scraping

Reads transcripts, sends messages, interrupts, kills — all via in-process MCP tools layered on the Claude Agent SDK. No PTY parsing. No fragile regex.

Persistent everything

Workspaces (per-cwd), layouts, themes, keybindings, transcripts, and a full agent history are stored on disk and restored on next launch. Atomic writes, append-only JSONL.

Real escape hatches

A Terminal widget is a real PTY — drop into the actual claude CLI, or your shell, in any panel. Mode-C custom widgets let the orchestrator ship Python at runtime when the curated library isn't enough.

One shared StatusBar of truth

Tokens, cost, and active children roll up across every running session. One window, one budget — refactor + tests + review without juggling tabs.

/* what it looks like */

Patchfeld, running.

Orchestrator chat on the left. Agent table and cross-agent activity feed on the right. StatusBar tracks tokens, cost, and active children across every session.

patchfeld — ~/Developer/patchfeld
patchfeld TUI: orchestrator chat on the left, agent table and activity feed on the right

/* it's conversational */

Each of these is one message.

The orchestrator owns the spec; you own the ideas. Every command below routes through a structured tool call — spawn_agent, set_layout, save_layout, bind_key — applied atomically with rollback on failure.

>

Spawn three agents in parallel: tests running pytest -x --ff, lint running ruff + pyright, format running ruff format. Notify me when any of them fail.

spawn_agent × 3 · child rows in AgentTable · roll-up totals to StatusBar

>

Open a Review tab: orchestrator on top at 40%, below it a FileTree (30%) next to a DiffViewer (70%) showing the staged diff. Save it as review.

add_tab · set_layout · save_layout — applies atomically, rolls back on failure

>

Build a custom TokenChart widget that draws my token usage over the last hour as a sparkline, and put it as a 25% sidebar on the right.

set_layout with custom_widgets — Python source ships at runtime, isolated namespace

[migrator → orchestrator] (asking) Should I bump min Python to 3.11 or stay on 3.10?

Children get notify_orchestrator and ask_orchestrator injected automatically. A migration agent can stop and ask — you answer through the orchestrator and the reply becomes the tool result on the child's side. No modal. No context switch.

/* built-in widgets */

A curated palette the orchestrator can place anywhere.

Splits, panels, sizes — the orchestrator emits a declarative spec and the engine swaps widgets in place. When the curated library doesn't fit, it can ship a custom Python widget at runtime in the same call.

OrchestratorChat

Rich transcript + input for the top-level Claude session.

AgentTable

Sortable list of children: name, status, elapsed, cost.

AgentTranscript

One agent's conversation, with a direct-message input.

Terminal

Real PTY — drop into the actual claude CLI or your shell.

FileEditor

Editable, syntax-highlighted; ctrl-s saves; warns on external changes.

DiffViewer

Unified-diff viewer (precomputed diff or before + after).

FileTree

Directory tree; emits FileSelected events on the bus.

SystemUsage

Compact CPU + RAM gauges with threshold-colored bars.

Plus ActivityFeed, FileViewer, LogTail, Markdown, Notebook — and any .py file you drop into ~/.config/patchfeld/widgets/.

/* install */

Three install paths. Pick one.

Patchfeld needs Python 3.11+ and the Claude CLI installed and authenticated. It uses your ~/.claude/settings.json for permissions and tool allowlists.

Recommended — isolated, on PATH.

$ pipx install patchfeld

then run: patchfeld

First launch in a directory seeds the built-in dashboard and creates .patchfeld/. Add it to your .gitignore.