{"slug": "show-hn-kapelle-terminal-chat-room-for-your-agents", "title": "Show HN: Kapelle – Terminal chat room for your agents", "summary": "Kapelle, a new open-source terminal tool published to npm by developer EdwardLiuyc, runs multiple coding agents — including pi, Claude Code, Copilot and opencode — side by side on one repository, giving each agent its own git worktree and branch. A background daemon keeps agents and their history alive after the terminal closes, and Kapelle never touches credentials because each agent logs in itself; the tool requires Node 24 or newer and Git 2.36 or newer on macOS or Linux, with Windows unsupported (npm refuses a global install with EBADPLATFORM). The project's demo shows one fix-issue loop running from issue to merged pull request, a real run that took 1 hour 42 minutes.", "body_md": "A *Kapelle* is the ensemble a *Kapellmeister* directs: the players, not the conductor. kapelle directs, and the agents play.\n\n**A terminal chatting workspace for a team of coding agents.**\n\nkapelle runs different coding agents side by side on one repository: pi, Claude Code, Copilot, opencode and more. Each agent works in its own git worktree, on its own branch. You talk to them in your terminal, answer their permission requests, and merge their work when you are ready.\n\nOne background daemon holds all the work. Close the terminal and come back later: your agents and their history are still there. Each agent logs in by itself. kapelle never touches a key.\n\n[Demo](#demo) · [Install](#install) · [Quick start](#quick-start) · [Rooms](#rooms) · [Loops](#your-first-loop) · [Runs](#runs) · [Remote daemon](#reach-a-daemon-from-another-machine) · [Agents](#agents) · [Safety](#what-the-modes-do-and-do-not-do) · [Docs](#docs)\n\n## kapelle-loop-demo.mp4\n\nOne `fix-issue` loop, from the issue to the merged PR, in 3 minutes. The real run took 1 h 42 min. The orchestrator plans the steps and adds a developer and two reviewers. You type three things: `go`, your two choices, and `merge close`.\n\nYou need Node 24 or newer, Git 2.36 or newer, and macOS or Linux. WSL counts as Linux. Windows is not supported.\n\n```\nnpm install -g kapelle\nkapelle --help\n```\n\nThe package supports macOS and Linux, so npm refuses a global install on Windows with `EBADPLATFORM`.\n\n```\ngit clone https://github.com/EdwardLiuyc/kapelle.git && cd kapelle\nnpm install\nnode cli.ts --help\n```\n\nThe checkout runs TypeScript directly and needs no build. To use the short command, add an alias:\n\n```\nalias kapelle='node /path/to/kapelle/cli.ts'\n```\n\n`npm pack` and `npm publish` run `prepack`, which builds the JavaScript package in `dist/`.\n\n1. \nInstall kapelle: `npm install -g kapelle` . See[Install](#install) .\n2. \nInstall one agent and log in to it once. pi is the default. For another agent, see [Agents](#agents) .\n\n```\nnpm i -g @earendil-works/pi-coding-agent pi-acp\npi                     # type /login, then quit\n```\n\n3. \nIn your repository, run `kapelle` . It starts its daemon in the background. Then the setup list shows each agent it finds, and whether it is ready. When an agent's ACP adapter is missing, the list can install it: press Space to tick the agent, then Enter. When you are done, press Enter with nothing ticked. Then the list stops opening at each start, once an agent is ready. Esc only closes it for now.`/setup` shows the list again.\n\n```\ncd your-repo\nkapelle\n```\n\n4. \nType `/new pi` and press Enter. The first time, kapelle asks to add your repository: pick`add and open` . The room opens, and you can type a message to pi.`/new` alone opens a form. Press Ctrl+C twice to leave. The room and its agent keep running.pi never asks for permission, so no mode can stop its changes. In a room, it works in its own git worktree, not in your checkout. Read [Safety](#what-the-modes-do-and-do-not-do) before you give it real work.\n\nTry the chat before you install an agent:\n\n```\nkapelle demo\n```\n\nIt opens a room with an offline demo agent. It needs no account, no tokens and no network. The agent answers, asks one permission question, and writes a file you can see with `@demo /diff`. The room works in its own folder, never in your checkout. Each `kapelle demo` deletes the last demo room and starts again. It is local-only: with a remote `client.json` setting it refuses, so run it on the daemon machine.\n\nFor developers: in a source checkout, check that kapelle works with no agent and no account. This uses a test agent that ships with the repository, not with the package:\n\n```\nnpm run selftest\n```\n\nYou should see `✓ allowed Write ACP_TEST.md`. Delete `ACP_TEST.md` when you are done.\n\nGive one agent one task. This needs no room and no daemon:\n\n```\nkapelle \"summarise this repo in three sentences\"\n```\n\nThe agent works in your own checkout here.\n\nOther options: `--agent <id>` picks another agent. `--cwd <dir>` works in another folder. `--mode` sets what the agent may do (see [Safety](#what-the-modes-do-and-do-not-do)). `--verbose` shows the agent's own error output. `--quiet` hides normal output, but never the safety notices.\n\nA room is a chat with a team of agents. Each agent keeps its memory across messages, and works on its own branch, `kapelle/<roomId>/<participantId>`. You decide who does what by choosing who to message.\n\nRooms live in the daemon. `kapelle` starts it, and `/new` adds your repository (see [Quick start](#quick-start)). To run, add, or stop the daemon yourself, see [Run the daemon by hand](#run-the-daemon-by-hand). With the daemon running, these commands work from the shell too:\n\n```\nkapelle chat new --agent pi         # open a room and chat in it\nkapelle chat                        # every room and chat, on a terminal\nkapelle chat list                   # every room, then every chat, as text\nkapelle chat attach <roomId>        # rejoin a room; its history replays\nkapelle chat attach @<name>         # rejoin a chat by its agent's name\nkapelle chat dismiss <roomId>       # stop the room's agents\nkapelle chat scratch [clean [--yes]] # list kept chat scratch folders; clean previews, --yes removes stale ones\nkapelle chat archive list           # every removed chat, until retention deletes it\nkapelle chat archive show <chatId>  # a removed chat's messages, read only\n```\n\n`kapelle chat new` does not add a repository for you. Add it first: `/new` in the chat, or `kapelle daemon add .`.\n\nIn a room, type a message and press Enter. It goes to the room's orchestrator, or to the only agent when the room has no orchestrator. Start it with `@name` to send it to that agent instead. In an agent's thread, the box always starts with its `@name`. `/leave` exits and keeps the agents alive. `/dismiss` stops the room's agents. `/delete` shows every branch and its unmerged commits, then asks again before removing the room. They work in any view, after an agent's `@name` too, and never reach an agent. In a room, kapelle never commits for an agent: uncommitted work stays in the agent's checkout.\n\nA chat is one agent of its own, outside every room, like a person you message. `/chat <harness>`, or \"new chat …\" in the `ctrl+o` menu, starts one from any view. With `--cwd` it works in that folder, on its own branch in a repository; without, in an empty scratch folder of its own. Every message in a chat goes to its agent, so it needs no `@name`. `@name /remove` removes the chat.\n\nOn a terminal, a sidebar lists every room and its agents, then every chat. Click a row, or press `alt+↑`/` alt+↓` (or `ctrl+p`/` ctrl+n`), to see a room's timeline or one agent's thread. A `●` means something waits for you: magenta is a question, yellow is an agent that looks stuck. `ctrl+t`, or a click on `«`, hides the sidebar.\n\nThe room API is new, and it can still change.\n\nA loop is a room whose orchestrator follows a recipe. A recipe is a Markdown file with the team and the steps. The orchestrator adds the agents, gives them the work and reads their reports. You make the choices.\n\nkapelle ships one recipe, `starter`: one agent builds a task, and a second agent reviews it. It needs no skill, no `gh` and no remote. The daemon finds recipes on its own machine. With the daemon running, this shows every recipe and the folder it comes from:\n\n```\nkapelle loop list\n```\n\nStarting a loop needs the daemon running and your repository added. Run `kapelle` once to start the daemon (see [Quick start](#quick-start)), and `kapelle daemon add .` to add the repository. Then:\n\n```\nkapelle loop starter \"add a --version flag\" --agent pi\n```\n\nThe orchestrator runs on the agent you name, and `starter` gives every worker the same one. With no `--agent`, it is `claude`. On a terminal, the chat opens on the new room. In the chat, `/loop starter \"add a --version flag\" --agent pi` does the same, and `/loop` alone opens a form. There, `/loop` asks to add the repository the first time.\n\n`starter` needs a git repository with at least one commit. Then each worker gets its own git worktree and branch. In a folder with no commit, the workers share the folder, and `rev` cannot start from `dev`'s branch, so the loop stops at the review. Both workers run in `auto` mode, so they change files without asking you. Read [Safety](#what-the-modes-do-and-do-not-do) before you give a loop real work.\n\nWhat you do during the loop:\n\n1. The orchestrator shows its plan. Type `go` .\n2. When it stops with a choice, type your answer.\n3. At the end, read the work with `@dev /diff base` . If you want it, merge`dev` 's branch with git. Its name is`kapelle/<roomId>/<participantId>` (see[Rooms](#rooms) ), and`git branch --list 'kapelle/*'` lists it.\n\nA loop spends tokens: every agent turn is a real prompt. A room limits how many orders the orchestrator sends its workers (`orchestratorTurnCap` in [`docs/CONFIG.md`](https://github.com/EdwardLiuyc/kapelle/blob/master/docs/CONFIG.md)). `/cap <n>` raises the limit for one room.\n\nTo write your own recipe, put `<name>.md` in your repository's `.kapelle/loops/`, or in `~/.config/kapelle/loops/` on the daemon's machine for every repository. A recipe there wins over a shipped one of the same name. Start from [`assets/loops/starter.md`](https://github.com/EdwardLiuyc/kapelle/blob/master/assets/loops/starter.md). The orchestrator's own rules are in [`assets/orchestrator.md`](https://github.com/EdwardLiuyc/kapelle/blob/master/assets/orchestrator.md). The video at the top runs `fix-issue`, this repository's own recipe. It uses this repository's skills, so it works only here.\n\nA run hands out N tasks at once. Each task has its own prompt, agent and mode, and each ends with a result. `tasks.json` is an example:\n\n```\n{\n  \"agent\": \"pi\",\n  \"mode\": \"safe\",\n  \"tasks\": [\n    { \"id\": \"summarise\", \"prompt\": \"Summarise what this project does in three sentences.\" },\n    { \"id\": \"look-for-bugs\", \"prompt\": \"List any obvious bugs or missing error handling you can see.\" }\n  ]\n}\nkapelle run --file tasks.json\n```\n\nIn a git repository, each task gets its own `git worktree`, on a branch named `kapelle/<runId>/<taskId>`. Keep working in your own checkout while the agents work in theirs. Your uncommitted changes do not reach the tasks, and kapelle tells you so. Outside a git repository, the tasks share the folder.\n\nWhen a task ends `done` or `warned`, kapelle commits its work on the task's branch. Look at one task's work with `git log -p kapelle/<runId>/<taskId>` before you merge.\n\nSee `schema/run.schema.json` for every field. Task ids name git branches, so kapelle checks them and never changes them.\n\nWith the daemon running (run `kapelle` once, or see [Run the daemon by hand](#run-the-daemon-by-hand)), hand the run over and follow it from any terminal:\n\n```\nkapelle run --file tasks.json --detach   # prints the run id\nkapelle ps                               # every run and each task's status\nkapelle attach <runId>                   # watch it, and answer its `ask` prompts\nkapelle attach <runId> --task <taskId>   # watch one task in full\n```\n\nkapelle rings the bell and sends a desktop notification when a run needs you.\n\nWhen [`client.json`](https://github.com/EdwardLiuyc/kapelle/blob/master/docs/CONFIG.md#client-file--xdg_config_homekapelleclientjson)\nreaches a daemon on another machine through an\n[SSH tunnel](#reach-a-daemon-from-another-machine) at a local `127.0.0.1`\nport, run files must use `--detach`. A folder is then a folder on\nthat daemon's machine: `--cwd app` means the daemon user's `~/app`, and no\n`--cwd` means that home.\n\n```\nkapelle merge <runId> --squash\n```\n\nThis puts the changes of all tasks into your working tree, unstaged. It makes no commit. It refuses when two tasks change the same file, or when your own changes touch a file a task changed.\n\nWorktrees and records live in `~/.local/state/kapelle/`. Nothing goes into your repository.\n\n```\nkapelle workspace                      # print where this repository's work lives\nkapelle workspace move <old> <new>     # after you move or rename the repository\n```\n\nUse `workspace move`, not a plain `mv`. A plain `mv` breaks git's link to each worktree.\n\n`kapelle` starts the daemon in the background when none runs. To run it yourself, for example to see its output:\n\n```\nkapelle daemon start     # runs in this terminal until Ctrl-C\nkapelle daemon add .     # in another terminal, in your repository\nkapelle daemon person add alice\nkapelle daemon key add alice --label laptop\nkapelle daemon key list\nkapelle daemon key cancel <key-id>\nkapelle daemon stop      # stop the daemon, also one that kapelle started\n```\n\nThe supported remote setup is an SSH tunnel. The daemon stays on the server's loopback address, and SSH carries the HTTP connection and logs in to the server. Do not expose the daemon port directly.\n\nUse this with people you trust to read and change the daemon user's files. Agents run as that user and the tunnel does not sandbox them; see [`SECURITY.md`](https://github.com/EdwardLiuyc/kapelle/blob/master/SECURITY.md).\n\nOn the server, install kapelle and an agent as in [Quick start](#quick-start), log the agent in, and keep one fixed nonzero port. Use the same kapelle version on both machines; the client refuses a different API major and warns on a different minor ([version rules](https://github.com/EdwardLiuyc/kapelle/blob/master/docs/CLIENT-API.md#versions-and-stability)). This example uses 4719, the default:\n\n```\nkapelle daemon start --port 4719\n```\n\nLeave that terminal open. In another terminal on the server, create a person and one key for the laptop:\n\n```\nkapelle daemon person add <person>\nkapelle daemon key add <person> --label laptop\n```\n\nThe `key:` line prints once. Copy it now.\n\nOn the laptop, create the [client file](https://github.com/EdwardLiuyc/kapelle/blob/master/docs/CONFIG.md#client-file--xdg_config_homekapelleclientjson). This example follows its path rule:\n\n```\nconfig=\"$HOME/.config/kapelle/client.json\"\ncase \"${XDG_CONFIG_HOME:-}\" in\n  /*) config=\"$XDG_CONFIG_HOME/kapelle/client.json\" ;;\nesac\nmkdir -p \"$(dirname \"$config\")\"\n(umask 077; ${EDITOR:-vi} \"$config\")\nchmod 600 \"$config\"\n```\n\nPut this in the file, replacing the key value with the one from the server:\n\n```\n{\n  \"daemonAddress\": \"http://127.0.0.1:4719\",\n  \"accessKey\": \"<key printed by kapelle daemon key add>\"\n}\n```\n\nKeep the daemon on one fixed port. The laptop's `daemonAddress` names the local tunnel port. The two ends of `-L` may differ: `-L <local-port>:127.0.0.1:<daemon-port>`. The example below uses 4719 on both. Start the tunnel on the laptop and leave it open:\n\n```\nssh -N \\\n  -o ExitOnForwardFailure=yes \\\n  -o ServerAliveInterval=30 \\\n  -L 4719:127.0.0.1:4719 \\\n  <user>@<server>\n```\n\nIf the laptop already uses 4719, keep the daemon on 4719 and use a free local port, for example `-L 4720:127.0.0.1:4719`. Then set `daemonAddress` to `http://127.0.0.1:4720`.\n\nA daemon inside WSL2 usually has no reachable `sshd`. Windows localhost forwarding may make a WSL listener available on Windows localhost, but it does not make that daemon reachable from another machine. If WSL can reach an SSH server on the laptop, run the tunnel in the other direction from inside WSL:\n\n```\nssh -N \\\n  -o ExitOnForwardFailure=yes \\\n  -o ServerAliveInterval=30 \\\n  -R 127.0.0.1:4720:127.0.0.1:4719 \\\n  <laptop-user>@<laptop>\n```\n\nThe explicit loopback bind makes the reverse tunnel listen on the laptop at `127.0.0.1:4720` and reach the daemon's `127.0.0.1:4719` inside WSL; use `http://127.0.0.1:4720` as `daemonAddress`. The measured M11-7 run used this reverse tunnel; see the [M11-7 measurement](https://github.com/EdwardLiuyc/kapelle/blob/master/docs/FINDINGS.md#m11-7--ssh-tunnel--measured-2026-11-30-481).\n\nWith the tunnel open, check the connection and add a repository that exists on the server:\n\n```\nkapelle chat list\nkapelle daemon add '~/src/<repo>'\n```\n\nThe quoted folder is resolved on the daemon's machine; see the [client file rules](https://github.com/EdwardLiuyc/kapelle/blob/master/docs/CONFIG.md#client-file--xdg_config_homekapelleclientjson). Open a room and send the agent a message:\n\n```\nkapelle chat new --agent pi --cwd '~/src/<repo>'\n```\n\nType a message in the room, wait for pi's reply, then type `/leave`. The room and agent remain alive. List the rooms and reattach by id:\n\n```\nkapelle chat list\nkapelle chat attach <roomId>\n```\n\nFrom the laptop, `kapelle room` can also name the room explicitly:\n\n```\nkapelle room info --room <roomId>\nkapelle room diff pi --room <roomId>\n```\n\n`kapelle merge` and `kapelle workspace` read the repository on disk, so run them from a shell on the server. `/term` stays on the laptop; it is not a shell on the server.\n\nTo revoke the laptop, cancel its key on the server:\n\n```\nkapelle daemon key cancel <key-id>\n```\n\nPick one with `--agent <id>`. Each agent logs in by itself.\n\n| `--agent` | Install | Tested here | \n|---|---|---|\n| `pi` (default) | `npm i -g @earendil-works/pi-coding-agent pi-acp` | yes | \n| `claude` | `npm i -g @agentclientprotocol/claude-agent-acp` , then`claude auth login` | yes | \n| `copilot` | the Copilot CLI ( `copilot --acp` ) | yes | \n| `opencode` | `npm i -g opencode-ai` , then`opencode auth login` | yes | \n| `codex` | the Codex CLI, then `npm i -g @agentclientprotocol/codex-acp` and`codex login` | yes | \n| `kimi` | the Kimi Code CLI ( `kimi acp` ), then`kimi login` | yes | \n\nAny other ACP agent works too: `--cmd \"some-agent --acp\"`.\n\n**Claude Code** has no ACP mode of its own, so it needs the adapter above. If you see `spawn claude-agent-acp ENOENT`, the adapter is not on your `PATH`. Check with `command -v claude-agent-acp`. You can run kapelle from inside a Claude Code session. No `env -u` is needed.\n\n| Mode | What it does | \n|---|---|\n| `safe` | Allows reads. Refuses every change the agent asks about. | \n| `ask` | Allows reads. Asks you about each change. A run in your terminal needs the terminal: without one, kapelle uses `safe` and prints a notice. A room, or a run started with`--detach` , asks through the daemon instead: the question waits for your answer, and is refused at the time limit. | \n| `auto` | Allows everything. A file request for a path outside the workspace is still refused. | \n\n**A mode is a filter, not a sandbox.** It decides the answer when an agent asks for permission. An agent that changes files through its own shell does not ask. pi never asks. opencode asks only for a write outside the workspace. So `safe` does not stop them.\n\nkapelle always refuses a file request for a path outside the workspace, in every mode. But this covers only file requests that go through kapelle. An agent can still write the file itself: opencode 2.0.18 did, after kapelle refused its request (#308).\n\nWhat each agent was measured to do is in [`docs/FINDINGS.md`](https://github.com/EdwardLiuyc/kapelle/blob/master/docs/FINDINGS.md).\n\nThree optional JSON files and `KAPELLE_*` environment variables:\n\n- `~/.config/kapelle/config.json` : the daemon's`port` and permission timeout.\n- `~/.config/kapelle/client.json` : a remote daemon's address and access key, for the client only.\n- `.kapelle/config.json` in your repository: stall limits, time limits, how many tasks run at once, and how long records are kept. This is the only file kapelle reads from your repository. Type`/config` in the chat to see every value and change it, or write the file by hand.\n\nEvery key, its range and its order of precedence: [`docs/CONFIG.md`](https://github.com/EdwardLiuyc/kapelle/blob/master/docs/CONFIG.md).\n\n- [`docs/CONFIG.md`](https://github.com/EdwardLiuyc/kapelle/blob/master/docs/CONFIG.md) : every config key.\n- [`docs/CLIENT-API.md`](https://github.com/EdwardLiuyc/kapelle/blob/master/docs/CLIENT-API.md) : the daemon's HTTP API, to write your own client.\n- [`docs/FINDINGS.md`](https://github.com/EdwardLiuyc/kapelle/blob/master/docs/FINDINGS.md) : what each agent was measured to do.\n- [`docs/PROJECT-BRIEF.md`](https://github.com/EdwardLiuyc/kapelle/blob/master/docs/PROJECT-BRIEF.md) : why this project exists.\n\nRead [`AGENTS.md`](https://github.com/EdwardLiuyc/kapelle/blob/master/AGENTS.md) first. It has the commands, the file map and the rules. This applies to people and to coding agents.\n\n```\nnpm run check && npm run fmt:check && npm run test && npm run knip\n```\n\n[MIT](https://github.com/EdwardLiuyc/kapelle/blob/master/LICENSE) © Yongchuan Liu", "url": "https://wpnews.pro/news/show-hn-kapelle-terminal-chat-room-for-your-agents", "canonical_source": "https://github.com/EdwardLiuyc/kapelle", "published_at": "2026-12-05 21:36:27+00:00", "updated_at": "2026-12-05 21:46:23.193577+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "ai-tools"], "entities": ["Kapelle", "EdwardLiuyc", "pi", "Claude Code", "Copilot", "opencode", "npm", "Git"], "also_reported_by": [], "takeaway": "Kapelle isolates each coding agent in its own git worktree and branch under a persistent background daemon, so multiple agents can work one repository concurrently and their work is merged only when the user approves.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/show-hn-kapelle-terminal-chat-room-for-your-agents", "markdown": "https://wpnews.pro/news/show-hn-kapelle-terminal-chat-room-for-your-agents.md", "text": "https://wpnews.pro/news/show-hn-kapelle-terminal-chat-room-for-your-agents.txt", "jsonld": "https://wpnews.pro/news/show-hn-kapelle-terminal-chat-room-for-your-agents.jsonld"}}