Why agents need Beads
AI coding agents face unique challenges:- Context loss: Session boundaries and token limits cause agents to forget previous work
- No structured planning: Markdown TODO lists are unstructured and hard to query
- No dependency tracking: Can’t determine what’s ready to work on
- Merge conflicts: Multiple agents or sessions create conflicting task lists
- Persistent memory: Dolt-backed database survives sessions and account rotations
- Dependency tracking: Automatically detects ready work with
bd ready - Zero conflicts: Hash-based IDs prevent merge collisions
- Structured queries: JSON output for programmatic use
Basic agent workflow
A typical agent session follows this pattern:1
Check for ready work
Start by finding unblocked tasks:This returns issues with no open blockers, sorted by priority.
Example output
Example output
2
Claim the task atomically
Use This prevents multiple agents from working on the same task.
--claim to atomically set assignee and status:3
Work on the task
Implement, test, and document the feature. As you discover new work, create linked issues:The
discovered-from dependency links the new issue to the parent task.4
Complete the task
When finished, close the issue:Any dependencies on this task are now unblocked.
Discovered work pattern
When agents discover new work during implementation, they should link it to the parent:Session completion protocol
When ending a work session, agents should:1
File remaining work
Create issues for anything that needs follow-up:
2
Update issue status
Close finished work, update in-progress items:
3
Push to remote
Ensure all changes are pushed:
4
Provide handoff context
Choose next work and provide context:Return a summary and prompt for the next session:
“Continue work on bd-d4f9: Add rate limiting. Authentication is complete (bd-a3f8), need to implement rate limiting middleware and tests.”
Using bd prime for context
Thebd prime command generates a context dump for agents:
- Ready work (unblocked tasks)
- Current work (in-progress issues)
- Recent activity
- Project statistics
- Stored memories (from
bd remember)
Example bd prime output
Example bd prime output
Non-interactive commands only
Always usebd update with flags:
Agent-specific flags
Always use these flags for programmatic use:--json: Machine-readable output--quiet: Suppress progress messages--no-color: Disable color codes--claim: Atomically claim tasks
Multi-agent coordination
When multiple agents work on the same project:Use atomic claim
Always claim with--claim to prevent conflicts:
Sync frequently
Pull before checking ready work:Use dependencies to coordinate
Block dependent work:Error handling
Agents should handle common errors:Issue already claimed
Merge conflicts
Database locked
Integration with Claude, Copilot, Aider
See the Integrations section for tool-specific setup:Claude
CLI + hooks approach with automatic context injection
Copilot
MCP server for GitHub Copilot and VS Code
Aider
Human-in-the-loop workflow with /run commands
Best practices
Do
- ✅ Always use
--jsonfor programmatic output - ✅ Use
--claimfor atomic task assignment - ✅ Link discovered work with
discovered-from - ✅ Check
bd readybefore asking for work - ✅ Push frequently to avoid conflicts
- ✅ Use
bd primefor session context
Don’t
- ❌ Don’t use
bd edit(interactive) - ❌ Don’t parse human-readable output
- ❌ Don’t forget to push at session end
- ❌ Don’t create duplicate tracking (markdown TODOs)
- ❌ Don’t skip
--claimwhen starting work
See also
- Quickstart - Get started with Beads
- CLI Reference - Complete command reference
- Integrations - Tool-specific setup
- Molecules - Advanced workflow management