sync

sync is a command for Claude Code from gastownhall/beads. It costs 9 tokens per session (1,168 once invoked), scanned A, original, MIT.

A command that synchronizes issues between copies of a Beads project through a configured Dolt remote. Dolt is a version-controlled database used here to share issue data across machines.

In plain words
What is it for?
Run synchronization manually or on a timer, choose a remote, retry push races, and use exit codes or JSON output in automation.
Why use it?
It removes the need to write your own pull, conflict-checking, and push script for keeping multiple copies up to date.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Part of the beads plugin — 29 commands, 4 hooks shipped together

Good fit Run synchronization manually or on a timer, choose a remote, retry push races, and use exit codes or JSON output in automation.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/gastownhall/beads/sync
About the project

gastownhall/beads is a command-line graph issue tracker that gives coding agents persistent, structured memory through a dependency-aware task database. It is for developers and AI agents handling long-running work across tasks, branches, and sessions. The catalogue entries provide integrations and workflows for operating Beads with coding agents.

gastownhall/beads · 27,917 stars · on GitHub · beads.gascity.com

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/gastownhall/beads

Made for: Claude Code.

Or install beads, the plugin that ships this one along with the rest of its 29 commands, 4 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sync

README.md
[![agentmods](https://agentmods.dev/badge/commands/gastownhall/beads/sync/github.svg)](https://agentmods.dev/commands/gastownhall/beads/sync)
Your own site
<a href="https://agentmods.dev/commands/gastownhall/beads/sync"><img src="https://agentmods.dev/badge/commands/gastownhall/beads/sync/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for sync

Your own site · 80×15
<a href="https://agentmods.dev/commands/gastownhall/beads/sync"><img src="https://agentmods.dev/badge/commands/gastownhall/beads/sync.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 9 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,168 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00009 $0.01168
Opus 5.5 $0.00004 $0.00467
Sonnet 5.5 $0.00002 $0.00234
Haiku 4.5 $0.00001 $0.00117

Measured 1mo ago against content hash 09d999165b93, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

sync scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/beads/skills/beads/commands/sync.md · 110 lines

How it starts

The opening of the file, as written. The whole thing — 110 lines — stays where its author put it; the contents beside it link to each section on GitHub.

bd sync runs one full synchronization cycle against the configured Dolt remote: pull, check for merge conflicts, recompute the denormalized is_blocked flag, then push — retrying a bounded number of times when another replica wins the push race. It is the loop a multi-machine deployment otherwise hand-rolls in shell, and it is the verb to reach for on a sync timer.

(This is not the old JSONL-era bd sync, which was removed in v0.51. Nested commands such as bd backup sync and the tracker-specific sync commands are separate commands and are unaffected.)

bd sync                  # sync with the default remote
bd sync --remote mini    # sync with a specific named remote
bd sync --attempts 5     # allow more push-race retries (default 3)
bd sync --json           # machine-parseable outcome

Exit codes are the machine contract, so a timer can branch on them without parsing output:

Code Meaning
0 Synced, or nothing to do
1 Error (transport, auth, storage)
2 Merge conflict — halted, nothing pushed; resolve it by hand
3 Push-race retries exhausted — transient, retry on the next tick

Two properties are the point of the verb. Conflicts are detected positively, from the merge's own conflict rows and from Dolt's conflict tables — never inferred from the pull's exit status, which is untrustworthy in both directions. And a conflict sync cannot settle is never resolved by picking a side: it halts before recomputing or pushing, and keeps halting the same way until an operator resolves the divergence. (The pull underneath still auto-settles the convergent conflict classes it always has — machine-local metadata rows, audit-only dependency rows, last-write-wins on issue cells. Anything past those halts here.)

The halt message says which state the halt left behind, because it depends on the pull route and both are real: the SQL route aborts the conflicted merge and restores the working set, while the CLI/git-protocol route leaves the conflict rows live for you. A conflict that was already live when sync started — from an earlier halted sync or a hand-run merge — halts before the pull instead, and says that too.

The recompute between pull and push is not bookkeeping either — is_blocked is denormalized, so a dependency edge merged in from another replica leaves bd ready stale until it runs. It runs on every attempt, unconditionally: bd recompute-blocked's full pass is specifically the repair that does not depend on a merge advancing HEAD, so it is what recovers a column left stale by a conflicted pull you resolved by hand — a state sync itself creates by exiting 2. Gating it on "did this tick merge anything" would mean that repair never runs again while every tick reports success.

This is not bd federation sync, which syncs with named peer towns and takes a --strategy ours|theirs to resolve whatever conflicts it meets. bd sync targets the configured remote and has no such switch.

--json reports {"status", "attempts", "conflicts", "conflicts_live", "rows_corrected", "pushed"} on every non-error exit; exit 1 emits bd's standard {"error": ...} envelope instead, so a timer reading .status must treat null as the error case (or just branch on the exit code, which is the point). A rig with no remote configured exits 0 with setup guidance; dolt.local-only and the no-push config flag are honored.

The equivalent by hand

# Before starting work or consuming changes from another clone
bd dolt pull

# After local issue updates and before handoff: commit, integrate, then publish
bd dolt commit
bd dolt pull
bd dolt push

bd dolt commit creates an explicit commit boundary when auto-commit is off or in batch mode; it is a safe no-op when there is nothing pending. The following pull integrates remote changes before the final push. The pull steps require a configured remote; use the one-time setup below first when needed.

Inspect the configured Dolt remotes with:

Read the full file on GitHub · 110 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 110 lines · 9 tokens per session scan A 09d999165b93

Subscribe to this mod's changes

sync is a command published in the GitHub repository gastownhall/beads (27,917 stars, last pushed today), licensed MIT. It adds 9 tokens to every session and 1,168 once invoked, about $0.0000 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.