| name | br |
| description | Use br (beads_rust) as the local issue tracker for AI coding agents. Trigger when the user mentions issues, tickets, backlog, triage, dependencies, blocking, ready work, or any task involving tracking work items in a git repo. Also trigger when the user wants to plan work, pick next tasks, manage a dependency graph of issues, or coordinate across multiple agents. Use this skill for commands like br create, br ready, br close, br dep, br sync, and any br CLI interaction. Even if the user just says "what should I work on next" or "create a ticket for this", use this skill to ensure correct br usage patterns. |
br — Local-First Issue Tracker for AI Agents
br is a CLI issue tracker (binary: br) that stores issues in SQLite with JSONL
export for git collaboration. It's designed specifically for AI coding agents
with structured JSON output, dependency-aware work queues, and non-invasive
operation.
Critical Rules
These rules exist because violating them causes real problems in agent
workflows — broken sync, blocked sessions, or corrupted data:
| Rule | Why it matters |
|---|
Binary is br (never bd) | bd is the original Go version — it has different behavior |
Always use --json | Structured output for parsing; human output formats change |
Never run bare bv | bv is an interactive TUI that blocks the agent session forever |
| Sync is explicit | br sync --flush-only exports DB to JSONL — nothing else does |
| Git is your job | br never runs git commands — you must git add .beads/ && git commit |
| No dependency cycles | br dep cycles must always return empty or the ready queue breaks |
| Set actor identity | Use --actor "$ACTOR" or BR_ACTOR env var for audit trail attribution |
| Suppress Rust noise | RUST_LOG=error br ... keeps stderr clean for agent parsing |
Standard Workflow
This is the lifecycle every issue follows. Agents should stick to this pattern
to maintain a clean backlog and reliable sync state:
ACTOR="${BR_ACTOR:-assistant}"
br ready --json
br update --actor "$ACTOR" <id> --claim
br create --actor "$ACTOR" "Edge case found" -t bug -p 1 \
--deps discovered-from:<id> --json
br close --actor "$ACTOR" <id> --reason "Implemented X in commit abc123"
br sync --flush-only
git add .beads/ && git commit -m "Update issues"
Essential Commands
All commands below accept --json for structured output. Always use it when
the output will be parsed programmatically.
Issue Lifecycle
ACTOR="${BR_ACTOR:-assistant}"
br init
br create --actor "$ACTOR" "Title" -p 1 -t task
br q --actor "$ACTOR" "Quick note"
br show <id> --json
br update --actor "$ACTOR" <id> --status in_progress
br update --actor "$ACTOR" <id> --priority 0
br update --actor "$ACTOR" <id> --claim
br close --actor "$ACTOR" <id> --reason "Done"
br close --actor "$ACTOR" <id1> <id2> --reason "..."
br reopen --actor "$ACTOR" <id>
Creating Issues
br create --actor "$ACTOR" "Title" \
--priority 1 \
--type task \
--assignee "user@..." \
--labels backend,auth \
--description "..."
Querying
br ready --json
br list --json
br list --status open --sort priority --json
br list --priority 0-1 --json
br list --assignee alice --json
br blocked --json
br search "keyword" --json
br show <id> --json
br stale --days 30 --json
br count --by status --json
Dependency Management
The dependency graph is what makes br powerful for agents — it answers "what
can I work on right now?" without human triage.
br dep add <child> <parent>
br dep add <id> <dep> --type blocks
br dep remove <child> <parent>
br dep list <id> --json
br dep tree <id> --json
br dep cycles --json
When closing an issue, use --suggest-next to discover newly-unblocked work:
br close --actor "$ACTOR" <id> --reason "Done" --suggest-next --json
Labels and Comments
br label add <id> backend auth
br label remove <id> urgent
br label list <id>
br label list-all
ACTOR="${BR_ACTOR:-assistant}"
br comments add --actor "$ACTOR" <id> --message "Note" --json
br comments list <id> --json
Sync (Explicit — Never Automatic)
br separates tracking (SQLite) from collaboration (JSONL via git). You must
bridge them explicitly:
br sync --flush-only
br sync --import-only
br sync --status
After making changes:
br sync --flush-only
git add .beads/ && git commit -m "Update issues"
After pulling from remote:
git pull
br sync --import-only
Diagnostics
br doctor
br stats --json
br config list
br config get id.prefix
br config set defaults.priority=1
br where
br version
br lint --json
Priority Scale
| # | Meaning | When to use |
|---|
| 0 | Critical | Production down, data loss, security issue |
| 1 | High | Important, should be done soon |
| 2 | Medium | Default — normal work |
| 3 | Low | Nice to have, when time permits |
| 4 | Backlog | Future consideration, not planned |
Issue Types
task, bug, feature, epic, question, docs
Output Formats
| Flag | Use case |
|---|
--json | Default for agents — full structured data |
--format toon | Token-optimized (decode with tru --decode | jq) |
| (no flag) | Human-readable with colors — for user display only |
bv Integration (beads_viewer)
CRITICAL: Never run bare bv — it launches an interactive TUI that blocks
the agent session. Always use robot-mode flags:
bv --robot-next
bv --robot-triage
bv --robot-plan
bv --robot-insights | jq '.Cycles'
bv --robot-priority
bv --robot-alerts
Error Handling
br uses structured exit codes and JSON error objects:
| Code | Category | Example |
|---|
| 0 | Success | Command completed |
| 1 | Internal | Unexpected error |
| 2 | Database | Not initialized, locked |
| 3 | Issue | Not found, ambiguous ID |
| 4 | Validation | Invalid priority value |
| 5 | Dependency | Cycle detected |
| 6 | Sync/JSONL | Parse error |
| 7 | Config | Missing configuration |
| 8 | I/O | File system error |
Error JSON shape (on stderr or stdout depending on command):
{
"error_code": 3,
"kind": "not_found",
"message": "Issue not found: bd-xyz999",
"recovery_hints": ["Check the issue ID spelling", "Use 'br list' to find valid IDs"]
}
Always check exit codes before parsing output. The recovery_hints array
contains actionable suggestions the agent can follow to self-recover.
Session End Checklist
Before ending any work session, run this sequence to ensure clean state:
br sync --flush-only
git add .beads/ && git commit -m "Update issues"
git status
Triage Decision Matrix
When classifying issues during triage, each issue goes into exactly one bucket:
| Classification | Action |
|---|
| Implemented | Close with evidence (commit hash, PR, file path) |
| Out of scope | Close with explicit boundary reason |
| Needs clarification | Add a comment with specific unanswered questions |
| Actionable | Keep open; correct status/priority/labels/dependencies |
During large triage efforts, checkpoint every few updates:
br ready --json && br blocked --json
Anti-Patterns
Avoid these — they cause real problems:
- Running
br sync without --flush-only or --import-only (undefined behavior)
- Forgetting sync before git commit (other agents can't see your changes)
- Creating circular dependencies (breaks the ready queue)
- Running bare
bv (blocks the agent session)
- Assuming br auto-commits (it never does)
- Inventing evidence for closure — if unsure, add a comment instead
- Modifying unrelated issues during triage (scope creep)
- Adding speculative dependencies (over-constrains the graph)
Storage Layout
.beads/
beads.db # SQLite database (primary source of truth)
beads.db-shm # SQLite shared memory (WAL mode)
beads.db-wal # SQLite write-ahead log
issues.jsonl # JSONL export (for git collaboration)
config.yaml # Project configuration
metadata.json # Workspace metadata
Quick Troubleshooting
br doctor
br dep cycles
br config list
which br
"Database locked": Another br process is running. Check with pgrep -f "br ".
"Not initialized": Run br init in the repo root.
Verbose debugging: RUST_LOG=debug br <command> or br -vv <command>.