Skip to main content
One agent often works across more than one repository: an OSS fork plus a private planning repo, a planning repo feeding an implementation repo, several project checkouts on one machine. Routing decides which repository’s database receives each new bead, so a contributor’s planning never pollutes upstream PRs while a maintainer’s beads land straight in the project. Routing is opt-in. With no routing configuration, every bead lands in the current repository — nothing on this page changes single-repo workflows.

The contributor problem

You fork an OSS project that uses beads. Every planning bead you create writes to the fork’s .beads/ data, and your fork’s issue database now diverges from upstream in every PR you open. What you want is to plan freely about the project without planning in the project. Routing solves this by detecting your role and redirecting bd create to a separate planning repository (~/.beads-planning by default) that is never pushed upstream.

How routing decides

When you run bd create, the target repository is chosen in strict precedence order:
  1. --repo <path> — explicit override, always wins
  2. routing.mode: auto — route by detected role (maintainer or contributor)
  3. routing.default — everything else (defaults to ., the current repo)
Reads follow the same routing: with routing active, bd list and bd ready read from the routed repository, and ID lookups like bd show fall back to the routed repository when a bead isn’t found locally. Commands that change an existing bead (bd update, bd close, bd comment, bd unclaim, bd mol bond and the like) follow every route, contributor, maintainer and default alike, opening the routed repository for writing so the change commits there. A routed write never creates the routed repository’s database: if that repository has not been bootstrapped yet, the write fails until you run bd bootstrap there. A routed write also refuses a repository whose .beads/metadata.json is unreadable or names no dolt_database, instead of guessing which database to write. Through these routes a repository with no metadata.json at all, such as a planning repository nothing has been created in yet, opens the one embedded database it holds, or its default database when it holds none or several; a prefix route in an orchestrator’s routes.jsonl always needs the target’s dolt_database, for reads as well as writes. On a proxied-server launcher, bd mol bond looks an operand up in the served database first and then through its prefix route, so a formula can be bonded to a molecule that a routed rig holds. Both operands must live in the same place: the bond is written in the rig’s own database when both are there (or one is a formula), and in the served database when both are there. A bond across the served database and a rig, or across two rigs, is refused; run it from the rig that owns both. A rig that is itself a proxied-server workspace cannot be opened through a route, so bond in that rig directly.

Looking up a bead in another store by prefix

A workspace can also send lookups to another store by ID prefix, through a routes.jsonl file in its .beads/ directory. This is how a seat attached to one store reads a bead that lives in a sibling store on the same server, such as a rig seat reading the town’s hq- beads:
With that route, bd show hq-gea4h run from the rig finds no hq-gea4h in the rig’s store, follows the route, and reads the bead from the town’s store, which is opened read-only for the lookup. How the lookup works:
  • Only the resolved workspace’s routes.jsonl is read: the .beads/ directory the command runs against, after any .beads/redirect is followed. bd does not search parent directories for routes, and does not discover other databases on a shared Dolt server.
  • A route’s prefix must end in -; an entry without the trailing hyphen matches nothing. When several routes match, the longest prefix wins (hq-cv- over hq-).
  • path is relative to the directory that contains the resolved .beads/ (the rig directory above, so .. is the town). The target’s .beads/ may itself be a redirect, which is followed.
  • The target’s .beads/metadata.json must name its dolt_database.
  • A route whose path is . names the current store, so it sends the lookup nowhere new.
  • Routes apply to commands that change an existing bead (bd update, bd close, …) too, which open the routed store for writing. Adding a route is broader than a shortcut for bd show.
In an embedded or server-mode workspace, when no route or auto-route searched another store and the ID’s prefix is not among the current store’s configured prefixes (issue_prefix and allowed_prefixes), bd show says so instead of suggesting the bead never existed:
A proxied-server workspace, or one connected to bd serve over HTTP, prints the general not-found hint instead.

Role detection

