Atomic Task Claiming

Dozens of agents race to claim the same task queue — only one wins. SQLite CAS ensures zero duplicated work, no Redis required.

How it works

  1. Create tasks on the board with status: "todo"
  2. Any agent calls POST /api/board/:id/claim
  3. SQLite CAS: only one claim succeeds — task moves atomically to "doing"
  4. The losing agents get a 409 conflict and try the next task

When to use this

Example

# Agent claims a task atomically
curl -sk -X POST $AMUX_URL/api/board/PROJ-5/claim
# → 200 if claimed, 409 if another agent already took it

# Mark done when finished
curl -sk -X PATCH $AMUX_URL/api/board/PROJ-5 \
  -H 'Content-Type: application/json' \
  -d '{"status":"done"}'

Related demos

Try amux

Run dozens of Claude Code agents in parallel. Python 3 + tmux. Open source.

git clone https://github.com/mixpeek/amux && cd amux && ./install.sh
amux register myproject --dir ~/Dev/myproject --yolo
amux serve  # → https://localhost:8822
View on GitHub Getting started →