Run a fleet of coding agents around one shared SQLite queue, with a strict review gate and a human who decides what ships.
Public prototype. tanda is the cleaned-up, general version of the multi-agent pipeline I run every day to contribute fixes to open-source AI tooling (case study). The in-house system moves faster; the generic parts are synced here every two weeks. Last sync: 2026-11-03.
Coding agents are good at small, well-defined fixes. Running several of them at once usually goes wrong in a few predictable ways: two agents grab the same task, nobody checks the work before it reaches a maintainer, idle agents burn tokens polling for work, and volume grows until maintainers start ignoring you.
tanda puts one queue in the middle and lets agents talk to it only through a small CLI:
- a scout finds candidates and adds them to the queue,
- builders claim items one at a time, reproduce, fix and test,
- an independent reviewer (a separate session) approves the work or sends it back,
- a human triages what goes in and publishes what comes out.
A tanda (Spanish for a shift or a batch) is one run. It ends on its own once the queue is drained.
| Any agent CLI | Presets for Claude Code, opencode (which reaches Grok, DeepSeek and many other providers) and Codex, or any command that takes a prompt. You can pick a different agent and model per role. |
| One shared queue | SQLite in WAL mode (.tanda/queue.db). Claims are atomic (BEGIN IMMEDIATE), so two workers never get the same item. Every state change is written to an event log. |
| Role permissions | Each role declares the states it claims, the state it holds an item in (working) and the only verdicts it may set. The CLI refuses anything else. |
| HOLD by default | An agent that exits, crashes or times out without a verdict puts its item in HOLD for a human. Nothing is silently lost or retried. |
| No idle token burn | Waiting happens in Python, not inside an agent. An agent process starts only when there is an item for it, and exits after its verdict. |
| Volume limits | group_cap caps active items per group (for example per owner/repo), blocked_groups skips orgs entirely, and items with the same group and ref are deduplicated. |
| Local dashboard | tanda ui gives you a board per state, live workers, an activity feed, item history and agent logs, plus buttons to triage, resolve a HOLD, or mark an item done. |
| Zero dependencies | Python 3.11+ standard library only: sqlite3, tomllib, http.server, subprocess, threading. |
flowchart LR
subgraph tanda["tanda run (one machine)"]
S["Scout<br/><i>mode = once</i>"] -- "tanda add" --> Q[("Shared queue<br/>SQLite · WAL<br/>items + events + runs")]
Q -- "claim TODO / FIX" --> B["Builders × N<br/>reproduce · fix · test<br/>commit locally"]
B -- "BUILT + branch, commit, draft" --> Q
Q -- "claim BUILT" --> R["Reviewer<br/>independent session<br/>re-runs the test"]
R -- "FIX (with a note)" --> Q
R -- "READY / DROPPED" --> Q
end
H(["Human<br/>(dashboard or CLI)"])
Q -- "TRIAGE" --> H
H -- "approve: TODO" --> Q
Q -- "HOLD: no verdict,<br/>timeout or judgment call" --> H
Q -- "READY" --> H
H -- "reads, decides,<br/>publishes" --> GH[("GitHub")]
By convention, agents don't touch the database directly (tanda doesn't prevent it). They get a rendered prompt and a few environment variables (TANDA_ROLE, TANDA_WORKER, TANDA_ITEM, TANDA_CONFIG), and they report back with tanda set / tanda add. In the oss-contrib example no agent writes to GitHub: builders commit locally and draft the PR text, and the human publishes.
States come from your tanda.toml: every role's claims, working and verdicts, plus extra_states. DONE, DROPPED and the hold state (HOLD unless you change hold_state) always exist. This is the oss-contrib flow:
stateDiagram-v2
[*] --> TRIAGE: scout adds
TRIAGE --> TODO: human approves
TRIAGE --> DROPPED: human rejects
TODO --> BUILDING: builder claims
FIX --> BUILDING: builder claims
BUILDING --> BUILT: verdict
BUILDING --> DROPPED: verdict
BUILDING --> HOLD: verdict, or exit without one
BUILT --> REVIEW: reviewer claims
REVIEW --> READY: verdict
REVIEW --> FIX: verdict + note
REVIEW --> DROPPED: verdict
REVIEW --> HOLD: verdict, or exit without one
READY --> DONE: human publishes
HOLD --> TODO: human decides
HOLD --> DROPPED: human decides
DONE --> [*]
DROPPED --> [*]
A worker role loops. It claims the best item in one of its claims states (lowest priority first, then oldest), moves it to its working state and records itself as owner, all in one transaction. Then it starts the agent with the role prompt plus the item ({item_id} {title} {group} {ref} {kind} {note} {fields}). With count = 3 you get three of these loops in parallel. A role with mode = "once", such as a scout, runs one time per tanda and adds items instead of claiming them.
The agent finishes by giving exactly one verdict:
tanda set 42 BUILT --note "off-by-one in cursor; test added" \
--field branch=fix/pagination --field commit=3f2a9c1 --field draft=drafts/42.mdThe CLI refuses a verdict that isn't in the role's verdicts, and refuses any change to an item the agent does not currently hold. Fields are merged into the item, so the reviewer sees the builder's branch, commit and draft.
When the agent process exits and its item is still in the working state (no verdict, a crash, or a kill after timeout_minutes), tanda moves the item to HOLD with a note that points to the log. Agents can also choose HOLD themselves when a human has to decide: a design choice, a CLA, a repro only the human can observe. tanda doesn't wait on HOLD, so the run still ends and the items stay on the board for you.
tanda run exits with one of three reasons:
drained: everyoncerole has finished and no item is left in a claimed, working orwait_statesstate;stopped:tanda stopor the button in the UI was used, and workers finished their current item first;timeout:max_hourspassed.
pip install git+https://github.com/pcbeingused333/tanda # Python 3.11+, no dependenciesmkdir demo && cd demo
tanda init hello
tanda ui # open http://127.0.0.1:8787
tanda run # in a second terminalThe fake scout adds five items, two fake builders build them (and drop about one in six), and the fake reviewer approves most and sends some back with FIX. Watch items move across the board, then try:
tanda status # counts per state + latest agent runs
tanda list # active items
tanda show 1 # one item with its full historymkdir oss && cd oss
tanda init oss-contrib
$EDITOR tanda.toml prompts/*.md # pick agents and models, set limits
tanda ui &
tanda run- The scout (
mode = "once") looks for verified, unclaimed bugs in healthy repos and adds them toTRIAGE. - You triage in the dashboard, moving items to
TODOorDROPPED. The run stays alive while anything is inTRIAGE, becausewait_states = ["TRIAGE"]. - Three builders reproduce, fix, add a failing-then-passing test, commit locally and write a PR draft.
- The reviewer re-runs the test itself, checks value, diff size, repo rules, duplicates and the draft, then sets
READY,FIX,DROPPEDorHOLD. - You read every
READYitem, publish it yourself, and mark itDONE.
Agents run non-interactively, so they need permission to run commands without asking. With Claude Code, set this in the project's permission settings (permission mode or allowed tools), and keep it as narrow as the work allows.
[tanda]
name = "oss-contrib"
initial_state = "TRIAGE" # where `tanda add` puts new items
wait_states = ["TRIAGE"] # keep the run alive while these are non-empty
extra_states = ["READY"] # states no role claims but humans use
max_hours = 6
# poll_seconds = 5 · hold_state = "HOLD" · db = ".tanda/queue.db"
[limits]
group_cap = 5 # max active items per group (e.g. per repo)
blocked_groups = ["some-org/"] # prefix match, case-insensitive
[roles.builder]
agent = "opencode" # preset: claude | opencode | codex, or your own [agents.x]
model = "deepseek/deepseek-chat"
count = 3
claims = ["TODO", "FIX"]
working = "BUILDING"
verdicts = ["BUILT", "DROPPED", "HOLD"]
prompt = "prompts/builder.md"
timeout_minutes = 60
[agents.mine]
cmd = ["my-cli", "--model", "{model}", "{prompt}"]| preset | command |
|---|---|
claude |
claude -p --model {model} {prompt} |
opencode |
opencode run --model {model} {prompt} |
codex |
codex exec --model {model} {prompt} |
Only the claude preset has been tested end to end. Check your CLI's flags and model names (for example opencode models) before a long run.
tanda is the public core of a pipeline I run daily. That in-house system uses the same design (queue + verdicts + review gate + HOLD), and it has produced:
| As of 24 Nov 2026, since August 2026 | |
|---|---|
| Pull requests merged by maintainers | 1,737 |
| Repositories | 405 |
| Merged PRs in repositories with >10k stars | 310 |
Every merge is listed in the Merge Log. Per-run metrics (merge rate, cost per published PR) and the decisions they drove are in the case study.
These numbers belong to the in-house system, not to tanda v0.1 as published. The private parts (repo registry, per-repo state, prompts tuned to my targets, the moderator and follow-up roles) are not in this repo.
The quality bar behind them:
- Small changes. One bug, one root cause, the smallest diff in the repo's own style.
- Tests on nearly every PR. A test that fails without the fix and passes with it.
- AI involvement disclosed in neutral wording in every PR description.
- A human decides what to target and what gets published.
The work focuses on the bugs AI tooling keeps hitting: breakage from LLM provider and API changes, concurrency bugs in async code, and serialization problems.
- Triage before build. Building a fix and then dropping it was the most expensive mistake in the in-house runs, so candidates are verified before a builder touches them.
- A strict, independent reviewer. An independent reviewer (separate session) runs the builder's test itself. In the
oss-contribprompt, no test that fails onmainmeans noREADY. - Volume limits. Maintainers notice volume long before they notice quality. That's why
group_cap,blocked_groupsand dedup exist. - Respect AI policies. The example scout skips repos whose CONTRIBUTING or AGENTS file rejects AI-assisted contributions.
- Agents never write to GitHub. They commit locally and draft. A human reads, decides and publishes.
- HOLD for a human by default. When in doubt, or on any failure, the item stops and waits for a person.
- No idle token burn. Agents only exist while there is work for them.
- Boring infrastructure. One SQLite file, one process, the standard library. Easy to read, easy to debug.
This is a working v0.1 prototype. Know these before you rely on it:
- One machine only. The queue is a local SQLite file and there's no distributed worker support.
tanda stopdoes not interrupt a runningoncerole. The run waits until the scout exits.- The dashboard has no authentication. Keep it on
127.0.0.1. - Role permissions are a guardrail, not a sandbox. They're enforced through
TANDA_ROLEin the agent's environment, so an agent that runs arbitrary shell commands could get around them. Isolation (worktrees, containers, narrow agent permissions) is up to you. - The review gate lives in prompts. tanda enforces who may set
READYand from which state. That the reviewer actually re-ran a failing test is the reviewer prompt's job, not code. - No cost or token accounting yet.
runsrecords start, end, exit code and log path only. - Only the
claudepreset has been tested end to end. - The prompt is passed as one command-line argument, so very long prompts can hit OS argument-length limits, especially on Windows.
Small, incremental, and without giving up zero dependencies. See docs/roadmap.md for the full list.
tanda check: validatetanda.toml(unreachable states, missing prompt files, unknown agents) before a runtanda report: per-run metrics from the event log (throughput, FIX loops, HOLD reasons, time in state)- CI on Python 3.11–3.13 for Linux, macOS and Windows
- Optional per-run cost capture from agent CLIs that report usage
- Interrupt
onceroles ontanda stop - More examples: a single-repo bug-bash and a docs-fix pipeline
tanda/
cli.py # every command: init, add, set, show, list, count, run, stop, status, ui
config.py # tanda.toml loader, agent presets, state derivation
store.py # SQLite queue: items, events, runs, meta; atomic claim; guards
runner.py # role loops, prompt rendering, HOLD on missing verdict, finish condition
ui.py, ui.html # stdlib HTTP dashboard
examples/
hello/ # fake agent, runs offline
oss-contrib/ # the open-source contribution pipeline
tests/test_tanda.py
docs/case-study-oss.md
Issues and small PRs are welcome. Read CONTRIBUTING.md first: the rules are no new dependencies, a test with every behavior change, and disclosure if an agent helped.
This project was built with heavy help from Claude Code, the same way it is meant to be used.
