{"slug": "coordinating-several-ai-coding-agents-on-one-machine-with-a-230-line-sqlite-tool", "title": "Coordinating several AI coding agents on one machine with a 230-line SQLite tool", "summary": "A developer at kanibal-studio released agent-collab-kit, a roughly 230-line Python tool built on the standard library and SQLite that coordinates multiple AI coding agents running on one machine. The tool provides an idempotent message inbox with acknowledgement and resource claims backed by expiring leases and generation UUIDs, so a paused agent whose lease was taken over cannot renew or release its successor's claim. Every mutation runs inside SQLite BEGIN IMMEDIATE, and the test suite includes two real processes racing for a single claim.", "body_md": "When you run several AI coding agents at once on the same machine (several Claude Code sessions, a worker plus an integrator, or a mix of tools), two problems show up quickly:\n\n`src/add.py`, and the second write quietly wins.\nWe hit both while building our own internal tooling, so we wrote a deliberately small answer to them: [agent-collab-kit](https://github.com/kanibal-studio/agent-collab-kit), one Python file of about 230 lines, standard library and SQLite only, MIT licensed.\n\nEvery message lives in a local SQLite file until the recipient acknowledges it. Here is the demo from the README, run against a throwaway database:\n\n```\nDB=$(mktemp -d)/demo.db\npython3 agent_collab.py --db \"$DB\" init\npython3 agent_collab.py --db \"$DB\" send --sender worker-a --recipient integrator \\\n  --key demo-result-1 --body 'Addition is ready for review'\npython3 agent_collab.py --db \"$DB\" inbox --recipient integrator\n[{\"id\": \"2fd715fc-...\", \"idempotency_key\": \"demo-result-1\", \"sender\": \"worker-a\",\n  \"recipient\": \"integrator\", \"body\": \"Addition is ready for review\",\n  \"acknowledged_at\": null}]\n```\n\nThe idempotency key matters for agents: an agent that retries after a crash and sends the same sender, recipient and body gets the existing message back instead of a duplicate. Reusing the key for different content is an error. `ack` marks the message as received. It does not prove the work was delivered or tested, and the README says so.\n\nBefore editing, an agent claims the exact resource it is about to touch:\n\n```\npython3 agent_collab.py --db \"$DB\" claim --resource src/add.py --owner worker-a --ttl 300\n# {\"resource\": \"src/add.py\", \"owner\": \"worker-a\", \"generation\": \"6ca2d25b-...\", ...}\n\npython3 agent_collab.py --db \"$DB\" claim --resource src/add.py --owner worker-b --ttl 300\n# resource has an active lease   (exit code 1)\n```\n\nEach claim gets a fresh **generation UUID**. Renewing or releasing requires the matching owner *and* generation, and an unexpired lease. That closes a nasty case: an agent that was paused, whose lease expired and was taken over, cannot later renew or release its successor's lease, even under the same owner name. Every mutation runs inside SQLite `BEGIN IMMEDIATE`, and the test suite includes two real processes racing for one claim.\n\nThis is the part we care most about stating clearly:\n\nIn practice we pair it with one rule: a single integrator reviews and merges, and a shared resource such as `__commit__` serializes integration. The repository includes a fictitious `COLLAB.md` board and a short method for letting project agents propose improvements under supervision.\n\nWe publish the reusable pieces of our stack under [kanibal-studio](https://github.com/kanibal-studio), each with its own tests and the same habit of saying what it does not do:\n\nIssues and criticism are welcome, especially about the lease semantics.", "url": "https://wpnews.pro/news/coordinating-several-ai-coding-agents-on-one-machine-with-a-230-line-sqlite-tool", "canonical_source": "https://dev.to/altavista360/coordinating-several-ai-coding-agents-on-one-machine-with-a-230-line-sqlite-tool-5chd", "published_at": "2026-10-24 21:26:24+00:00", "updated_at": "2026-10-24 21:41:07.414936+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "ai-tools", "mlops"], "entities": ["kanibal-studio", "agent-collab-kit", "Claude Code", "SQLite", "GitHub"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/coordinating-several-ai-coding-agents-on-one-machine-with-a-230-line-sqlite-tool", "markdown": "https://wpnews.pro/news/coordinating-several-ai-coding-agents-on-one-machine-with-a-230-line-sqlite-tool.md", "text": "https://wpnews.pro/news/coordinating-several-ai-coding-agents-on-one-machine-with-a-230-line-sqlite-tool.txt", "jsonld": "https://wpnews.pro/news/coordinating-several-ai-coding-agents-on-one-machine-with-a-230-line-sqlite-tool.jsonld"}}