The role that drives auto mode comes from git config — beads.role is the source of truth:
When beads.role is unset, bd prints a warning and falls back to a deprecated remote-URL heuristic:
SSH does not reliably indicate push access — fork contributors often clone over SSH. Set beads.role explicitly and the heuristic (and its warning) never runs.

Setup

Contributors

The interactive wizard:
  1. Creates the planning repository (~/.beads-planning by default) as its own git repo with a .beads/ directory
  2. Sets routing.mode: auto and routing.contributor to the planning repo
  3. Adds the planning repo to repos.additional so routed beads stay visible (see hydration)
  4. On forks, points sync at the upstream remote so bd dolt pull fetches issue data from the source repo rather than your fork
Plain bd init also detects the fork pattern (an upstream remote that differs from origin) and applies the same contributor configuration automatically; pass --role maintainer to opt out.

Teams

Teams sharing one repository usually need no routing: with routing unset, every bead lands in the shared repo. The team wizard configures the rest of the shared workflow — team mode and, for protected-main setups, a separate sync branch for issue commits. Team members who want a private scratch space route experiments explicitly:
Full step-by-step walkthroughs for both scenarios (plus multi-phase and multi-persona setups) live in Multi-Repo Migration.

Configuration reference

Set these with bd config set <key> <value>; see the configuration reference for storage locations. Verify the effective configuration and where each value comes from:

Overriding per bead

--repo bypasses routing entirely for one bead:

Discovered work stays with its parent

A bead created with a discovered-from dependency inherits its parent’s source_repo, so work discovered while executing a task stays attributed to the same repository as that task — regardless of your role:
Add --repo to override the inheritance.

Multi-repo hydration

Routing writes beads to another repository — which means your current database doesn’t contain them. Hydration imports beads from other repos into your database, each tagged with its source_repo, so bd list and bd ready show one unified view. Configure it by listing the other repos in repos.additional:
bd repo sync reads each additional repo’s .beads/issues.jsonl export and imports the beads with their original prefixes and source_repo set, skipping repos whose export hasn’t changed. bd init --contributor wires hydration up automatically; bd doctor warns when routing targets are missing from repos.additional. Once hydrated, beads from other repos are ordinary rows in your database — filter by provenance or link them with normal dependencies:
For dependencies on capabilities of another project rather than specific beads, bd dep add also accepts external:<project>:<capability> targets — see bd dep.

One agent, many projects

An AI agent working across several repositories should run a single beads MCP server instance:
The server resolves the beads workspace from each request’s working directory, so one configuration serves every project while each project keeps its own isolated database (embedded Dolt at .beads/embeddeddolt/ by default; server mode uses .beads/dolt/). Running one MCP instance per project invites operations landing in the wrong database. To share one Dolt server across all projects instead of embedded per-project storage, initialize with bd init --shared-server (or set BEADS_DOLT_SHARED_SERVER=1): projects share a server at ~/.beads/shared-server/ while staying isolated in per-project databases named after their issue prefixes. See MCP Server for installation and client configuration.

Troubleshooting

Beads land in the wrong repository

Fix by setting the role explicitly (bd config set beads.role maintainer), forcing the target for one bead (--repo .), or disabling role detection entirely (bd config set routing.mode explicit).

Routed beads don’t appear in bd list

The routing target isn’t being hydrated. Add it and sync:
bd doctor catches this misconfiguration.

bd show says an ID’s prefix is not among this store’s prefixes

The ID belongs to a store this workspace did not search. Run the command from a workspace attached to the store that issues the prefix, or add a prefix route to this workspace’s routes.jsonl (see Looking up a bead in another store by prefix). The hint is not printed when a route or auto-route did search another store and missed there too.

Discovered beads appear in the “wrong” repo

Intentional — beads with a discovered-from dependency inherit the parent’s source_repo. Override with --repo at creation time.

Planning beads show up in upstream PRs

The planning repo must be a separate git repository, never committed to the fork:

Role warning on every bd create

bd warns when it falls back to the URL heuristic. Silence it permanently: