[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-107668":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":14,"stars7d":14,"stars30d":15,"stars90d":14,"forks30d":14,"starsTrendScore":14,"compositeScore":16,"rankGlobal":9,"rankLanguage":9,"license":17,"archived":18,"fork":18,"defaultBranch":19,"hasWiki":18,"hasPages":18,"topics":20,"createdAt":9,"pushedAt":29,"updatedAt":30,"readmeContent":31,"aiSummary":32,"trendingCount":14,"starSnapshotCount":14,"syncStatus":13,"lastSyncTime":33,"discoverSource":34},107668,"chord-cli","Cedr1cSun\u002Fchord-cli","Cedr1cSun","Run coding agents as a cluster: one repository, N agents, one worktree each",null,"TypeScript",62,1,2,0,9,41.8,"MIT License",false,"main",[21,22,23,24,25,26,27,28],"ai-agents","claude-code","cli","codex","coding-agents","developer-tools","git-worktree","multi-agent","2026-10-30 14:45:35","2026-11-22 09:43:46","# chord\n\n**Run coding agents as a cluster.**\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fchord-cli\">\u003Cimg alt=\"npm version\" src=\"https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002Fchord-cli?logo=npm&logoColor=white\">\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fchord-cli\">\u003Cimg alt=\"npm downloads per month\" src=\"https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fdm\u002Fchord-cli\">\u003C\u002Fa>\n  \u003Ca href=\"LICENSE\">\u003Cimg alt=\"MIT licence\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicence-MIT-blue\">\u003C\u002Fa>\n  \u003Cimg alt=\"Node 24 or later\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fnode-%E2%89%A5%2024-339933?logo=nodedotjs&logoColor=white\">\n  \u003Cimg alt=\"Windows, macOS and Linux\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fplatform-Windows%20%7C%20macOS%20%7C%20Linux-blue\">\n  \u003Ca href=\"README-zh-CN.md\">\u003Cimg alt=\"中文说明\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FREADME-%E4%B8%AD%E6%96%87-2F7CF6\">\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fwww.bilibili.com\u002Fvideo\u002FBV1Cns96REZ2\u002F\">\u003Cimg alt=\"Video on Bilibili\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fvideo-Bilibili-00A1D6?logo=bilibili&logoColor=white\">\u003C\u002Fa>\n\u003C\u002Fp>\n\nOne repository, as many agents as you care to start. Each agent works in its own worktree; a shared board records who holds which file; an agent that wants a file another agent holds asks first and waits for the answer; when the work is committed, one call rebases the branch and fast-forwards main. Idle agents are woken the moment a message arrives, so the agents negotiate among themselves while you keep handing out work in plain language.\n\n\u003Cp align=\"center\">\n  \u003Cpicture>\n    \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"docs\u002Fdemo-dark.svg\">\n    \u003Cimg alt=\"Two agents in their own terminals claim files, settle one shared file over messages and finish into main, while chord ls shows their status\" src=\"docs\u002Fdemo-light.svg\" width=\"100%\">\n  \u003C\u002Fpicture>\n\u003C\u002Fp>\n\n## ✨ Highlights\n\n- One repository, N agents, one worktree each: parallel work without stepping on each other\n- A file-level claims board: register before editing, talk to the holder first, and a hook turns away any write that was never claimed\n- Asynchronous messaging between agents: idle ones are woken, busy ones hear at their next tool call\n- `finish` in one step: rebase, fast-forward main, release the claims, tell the others; on a conflict nothing changes and the agent is told to rebase, resolve it and finish again, asking you only if it cannot\n- Agents learn the rules from chord itself, at start-up and on every prompt; you give tasks, not instructions about chord\n- Agent-agnostic by design: adding a tool means one launch recipe, not a new coordinator\n- `chord ls` for the whole picture, `messages` and `events` to replay what happened, `stop` and `clean` to wind down\n\n## 📊 Benchmark\n\nOn [CooperBench](https:\u002F\u002Fgithub.com\u002Fcooperbench\u002FCooperBench) two agents each take one feature in the same repository, and a pair passes when the merged result passes the tests of both features.\n\n| chord vs | gpt-6.1-sol | gpt-6-luna |\n|---|---|---|\n| solo (one agent, both features) | 76% vs 74% | 63% vs 51% |\n| coop + git (messages and a shared git remote) | 76% vs 73% | 63% vs 47% |\n| team (a lead hands out the work) | 76% vs 69% | **63% vs 34%** |\n| coop (messages only) | 76% vs 11% | 63% vs 11% |\n\nOn the stronger model chord keeps pace with the best baselines. On the weaker one it is the only two-agent setup that does not fall below a single agent, and it beats the team setting by 20 points. chord's agents got only the feature text, while the coop + git and team prompts spell out how to split and merge the work.\n\n## 🤖 Supported agents\n\n| agent | status |\n|---|---|\n| Claude Code | supported |\n| Codex CLI | supported |\n| OpenCode | supported |\n| pi | supported |\n| Gemini CLI | planned |\n| Cursor CLI | planned |\n| GitHub Copilot CLI | planned |\n| Qwen Code | planned |\n| DeepSeek Harness | planned |\n\nA new agent needs three things from its tool: a way to inject hooks and an MCP server at launch, the names and payloads of its hook events, and an idle\u002Fbusy signal.\n\n## 🧩 How it works\n\n\u003Cp align=\"center\">\n  \u003Cpicture>\n    \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"docs\u002Farchitecture-dark.svg\">\n    \u003Cimg alt=\"you hand tasks to a cluster of agents, one worktree each; the agents share a board of claims and messages and finish into main\" src=\"docs\u002Farchitecture-light.svg\" width=\"100%\">\n  \u003C\u002Fpicture>\n\u003C\u002Fp>\n\n1. **Isolation.** Every agent works on its own branch in its own worktree. The main checkout changes through `finish` alone.\n2. **Coordination.** A shared board holds claims, messages and events. Agents register, claim and talk through tools chord gives them; hooks check claims before each write and hand new messages to the agent as it works.\n3. **Merging.** `finish` rebases the branch onto main and fast-forwards. A clean rebase that passes the project's test command merges; on a conflict nothing moves, and the agent resolves it and finishes again.\n\n## 📦 Install\n\nWith Node 24 and git on the machine:\n\n```\nnpm install -g chord-cli\n```\n\nOn Linux add `--allow-scripts=node-pty`, with python3, make and g++ present: node-pty ships no Linux binary and builds one on install. macOS needs nothing more: node-pty ships a binary for it.\n\nOr from source:\n\n```\ngit clone https:\u002F\u002Fgithub.com\u002FCedr1cSun\u002Fchord-cli && cd chord-cli\nnpm install && npm link\n```\n\n## 🚀 Quick start\n\nA project is a folder with the repository in a child directory:\n\n```\nmy-project\u002F\n  my-repo\u002F        the main checkout\n  chord\u002F          chord's own files, outside the repository\n```\n\nIn the project folder, one terminal per agent:\n\n```\nchord claude                                     # start an agent\nchord codex --name api                           # start another, named\nchord opencode --name web                        # any mix of tools\nchord pi --name docs\nchord claude \"fix the flaky test in tests\u002Fauth\"  # arguments after the tool name go to the tool\n```\n\nHand out tasks in those terminals as you always would. From another terminal:\n\n```\nchord ls                 # agents, what they are on, unread messages, branch state, file claims\nchord messages api       # what an agent has said and been told\nchord events             # claims, releases, merges, conflicts\nchord stop api           # let it finish its turn, then quit\nchord clean              # remove the workspaces and branches of agents that have left\n```\n\n`--name` fixes an agent's name, workspace and branch, so launching the same name later returns to the same worktree. `chord resume \u003Cagent>` does that and also reopens the agent's own conversation, for Claude, Codex, OpenCode and pi alike. Run chord in a repository root and it offers to move the repository into a child directory first.\n\nAgents start in the project folder, the same directory you run plain `claude`, `codex`, `opencode` or `pi` in, so that stays their project too: one `\u002Fresume` list, one CLAUDE.md, one trust answer. Each agent edits only its own worktree under `chord\u002Fagents\u002F\u003Cname>\u002F`; chord refuses edits (editor tools, apply_patch) to the main checkout and to other agents' worktrees, and tells the agent off after a shell command that ran there.\n\n## 🧰 Commands\n\n| command | what it does |\n|---|---|\n| `chord \u003Cagent> [--name x] [tool args...]` | start an agent: `claude`, `codex`, `opencode` or `pi` |\n| `chord resume \u003Cagent> [tool args...]` | start an agent that has left again, in its own worktree, reopening its own conversation |\n| `chord ls [--all]` | agents and claims of this project, or of every project |\n| `chord messages [agent] [-n N]` | message history |\n| `chord events [agent] [-n N]` | claim, release, merge and conflict history |\n| `chord stop \u003Cagent>` | quit an agent once its turn ends and its input box is empty |\n| `chord clean [--force] [agent...]` | remove offline agents' workspaces, worktrees and branches; work not yet on main stays unless `--force` |\n| `chord --version` | the installed version |\n\n## ⚙️ Configuration\n\n`\u003Cproject>\u002Fchord\u002Fconfig.json`:\n\n```json\n{ \"setup\": \"npm ci\", \"test\": \"npm test\" }\n```\n\n`setup` runs once in every new worktree before the agent starts, with the `CHORD_*` variables in its environment, so a fresh worktree arrives with its dependencies in place. A failed setup abandons the launch and removes the worktree.\n\n`test`, when set, runs in the agent's worktree each time `finish` has rebased the branch onto main, before main moves. If it fails nothing is merged and the agent gets the end of the output: a clean rebase can still break what another agent merged. Other agents' `finish` waits while it runs.\n\nA repository's own Claude configuration (`.claude\u002Fsettings*.json`, `.mcp.json`) reaches an agent once you have trusted that repository, or the project folder, in Claude Code yourself; the MCP servers you approved there are the ones that start.\n\n## 🔌 How chord works with your tools\n\n- **Waking an agent** means typing a short note into its terminal. chord does this only when the input box is empty, the keyboard has been quiet for a few seconds, and the terminal has echoed the note; a dialogue never receives the Enter.\n- **Trust**: agents run in the project folder, so Claude asks about it once, as it does for plain `claude`; chord writes nothing to `~\u002F.claude.json`. Codex asks you to review chord's hooks once, and again whenever their definition changes; answer \"trust all\". chord says so at launch if a hook has been switched off. OpenCode asks nothing: chord hands it the plugin and the MCP server through `OPENCODE_CONFIG_CONTENT`, so a configuration of your own set in that variable is not read while an agent runs; your global config, `OPENCODE_CONFIG_DIR` and the project's `opencode.json` are. pi asks nothing either: chord loads its extension with `-e` and the extension registers the MCP server for that session, so `~\u002F.pi` is not written to.\n- **Branches and worktrees.** Each agent adds a `chord\u002F\u003Cname>` branch and a worktree; `chord clean` removes them when the agent has left and keeps anything not yet on main.\n- **Permissions.** chord's own tools are pre-approved for Claude, so an agent working on its own is never parked at a prompt for them; your usual shell and edit approvals apply as before. Codex keeps the sandbox and approval mode from your own configuration. On Windows chord refuses a sandbox given on the command line, because that sandbox cannot run the hooks; on Linux and macOS the hooks run inside the sandbox, but Codex then asks you to approve each chord tool call. OpenCode runs chord's tools without asking, as it does any MCP tool, and keeps your own permission rules for everything else. So does pi; its `--no-mcp` is refused, because chord's tools would go with it.\n- **The terminal title** reads `chord \u003Cagent> · \u003Ctask>`, so each window says which agent it is.\n- **Hooks gate the editor tools.** Files changed from the shell are reported by name after each command, with the claim to make.\n\n## 🗺️ Scope\n\n- Runs on Windows 11, macOS and Linux.\n- One repository per project.\n- Project paths up to about 190 characters.\n- A repository with CRLF files and a `* text` attribute that was never renormalised shows phantom changes in every worktree; chord names the files and the command that puts the repository right.\n\n## 🧪 Testing\n\n`npm test` runs the unit tests against real git repositories in temporary folders. The coordination itself has been exercised end to end with the real tools, from two agents negotiating over one file to twenty agents merging into one main, and on open-source repositories in Python, Rust and JavaScript.\n\n## 📄 Licence\n\n[MIT](LICENSE)\n","chord-cli 是一个面向多智能体协同编程的命令行工具，支持在单个代码仓库中并行启动多个 AI 编程代理，每个代理独占一个 Git worktree 并通过文件级声明式协作机制避免冲突。核心功能包括：基于共享看板的文件抢占与协商、异步消息通信、自动化的 finish 流程（含 rebase、fast-forward 和冲突提示）、以及对任意 LLM 编程代理的零侵入集成。适用于需要多人\u002F多智能体协同完成同一代码库中多个独立任务的场景，如开源协作开发、AI 编程评测、自动化特性并行实现等。","2026-11-24 04:32:35","CREATED_QUERY"]