A distributed, git-backed graph issue tracker purpose-built for AI coding agents. 130k+ lines of Go, vibe-coded in 6 days. Persistent structured memory that replaces unstructured markdown plans with dependency-aware work graphs.
Beads provides a persistent, structured memory for AI coding agents. Instead of losing context between sessions or relying on fragile markdown todo lists, agents get a real issue tracker with dependency graphs, priority queues, semantic compaction, and multi-agent coordination -- all backed by a version-controlled SQL database that syncs through Git.
Zero-conflict multi-agent workflows. Hash-based IDs prevent merge collisions. JSON output for agent consumption. Git-backed persistence with Dolt's cell-level merge resolution. No central server required -- every clone is a full database.
Beads implements a two-layer data model: a CLI command layer built with Cobra on top,
and a version-controlled Dolt SQL database underneath. Agents and humans interact through
the same bd CLI, with optional MCP server integration for tool-calling environments.
Direct database access for single-writer configurations. Default for solo agent work. Dolt runs in-process -- no separate server needed.
Connects to dolt sql-server for multi-writer, high-concurrency scenarios. Multiple agents can write simultaneously without conflicts.
Local-only usage with bd init --stealth. No repository commits -- suitable for personal task tracking on shared projects without polluting Git history.
The core data model centers on Issues as the atomic unit of work, connected by typed Dependencies that form a directed acyclic graph. Every entity lives in Dolt tables with full SQL queryability and cell-level version control.
| Type | Semantics | Blocks Execution? |
|---|---|---|
blocks |
Sequential work -- B cannot start until A closes | Yes |
parent-child |
Hierarchical containment; parent blocking cascades to children | Yes (cascading) |
conditional-blocks |
B executes only upon A's failure | Conditional |
waits-for |
B waits for all of A's children to complete (fanout gate) | Yes |
relates_to |
Informational link without execution semantics | No |
discovered-from |
Provenance tracking -- discovered during other work | No |
duplicates |
Marks issue as duplicate of another | No |
supersedes |
Replacement relationship | No |
Dolt is the heart of Beads' persistence layer -- a version-controlled SQL database that combines MySQL compatibility with Git-like branching, diffing, and merging. Every write automatically creates a Dolt commit, building a complete audit trail.
Traditional databases lose history. Git tracks files but cannot merge structured data.
Dolt gives Beads both: SQL queries for fast lookups plus cell-level merge that resolves
concurrent writes from multiple agents on different branches without manual intervention.
The .beads/dolt/ directory is the entire database -- portable and self-contained.
The blocked_issues_cache table is a materialized view that tracks which issues
are currently blocked. Instead of running an expensive recursive CTE on every bd ready
call, the cache rebuilds atomically within the same transaction as any blocking-state change.
The bd binary is the primary interface for both humans and agents.
Built with Go's Cobra framework, every command supports --json output
for programmatic consumption by AI agents.
Molecules are epics with explicit workflow semantics. They represent executable work graphs where children execute in parallel by default, and only explicit dependencies create sequential ordering. The phase lifecycle (Solid, Liquid, Vapor) controls persistence and synchronization behavior.
Frozen reusable templates. Think of them as "recipes" -- parameterized work graphs you pour into active molecules when needed.
Active persistent work with full audit trails. Children are parallel by default. Agents find ready children, execute them, close them, and repeat.
Ephemeral operations that never sync. Perfect for scratch work, experiments, or throwaway subtasks. Squash them back into molecules when done.
bd mol bond A B connects separate molecules into compound workflows.
Agents can traverse bonded molecules as a unified execution graph, enabling
complex multi-phase projects where each molecule maintains its own lifecycle
but execution respects cross-molecule dependencies.
Sequential IDs (issue #1, #2, #3) collide when multiple agents create issues on different branches simultaneously. Beads solves this with hash-based IDs that adaptively grow in length as the database scales, using the birthday paradox formula to maintain collision probability under a configurable threshold.
Issues support hierarchical addressing for epics and subtasks:
Beads auto-commits issue updates to Git using lightweight worktrees, keeping the developer's working directory untouched. The system supports protected branch workflows, fork-based contributor patterns, and team-based maintainer modes.
When repositories enforce branch protection on main, Beads automatically
routes commits to a beads-sync branch. Agent workflows remain unchanged --
changes merge back via pull request, preserving code review policies. Configure with
bd config set sync.branch beads-sync.
Beads was designed from the ground up for AI coding agents. The workflow loop is
simple: check what's ready, claim a task, do the work, close it. Context injection
via bd prime keeps agent overhead to 1-2k tokens versus 10-50k for
full MCP tool schemas.
bd setup claude installs SessionStart and PreCompact hooks that auto-inject context. Only 1-2k tokens overhead. Works with any agent that can run shell commands.
The beads-mcp integration exposes bd commands as MCP tools for environments without shell access (Claude Desktop). Higher context overhead from tool schemas.
Automatically summarizes old closed tasks to save context window. Compacts detailed task histories into concise summaries, preserving essential information while freeing tokens.
| Agent | Integration | Setup Command |
|---|---|---|
| Claude Code | CLI + Hooks (SessionStart, PreCompact) | bd setup claude |
| GitHub Copilot | CLI with JSON output | bd setup copilot |
| Aider | CLI integration | bd setup aider |
| JetBrains Junie | Plugin integration | Via integrations/junie |
| Custom Agent | MCP Server or CLI --json | bd prime |
Under the hood, Beads uses a single-owner goroutine pattern for flush management, debounced writes for performance, and a modular package structure that cleanly separates concerns across 29 internal packages.
The FlushManager uses Go's channel-based concurrency model. One background goroutine
exclusively owns the mutable state (isDirty, debounceTimer).
All other goroutines communicate via buffered channels. Timer callbacks send events
to timerFiredCh instead of directly modifying state, preventing races.
Debounce resets on each mark; flush occurs after the last modification settles.
Bidirectional sync with Jira via internal/jira. Import existing issues, map priorities, and maintain links between Beads and Jira issue IDs.
Import and sync with GitLab issue trackers via internal/gitlab. Supports project-level and group-level issue mapping.
Connect with Linear's modern issue tracking. Import issues, teams, and project structures via internal/linear.
The repository is organized as a standard Go project with cmd/bd as the
binary entrypoint and internal/ containing 29 private packages. The codebase
also includes integration plugins, an npm distribution package, and comprehensive test suites.
| Package | Purpose | Category |
|---|---|---|
beads |
Main application logic and orchestration | Core |
types |
Shared type definitions (Issue, Dependency, Event) | Core |
query |
SQL query builder for Dolt | Query |
formula |
Formula evaluation for advanced workflows | Core |
molecules |
Molecule/Proto/Wisp lifecycle management | Core |
storage |
Data persistence layer abstraction | Storage |
doltserver |
Dolt database server integration | Storage |
idgen |
Adaptive hash ID generation (birthday paradox) | Core |
git |
Git operations, worktrees, auto-commit | Integration |
routing |
Request routing and middleware | Infra |
compact |
Semantic memory decay / compaction | Memory |
audit |
Audit logging for all mutations | Ops |
telemetry |
Usage metrics and observability | Ops |
hooks |
Git and session hook management | Integration |
npm install -g @beads/bd -- platform-specific binary via the npm-package/ wrapper.
brew install beads -- macOS and Linux via Homebrew tap.
go install github.com/steveyegge/beads/cmd/bd@latest -- direct from source.