Skip to main content

Deterministic orchestrator for CLI coding agents (Claude Code, Codex, Gemini CLI, and 40+ more). No model in the coordination loop, so parallel runs in per-task git worktrees replay byte-identically. Signed lineage plus an opt-in HMAC audit chain a reviewer checks offline, without rerunning it. Cluster mode, air-gap deploy.

Project description

Bernstein
Bernstein - deterministic multi-agent CLI orchestration

"To achieve great things, two things are needed: a plan and not quite enough time." - Leonard Bernstein

deterministic multi-agent CLI orchestration

CI PyPI GHCR Python 3.12+ License OpenSSF Scorecard CodeQL Open in Codespaces MCP Toplist

website · docs · install · first run · glossary · limitations · sponsor


Bernstein is a deterministic orchestrator for CLI coding agents (Claude Code, Codex, Gemini CLI, and 40+ more). Scheduling is plain Python - no LLM in the coordination loop - so runs are reproducible end to end. Every task runs in its own git worktree behind lint/type/test gates. Results stay checkable after the fact: an always-on lineage spine and replay journal, plus an opt-in HMAC-chained audit log (--audit) with receipts you can verify offline. Air-gap install profile included. Apache-2.0.

at a glance

Four things set it apart; everything after is detail.

  • No LLM in the coordination loop. Scheduling is plain Python, so a run is reproducible end to end. Replay yesterday's plan and get yesterday's task graph.
  • Checkable after the fact. The lineage spine and replay journal record every run; the opt-in audit chain adds receipts you verify offline. Non-determinism surfaces as a hash mismatch at the exact step, not a flaky re-run.
  • Isolated by construction. Each task gets its own git worktree behind merge gates. No shared mutable state between agents.
  • Broad and local. 40+ CLI agent adapters plus a generic --prompt wrapper, file-based state, no SaaS hop, no third-party data plane.

The full list is on the capabilities page; the feature matrix is the exhaustive index.

install in 30 seconds

pipx install bernstein
bernstein init
bernstein -g "fix the failing test in tests/test_foo.py"

pip, uv, brew, dnf, npm, Docker, and the air-gapped wheelhouse are covered in the install guide.

Bernstein in action: parallel AI agents orchestrated in real time

prove a run

Determinism here is something you check, not something you take on faith. Run once with audit enabled, then verify what was recorded:

BERNSTEIN_AUDIT=1 bernstein -g "fix the failing test in tests/test_foo.py"
bernstein replay list                 # run ids recorded on disk
bernstein replay latest --verify      # recompute the journal head, name the first divergent step
bernstein lineage verify <run_id>     # recompute the always-on lineage spine
bernstein audit verify                # HMAC chain + Merkle seal (written because audit was enabled)

The journal and the lineage spine are written on every run. bernstein audit verify only has a chain to check when the run was started with --audit, BERNSTEIN_AUDIT=1, or a compliance preset.

how it works

Each goal moves through four stages:

  1. Decompose. The manager breaks your goal into tasks with roles, owned files, and completion signals. One LLM call, then plain Python from there.
  2. Spawn. Agents start in isolated git worktrees, one per task. Main branch stays clean.
  3. Verify. The janitor checks concrete signals: tests pass, files exist, lint clean, types correct.
  4. Merge. Verified work lands in main. Failed tasks get retried or routed to a different model.

Why the scheduler is plain Python, and what that trades away: why deterministic.

everyday commands

cd your-project
bernstein init                    # creates .sdd/ workspace + bernstein.yaml
bernstein -g "Add rate limiting"  # agents spawn, work in parallel, verify, exit
bernstein live                    # watch progress in the TUI dashboard
bernstein run plan.yaml           # multi-stage plan: skip LLM planning, execute directly
bernstein stop                    # graceful shutdown with drain

The full operator surface (PR automation, schedules, chat bridges, the autofix daemon) is in operator commands.

supported agents

