| name | beads-expert |
| description | Expert guidance for Beads (bd) - a Git-backed issue tracker for AI-supervised coding workflows. Use when working with bd CLI commands, MCP tools, hooks, issue tracking, dependencies, workflows, or troubleshooting beads. Covers CLI reference, MCP server integration, Claude Code hooks, event-driven automation, and multi-session context management. |
| allowed-tools | Read, Grep, Glob, WebFetch, WebSearch, Write, Edit, Bash, mcp__beads__* |
Beads Expert
Purpose
Provide expert guidance for Beads (bd) - a distributed, Git-backed graph issue tracker designed specifically for AI agents. Beads provides persistent, structured memory for coding agents, replacing messy markdown plans with a dependency-aware graph.
Expertise
- bd CLI commands and workflows
- MCP server tools and integration
- Claude Code hooks and event-driven automation
- Issue lifecycle management (create, update, close, reopen)
- Dependency tracking (blocks, related, parent-child, discovered-from)
- Git synchronization and JSONL storage
- Multi-session context management
- Compaction and memory decay
- Troubleshooting and diagnostics
When to Invoke
Invoke this skill when the user:
- Uses bd CLI commands or asks about beads
- Works with issue tracking in AI workflows
- Configures MCP server or hooks
- Manages dependencies between issues
- Needs to sync issues with git
- Asks about
bd ready, bd create, bd update, bd close
- Troubleshoots beads integration
- Wants event-driven automation with hooks
Installation
npm install -g @beads/bd
brew install steveyegge/beads/bd
go install github.com/steveyegge/beads/cmd/bd@latest
pip install beads-mcp
uv pip install beads-mcp
bd init
Core Concepts
Architecture
Beads Architecture:
┌─────────────────────────────────────────────────────────┐
│ Claude Code │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ bd CLI │ │ MCP Server │ │ Hooks │ │
│ │ (direct) │ │ (tools) │ │ (events) │ │
│ └──────┬───────┘ └──────┬───────┘ └──────┬───────┘ │
└─────────┼─────────────────┼─────────────────┼──────────┘
│ │ │
▼ ▼ ▼
┌─────────────────────────────────────────────────────────┐
│ bd Daemon (optional) │
│ Auto-sync, background ops │
└─────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ .beads/ │
│ ├── beads.db (SQLite - local cache, not committed)│
│ └── issues.jsonl (Git-tracked source of truth) │
└─────────────────────────────────────────────────────────┘
Issue Types
| Type | Purpose |
|---|
bug | Something broken that needs fixing |
feature | New functionality |
task | Work item (tests, docs, refactoring) |
epic | Large feature composed of multiple issues |
chore | Maintenance work (dependencies, tooling) |
Issue Statuses
| Status | Description |
|---|
open | Ready to be worked on |
in_progress | Currently being worked on |
blocked | Cannot proceed (waiting on dependencies) |
deferred | Deliberately postponed for later |
closed | Work completed |
tombstone | Deleted issue (suppresses resurrections) |
pinned | Stays open indefinitely (hooks, anchors) |
Priorities
| Priority | Description |
|---|
0 (P0) | Critical (security, data loss, broken builds) |
1 (P1) | High (major features, important bugs) |
2 (P2) | Medium (default, nice-to-have) |
3 (P3) | Low (polish, optimization) |
4 (P4) | Backlog (future ideas) |
Dependency Types
| Type | Effect | Use Case |
|---|
blocks | Hard dependency, affects ready queue | Issue X must complete before Y |
related | Soft link, informational | Issues are connected |
parent-child | Epic/subtask hierarchy | Epic contains subtasks |
discovered-from | Work found during other work | Bug found while implementing feature |
Only blocks dependencies affect the bd ready queue.
CLI Reference
Finding Work
bd ready --json
bd stale --days 30 --json
bd list --status open --priority 1 --json
bd list --assignee alice --type bug --json
bd list --label bug,critical --json
bd list --label-any frontend,backend --json
Creating Issues
bd create "Issue title" -t bug|feature|task -p 0-4 --json
bd create "Fix auth bug" -t bug -p 1 -d "Description here" --json
bd create "Issue title" -t bug -p 1 -l bug,critical --json
bd create "Found bug" -t bug -p 1 --deps discovered-from:bd-123 --json
bd create "Auth System" -t epic -p 1 --json
bd create "Login UI" -p 1 --parent bd-a3f8e9 --json
bd create "Backend validation" -p 1 --parent bd-a3f8e9 --json
bd create "Issue title" --body-file=description.md --json
echo "Description" | bd create "Title" --body-file=- --json
Updating Issues
bd update bd-42 --status in_progress --json
bd update bd-42 --priority 1 --json
bd update bd-41 bd-42 bd-43 --priority 0 --json
bd update bd-42 --assignee alice --json
Completing Work
bd close bd-42 --reason "Completed" --json
bd close bd-41 bd-42 bd-43 --reason "Batch completion" --json
bd reopen bd-42 --reason "Needs more work" --json
Dependencies
bd dep add bd-101 bd-100 --type blocks
bd dep add bd-101 bd-100 --type discovered-from
bd dep tree bd-42
bd blocked --json
Labels
bd label add bd-41 bd-42 bd-43 urgent --json
bd label remove bd-42 urgent --json
bd label list bd-42 --json
bd label list-all --json
Sync Operations
bd sync
bd sync --status
bd import -i .beads/issues.jsonl
bd import -i .beads/issues.jsonl --force
Information Commands
bd show bd-42 --json
bd show bd-41 bd-42 bd-43 --json
bd stats --json
bd info --json
Global Flags
bd --json <command>
bd --sandbox <command>
bd --allow-stale <command>
bd --actor alice <command>
MCP Server Integration
Available MCP Tools
The beads MCP server provides these tools:
| Tool | Description |
|---|
context | Set workspace root for operations |
discover_tools | List available tools (names only) |
get_tool_info | Get detailed info for specific tool |
init | Initialize bd in current directory |
create | Create new issue |
list | List issues with filters |
ready | Find tasks with no blockers |
show | Show detailed issue info |
update | Update issue fields |
close | Close completed issue |
reopen | Reopen closed issue |
dep | Add dependency |
blocked | Get blocked issues |
stats | Get project statistics |
admin | Administrative operations |
MCP Context Management
mcp__beads__context(workspace_root='/path/to/project')
mcp__beads__ready()
mcp__beads__create(title="New task", issue_type="task", priority=2)
Context Optimization
The MCP server uses lazy tool schema loading:
- Use
discover_tools() to see available tools (names only)
- Use
get_tool_info(tool_name) for specific tool details
- This reduces context from ~10-50k tokens to ~2-5k tokens
MCP Resources
beads://quickstart - Interactive quickstart guide
Hooks and Event-Driven Automation
Claude Code Hooks
Beads integrates with Claude Code through hooks:
{
"hooks": {
"SessionStart": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "bd prime"
}
]
}
],
"PreCompact": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "bd prime"
}
]
}
]
}
}
Hook Events
| Event | Trigger | Use Case |
|---|
SessionStart | When Claude Code session begins | Load workflow context |
PreCompact | Before context compaction | Preserve workflow instructions |
Installing Hooks
bd setup claude
bd setup claude --project
bd setup claude --stealth
bd setup claude --check
bd setup claude --remove
bd prime Command
The bd prime command outputs workflow context (~1-2k tokens):
- Current project status
- Ready work summary
- Workflow instructions
- Essential commands
This is more context-efficient than MCP tool schemas (10-50k tokens).
Workflow Patterns
Standard Agent Workflow
bd ready --json
bd update bd-42 --status in_progress --json
bd create "Found bug during work" -t bug -p 1 --deps discovered-from:bd-42 --json
bd close bd-42 --reason "Implemented and tested" --json
bd sync
Session Close Protocol
CRITICAL: Before ending any session:
git status
git add <files>
bd sync
git commit -m "..."
bd sync
git push
Work is NOT complete until git push succeeds.
Batch Operations
bd update bd-41 bd-42 bd-43 --priority 0 --json
bd close bd-41 bd-42 bd-43 --reason "Batch completion" --json
bd label add bd-41 bd-42 bd-43 urgent --json
Hierarchical Issue Creation
bd create "Auth System Overhaul" -t epic -p 1 --json
bd create "Implement OAuth" -p 1 --parent bd-a3f8 --json
bd create "Add MFA support" -p 1 --parent bd-a3f8 --json
bd create "Write tests" -p 1 --parent bd-a3f8 --json
bd create "Unit tests" -p 2 --parent bd-a3f8.3 --json
Auto-Sync with Git
Beads automatically syncs issues to .beads/issues.jsonl:
- Export: After any CRUD operation (5-second debounce)
- Import: When JSONL is newer than DB (e.g., after
git pull)
bd create "Add feature" -p 1
git add .beads/issues.jsonl
git commit -m "Add feature tracking"
git pull
bd ready
Important Git Rules
- Always commit
.beads/issues.jsonl with code changes
- Never commit
.beads/beads.db (SQLite cache)
- Run
bd sync at end of sessions
Troubleshooting
Common Issues
Plugin not appearing:
- Check installation:
/plugin list
- Restart Claude Code
- Verify
bd is in PATH: which bd
- Check uv is installed:
which uv
MCP server not connecting:
- Check MCP server list:
/mcp
- Restart Claude Code
- Check logs for errors
Staleness errors:
bd import -i .beads/issues.jsonl --force
bd --allow-stale ready --json
Sandboxed environments:
bd --sandbox <command>
bd --no-daemon --no-auto-flush --no-auto-import <command>
Missing parent errors during import:
bd import -i issues.jsonl --orphan-handling allow
bd import -i issues.jsonl --orphan-handling resurrect
bd import -i issues.jsonl --orphan-handling strict
Diagnostics
bd info --json
bd admin validate --json
bd daemons health --json
bd daemons logs /path/to/workspace -n 100
Configuration
Environment Variables
| Variable | Description | Default |
|---|
BEADS_PATH | Path to bd executable | bd in PATH |
BEADS_DB | Path to database file | Auto-discover |
BEADS_ACTOR | Actor name for audit | $USER |
BEADS_NO_AUTO_FLUSH | Disable auto JSONL sync | false |
BEADS_NO_AUTO_IMPORT | Disable auto JSONL import | false |
BEADS_WORKING_DIR | Working directory | Current dir |
MCP Compaction Settings
| Variable | Description | Default |
|---|
BEADS_MCP_COMPACTION_THRESHOLD | Compact results with >N issues | 20 |
BEADS_MCP_PREVIEW_COUNT | Show first N issues in preview | 5 |
Best Practices
For AI Agents
- Always use
--json flag for programmatic access
- Use
bd ready first to find available work
- Link discovered work with
--deps discovered-from:<parent>
- Run
bd sync at end of sessions to push changes
- Never create markdown TODO lists - use bd instead
For Multi-Session Work
- Check
bd ready at session start
- Update status to
in_progress when claiming work
- Create issues for discovered work instead of notes
- Close issues with reasons for audit trail
- Always sync and push before ending session
Context Efficiency
- Prefer CLI + Hooks over MCP when shell is available
- Use
bd prime for context injection (~1-2k tokens)
- Use MCP
discover_tools() instead of loading all schemas
- Set workspace context once then reuse
Resources
- Repository: https://github.com/steveyegge/beads
- Documentation: See docs/ in repository
- CLI Reference: docs/CLI_REFERENCE.md
- MCP Server: integrations/beads-mcp/
- Plugin: .claude-plugin/