Run several coding agents in one working tree without them overwriting each other.
A plugin for Claude Code, Codex, Antigravity and OpenCode. Local, zero-config, fails open.
Install · Use · Dashboard · How it works · Safety · Troubleshooting · Contributing
Running two or three agent sessions in the same checkout is fast until one of them rewrites a file the other is halfway through, or runs git stash and sweeps away work that was never its own. Git worktrees avoid this but cost you a checkout per agent, separate builds and a merge at the end. agent-quorum keeps the single working tree and adds the missing coordination:
| Problem | What agent-quorum does |
|---|---|
| Two sessions edit the same file | The first session to edit a file holds it. Another session's edit is denied, and it is told who holds the file. |
One session runs git stash, checkout or reset --hard over another's work |
The command is denied while another session has uncommitted files in the repo. |
One session runs git add -A or commit -a and commits another's half-finished edits |
Denied, with the advice to stage its own files by path. |
| Sessions do not know about each other | Each new session is told who else is working in the repo and on which files. |
A file is released when its holder commits or reverts it, exits, or crashes. There is nothing to configure and nothing to run.
What a blocked session sees:
agent-quorum: /src/app/auth.go is being edited by another agent session (claude:9f2c1a7e, active 40s ago, working on "refactor token refresh"). Do not edit this file and do not modify it through shell commands. Continue with work that does not need it, or ask the user how to proceed.
The message is written for the model: it says who holds the file, rules out shell workarounds, and gives the agent something else to do.
Sessions from different agents coordinate with each other: a Codex session is blocked from a file a Claude Code session holds, and the other way round.
| Claude Code | Codex | Antigravity | OpenCode | |
|---|---|---|---|---|
| File claims | Edit Write MultiEdit NotebookEdit |
apply_patch |
write_to_file replace_file_content multi_replace_file_content apply_patch |
edit write patch (the edit permission) |
| Git guard | Bash (git commands) |
Bash |
run_command |
shell permission |
| Told who else is here | at session start | at session start | at session start and on every prompt | at the first prompt |
| Session ends on | SessionEnd |
SessionEnd |
Stop (the next prompt registers again) |
process exit (--standalone) or 30 min idle (shared service) |
| Status in-agent | /agent-quorum:status |
terminal CLI | terminal CLI | terminal CLI |
| Install from | marketplace | marketplace | local checkout | local checkout |
Note
Requires macOS or Linux. The plugin is shell scripts only. On the next session start it downloads the matching agent-quorum binary from GitHub Releases, verifies it against the release checksums and stores it in ~/.agent-quorum/bin/.
Claude Code
claude plugin marketplace add ChristopherLiew/agent-quorum#stable
claude plugin install agent-quorum@agent-quorum-toolsStart a new session, then run /agent-quorum:status to check it is working.
| Task | Command |
|---|---|
| Update | claude plugin update agent-quorum@agent-quorum-tools |
| Uninstall | claude plugin uninstall agent-quorum@agent-quorum-tools |
Third-party marketplaces do not auto-update by default. Turn it on under /plugin, or run the update command.
The plugin also adds the dashboard, /quorum-dashboard.
Codex
codex plugin marketplace add ChristopherLiew/agent-quorum --ref stable
codex plugin add agent-quorum@agent-quorum-toolsCodex loads the hooks from the plugin's Codex manifest. Review and trust the bundled hooks in Codex before they run, then start a new session.
| Task | Command |
|---|---|
| Update | codex plugin marketplace upgrade agent-quorum-tools |
| Uninstall | codex plugin remove agent-quorum@agent-quorum-tools |
Antigravity
Antigravity installs the plugin from a local directory, so clone the stable branch first:
git clone --branch stable https://github.com/ChristopherLiew/agent-quorum.git
agy plugin install ./agent-quorum/pluginEnable the plugin in Antigravity if the CLI leaves it disabled.
To update, reset the checkout to the new stable (the channel branch is force-moved on each release, so do not git pull), then install again:
git -C agent-quorum fetch origin stable
git -C agent-quorum reset --hard origin/stable
agy plugin install ./agent-quorum/pluginOpenCode
OpenCode loads the plugin from a local checkout. It is one TypeScript file that OpenCode runs directly, with no build step and no dependencies:
git clone --branch stable https://github.com/ChristopherLiew/agent-quorum.gitThen add the plugin directory to ~/.config/opencode/opencode.json (or a project's opencode.json), using the absolute path of your checkout. OpenCode rejects a path to the .ts file itself:
On first load the plugin downloads the matching binary in the background, so coordination starts with the next session.
| Task | Command |
|---|---|
| Update | git -C agent-quorum fetch origin stable && git -C agent-quorum reset --hard origin/stable |
| Uninstall | Remove the entry from plugins |
By default OpenCode runs plugins in one shared background service that outlives your sessions, so agent-quorum cannot tell when an OpenCode session exits. Its files are released after 30 minutes without a prompt, edit or git command, or 120 seconds after they are committed or reverted. Runs started with opencode run --standalone are tracked by process and release immediately on exit.
Release candidates
Pre-releases are published to the latest channel. Use it in place of stable when you add the marketplace:
claude plugin marketplace add ChristopherLiew/agent-quorum#latest
codex plugin marketplace add ChristopherLiew/agent-quorum --ref latestTerminal CLI and full removal
The CLI is optional. The binary the plugin downloaded is at ~/.agent-quorum/bin/agent-quorum-<version>. To use it from a terminal, link it onto your PATH, and link it again after each update:
ln -sf ~/.agent-quorum/bin/agent-quorum-<version> ~/.local/bin/agent-quorumTo remove everything after uninstalling the plugin, stop the daemon and delete its state and any link you made:
~/.agent-quorum/bin/agent-quorum-<version> stop
rm -rf ~/.agent-quorum ~/.local/bin/agent-quorumIf you installed the git hook, also delete .git/hooks/pre-commit in that repository.
Open two or more sessions in the same repository and work as usual. agent-quorum stays silent until there is a conflict.
To see who holds what, run /agent-quorum:status in Claude Code, or this from a terminal:
$ agent-quorum status
claude:9f2c1a7e pid 4242 idle 40s /src/app "refactor token refresh"
/src/app/auth.go
codex:3b80d4c2 pid 4310 idle 2m5s /src/app "add retry to the http client"
(holds no files)| Command | What it does |
|---|---|
agent-quorum status [--json] |
Live sessions and the files each holds. |
agent-quorum release --session ID --all |
Drop a session's claims. |
agent-quorum install-git-hook |
Add a pre-commit hook that refuses commits containing files held by another session. The hook needs agent-quorum on your PATH and does nothing without it. |
agent-quorum stop |
Stop the daemon. Claims are kept and reloaded on the next start. |
Tip
Tell your agents to stage files by explicit path (git add src/auth.go) and to avoid git add -A, commit -a, stash and checkout. agent-quorum enforces this, but agents that already work this way are blocked less often.
The Claude Code plugin includes a dashboard that puts every agent session on your machine into one live, htop-style table inside Claude Code.
| Feature | What you get |
|---|---|
| Live view | Every Claude Code, Codex, OpenCode and Antigravity session, refreshed every 2 seconds while the pane is open. |
| At a glance | The process, agent, idle time, number of held files, repository and latest prompt for each session. Your own session is marked *. |
| Colour | Each agent has its own colour, and idle time goes from green to amber (past 10 minutes) to red (past 30). |
| Keyboard selection | ↑/↓ move a ▶ marker and highlight bar through the sessions. |
| File tree | Enter expands a session into the files it holds, drawn as a directory tree. |
| Actions | r releases a session's leftover claims after a confirmation, and c copies its id. |
| Safe by design | It only reads agent-quorum status and runs release. It is never in the hook path, so the guard works the same whether or not the dashboard is open, or supported by your Claude Code version. |
It comes with the agent-quorum plugin; there is nothing else to install. It needs a Claude Code version that supports mods (hooks modules). Older versions skip it and keep the guard. In any Claude Code session, run /quorum-dashboard.
| Key | Action |
|---|---|
↑ / ↓ |
Select the previous or next session. |
Enter |
Show or hide the selected session's files. |
r |
Release every file the selected session holds. The session takes a file back on its next edit, so use this for claims left behind, not to take a file from an active agent. |
c |
Copy the selected session's id, for agent-quorum release --session ID. |
esc |
Close the pane. |
If the pane shows daemon down, no agent session has started the daemon yet. An error line usually means the agent-quorum binary was not found: start a session with the main plugin installed, or set AGENT_QUORUM_BIN.
Each agent's native hooks run a short-lived agent-quorum hook process before an edit or a git command. OpenCode, whose plugins must be JavaScript or TypeScript, gets a thin shim that forwards its hook events to the same process. That process asks a small local daemon, shared by every session on your machine, whether the action is safe. The daemon starts by itself on the first hook and keeps its state in ~/.agent-quorum.
A typical contention, end to end:
sequenceDiagram
autonumber
participant A as Session A · Claude Code
participant Q as agent-quorum daemon
participant B as Session B · Codex
A->>Q: edit auth.go
Q-->>A: no opinion, A now holds auth.go
B->>Q: edit auth.go
rect rgba(248, 113, 113, 0.15)
Q-->>B: deny, held by A, do not edit it through the shell either
B->>Q: git stash
Q-->>B: deny, another session has uncommitted work
end
A->>Q: git commit auth.go
Q-->>A: no opinion
Note over Q: auth.go is clean and the 120 s grace period has passed, so the claim lapses
B->>Q: edit auth.go
Q-->>B: no opinion, B now holds auth.go
- Holding a file. The first edit takes a claim. It lasts while the holder's process is alive and the file has uncommitted changes, plus a 120 second grace period after the last edit.
- Crashes. If a session dies without exiting cleanly, its files free up the next time anyone asks for them. There are no timers or background reapers.
- Daemon restarts. If the daemon stops, the next hook starts a new one and reloads the saved claims.
- Fails open. If agent-quorum is broken, slow or missing, your agents behave as if it were not installed.
- Never auto-approves. A hook either has no opinion or denies. Each agent's own permission prompts still apply.
- Local only. One Unix socket and one state directory. Nothing leaves your machine.
- Prompt notes. The first 80 characters of each prompt are stored locally so sessions can see what the others are working on. Set
AGENT_QUORUM_NO_NOTES=1to turn this off.
agent-quorum coordinates cooperating agents and is not a security boundary.
- Shell writes such as
sed -ior>redirection are not intercepted, and file claims cover only the tools in the table above. - An OpenCode session in the shared background service holds its files for at most 30 minutes after its last prompt, edit or git command, because the service outlives the session. Other shell commands, such as a long test run, do not count as activity.
- Edits you make in your own editor are not seen.
- It works on one machine for one user.
- If every agent already has its own git worktree or clone, you do not need it.
| Symptom | What to do |
|---|---|
| Nothing is ever blocked | Run agent-quorum status. If the daemon is not running after a session has started, check that ~/.agent-quorum/bin/ contains a binary (it is downloaded at session start), then start a new session. |
| A file is stuck as held | Find the session with agent-quorum status, then agent-quorum release --session <id> --all. |
| A file is still held just after it was committed | Expected for 120 seconds. Wait, or release it by hand. |
| Why was something denied? | ~/.agent-quorum/daemon.log records every deny with the session and reason. |
| Did the hooks run? (Claude Code) | Start with claude --debug-file /tmp/cc.log and search for lines starting Hooks:. |
| Did the hooks run? (OpenCode) | Run AGENT_QUORUM_CAPTURE=/tmp/aq.jsonl opencode run --standalone "..."; every event the plugin forwards is appended to that file. For the shared background service, set it with opencode service set env AGENT_QUORUM_CAPTURE /tmp/aq.jsonl and opencode service restart, and unset it afterwards. |
| Odd behaviour after an upgrade | agent-quorum stop. The next hook starts the new version. |
Still stuck? Open an issue with your OS, agent and version, and the relevant lines from daemon.log.
Bug reports and pull requests are welcome. CONTRIBUTING.md covers building from source, code style, versioning, CI/CD and the release checklist.
git clone https://github.com/ChristopherLiew/agent-quorum && cd agent-quorum
make check # vet, lint, tests
make dev # Claude Code with the local plugin and binary
{ "$schema": "https://opencode.ai/config.json", "plugins": ["/absolute/path/to/agent-quorum/plugin/opencode"] }