Skip to content

Tool Pick|Bernstein — a deterministic scheduler that runs multiple coding agents in parallel without spending model tokens

Nov 26, 20264 min
TL;DRBernstein is an open-source CLI that runs multiple coding agents in parallel under a deterministic scheduler instead of an LLM. Install: pipx install bernstein. It fixes the problem of nobody tracking who's doing what, whether tests passed, or what happened after the fact when you fan agents out across a codebase.

Look up & save

Loading dictionary…

中文版

Tool Info

FieldValue
NameBernstein
TypeCLI / Python library / MCP server
GitHubsipyourdrink-ltd/bernstein
Stars1,220 (checked 2026-11-25)
LanguagePython 3.12+
LicenseApache-2.0
Installpipx install bernstein

What Problem It Solves

Running several Claude Code or Codex sessions on the same codebase at once sounds efficient until three problems show up: who owns which piece, whether two agents just touched the same file, and whether anything they changed actually passes lint, type checks and tests. Hand-rolling this yourself means scripting worktree creation, retries and cost tracking from scratch — and when something breaks, you have no record of what the agent actually decided along the way.

Bernstein wraps that management layer into one CLI, and deliberately keeps the scheduler itself free of LLM calls: it's plain Python. It decomposes a goal — or a YAML plan with staged, dependent steps — into tasks, spawns a short-lived CLI agent per task inside its own git worktree, runs quality gates (lint, type checks, tests, optionally a security scan), merges only the worktrees that pass, and escalates to a stronger model on failure before giving up and dropping the task into a dead-letter queue with the worktree preserved for inspection. Because decomposition, assignment and merging are deterministic code, replaying the same plan twice reproduces the same task graph, and a lineage spine lets you step back through a run by default. An optional HMAC-chained audit log turns every step into a signed record that someone who never ran the job can still verify offline.

It fits teams who want to queue a batch of work before bed and wake up to a set of green PRs; teams that need a paper trail of what an autonomous agent did and why for an audit; or anyone who just wants a CI-style wrapper — fan out to N tasks, merge what's green — on top of whatever CLI agent they already use. The project lists 55 selectable adapter names, including Claude Code, Codex, Gemini CLI and Aider.

Bernstein's tick loop: from goal to merged code
Bernstein's tick loop: from goal to merged codeBernstein breaks a goal into tasks, runs each one with a short-lived agent in its own git worktree, merges only what passes the quality gate, escalates the model and retries on failure, and drops exhausted retries into a dead-letter queue. Decompose goal into tasks Spawn agent for task own git worktree Quality gate passes? lint・type・test Merge to main Retries left? count < max Dead-letter queue worktree kept for review Yes No Yes No

Simplified from the official docs; heartbeat monitoring, the warm pool and the bulletin board are left out.

Getting Started

Install

pipx install bernstein   # recommended; pip install bernstein / uv tool install bernstein also work
# Requires: Python 3.12+, at least one installed CLI coding agent (Claude Code / Codex / Gemini CLI...), git

Basic usage

cd your-project
bernstein -g "add JWT-based user authentication"
# Bernstein decomposes the goal, runs each task's agent in its own worktree,
# and merges only what passes the quality gate — results land straight in git history

Advanced usage (optional)

# plan.yaml: multi-stage project with dependencies between stages
name: "Add authentication"
stages:
  - name: database
    steps:
      - goal: "Create user table migration"
        role: backend
        complexity: low
  - name: api
    depends_on: [database]
    steps:
      - goal: "Implement /login endpoint"
        role: backend
        complexity: medium
        priority: high
bernstein run plan.yaml --routing bandit --audit   # pick models with a contextual bandit, enable the HMAC audit chain
bernstein audit verify                             # verify the audit chain offline afterward

How It Compares

BernsteinHand-rolled multi-agent scriptsMost LLM-driven agent orchestrators
Scheduler itself calls an LLM (plain Python, zero scheduling tokens)—
Each task gets its own git worktreeYou build itPartial
HMAC-chained audit log, offline-verifiableMostly missing
Number of supported CLI agents55 selectable adapters (Claude Code, Codex, Gemini CLI, Aider...)Whatever you wire upUsually 1–3
Auto model-escalation retry, dead-letter queue on exhaustionYou build itPartial

Things to Watch

  • Beta status, solo-maintained: the README itself says "status: beta, solo-maintained." The version number counts releases, not maturity, and interfaces can change between minor versions — pin your version.
  • The HTTP task server binds 127.0.0.1:8052 by default: fine for local use, but don't expose it externally. Each agent calls its own model API with credentials you configure; Bernstein doesn't proxy or store those keys for you.
  • Not a compliance certification: the docs are explicit that Bernstein doesn't claim SOC 2, HIPAA or FedRAMP coverage. The HMAC audit chain is a technical primitive you can build your own compliance case on, not a certification in itself.
  • Cloudflare-based cloud execution is still experimental; you deploy it to your own Cloudflare account, and there's no hosted service from the project.

Today's Takeaway

Whether the scheduler itself spends LLM tokens decides whether you can ever replay a run. Bernstein deliberately keeps decomposition, assignment and merge-decisions as plain Python that never touches a model, which buys you a task graph that's identical across two runs of the same plan, and a replay journal you can step back through when something diverges. That's a different bet from "have a smarter agent coordinate the other agents" — the latter is more flexible, but nobody can promise the coordination comes out the same way twice.

References