Claude Code, Codex CLI, Gemini CLI, GitHub Copilot CLI, Cursor, Aider, Goose, OpenAI Agents SDK, Amp, Cody, Continue, Devin Terminal, Junie, Kilo, Kiro, AWS Q Developer, Ollama, OpenCode, OpenHands, Open Interpreter, gptme, Plandex, AIChat, Letta Code, Qwen, and more. The adapter index carries install commands for 29 of them; bernstein integrations list enumerates all 48 wired-in adapters from src/bernstein/adapters/use_cases.py, which is the single source of truth. Anything else with a --prompt flag works through the generic wrapper.

Mix agents in the same run: cheap local models for boilerplate, heavier cloud models for architecture. bernstein integrations list --installed shows what is available on your machine.

beyond the front page

Everything deep lives on the docs site:

capabilities the full capability list: MCP server mode, signed agent cards, sandbox backends, artifact sinks, regulatory mappings
who this is for where the value lands, and where Bernstein is the wrong tool
workflows declarative YAML DAGs of agent / command / loop nodes
web UI browser dashboard on the same API the TUI uses
cloud execution experimental: run agents on Cloudflare Workers with R2 workspace sync against your own account. The hosted api.bernstein.run service is not yet available
security scorecard, fuzzing, hardening
architecture how it works under the hood

why the name?

Bernstein is named after Leonard Bernstein, the American conductor and composer. The project orchestrates a crew of CLI coding agents the way Bernstein conducted the New York Philharmonic: every player on cue, the score deterministic, the conductor accountable for the result. He is the original orchestrator the project takes its name from.

i wrote bernstein because i was paying $400/month in claude bills running three coding agents in parallel and getting nondeterministic merges. Apache 2.0, solo maintained. Live stats: bernstein.run.

mentioned in

Listed in vinta/awesome-python, covered in Augment Code's open-source agent orchestrators roundup, cited by awesome-agentic-patterns as the production implementation of deterministic zero-LLM orchestration, and featured in Python Weekly #742.

All coverage: 20+ awesome lists, directories, newsletters, and peer citations

The full tracked list, including every awesome-list entry, catalog listing, prior-art citation, and newsletter mention, lives in docs/mentions.md. Entries are added as they appear; corrections welcome by issue or PR.

contributing, support, license

PRs welcome; CONTRIBUTING.md has setup and code style. Security reports go through SECURITY.md. If Bernstein saves you time: GitHub Sponsors. Contact: forte@bernstein.run.

Citation metadata lives in CITATION.cff. License: Apache-2.0.


Alex Chernysh · GitHub · X · bernstein.run

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bernstein-3.13.0.tar.gz (9.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bernstein-3.13.0-py3-none-any.whl (9.2 MB view details)

Uploaded Python 3

File details

Details for the file bernstein-3.13.0.tar.gz.

File metadata

  • Download URL: bernstein-3.13.0.tar.gz
  • Upload date:
  • Size: 9.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for bernstein-3.13.0.tar.gz
Algorithm Hash digest
SHA256 da57afdb18d97740484adc39c2eeaab27874d6e3076ef18849265bc42633a35d
MD5 ec8f1fa871d9c0210d7e91bd26b25fa5
BLAKE2b-256 044b302cc96e096c26cc6629dc2448be8ae3eae17173daf35837c8590e49cb69

See more details on using hashes here.

Provenance

The following attestation bundles were made for bernstein-3.13.0.tar.gz:

Publisher: publish.yml on sipyourdrink-ltd/bernstein

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bernstein-3.13.0-py3-none-any.whl.

File metadata

  • Download URL: bernstein-3.13.0-py3-none-any.whl
  • Upload date:
  • Size: 9.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for bernstein-3.13.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c0c3be542064dbd4f1253bfa02f0d2a5a7cecc8cd966024edc4654d92c1ea17b
MD5 d9f980566c6113ae9439850dfb30f654
BLAKE2b-256 214ccaadabc8a5e56d05d3eb4e982c86100d2e3756dd81bd03907ea320c8c965

See more details on using hashes here.

Provenance

The following attestation bundles were made for bernstein-3.13.0-py3-none-any.whl:

Publisher: publish.yml on sipyourdrink-ltd/bernstein

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page