Overview
Sanity check the beads installation for the current directory or specified path. Detects configuration issues, missing dependencies, database problems, and more. Can automatically fix many issues.Syntax
What It Checks
Core
- ✓ .beads/ directory exists
- ✓ Database version and migration status
- ✓ Schema compatibility (all required tables and columns)
- ✓ ID format (hash-based vs sequential)
- ✓ CLI version is current (checks GitHub releases)
- ✓ File permissions
- ✓ Dolt format compatibility
- ✓ Database integrity
Data
- ✓ Configuration consistency
- ✓ Configuration value validation
- ✓ Remote consistency (SQL vs CLI)
- ✓ Circular dependencies
- ✓ Orphaned dependencies
- ✓ Duplicate issues
- ✓ Test pollution
- ✓ Database size and pruning recommendations
Git Integration
- ✓ Git hooks installed (pre-commit, post-merge, pre-push)
- ✓ .beads/.gitignore up to date
- ✓ Project-root .gitignore has Dolt exclusions
- ✓ Redirect files not tracked
- ✓ Redirect targets valid
- ✓ No vestigial sync worktrees
- ✓ Working tree cleanliness
- ✓ Upstream sync status
- ✓ Orphaned issues (referenced in commits but still open)
Claude Integration
- ✓ Claude integration configured
- ✓ Claude settings file health
- ✓ Claude hook completeness
- ✓ bd prime output verification
- ✓ bd in PATH
- ✓ Documentation bd prime references
- ✓ Agent documentation presence
- ✓ Claude plugin version (in Claude Code)
Dolt Backend
- ✓ Dolt connection health
- ✓ Dolt schema valid
- ✓ Dolt issue count matches
- ✓ Dolt server status
- ✓ Lock health
- ✓ Pending migrations
- ✓ Classic artifacts (post-migration cleanup)
Federation
- ✓ RemotesAPI port accessibility
- ✓ Peer connectivity
- ✓ Sync staleness
- ✓ Conflict detection
- ✓ Server mode mismatch
Maintenance
- ✓ Stale closed issues
- ✓ Stale molecules
- ✓ Persistent mol- issues
- ✓ Legacy merge queue files
- ✓ Patrol pollution
- ✓ Merge artifacts
- ✓ KV store sync status
Modes
Standard Mode
Run all checks and report issues:Fix Mode
Automatically fix issues where possible:Performance Mode
Run performance diagnostics:Specific Check Mode
Run a specific check in detail:Deep Validation Mode
Validate full graph integrity (may be slow):- Parent consistency
- Dependency integrity
- Epic completeness
- Agent bead integrity
- Mail thread integrity
- Molecule integrity
Server Mode
Health checks for Dolt server connections:- Server reachable
- Dolt version (not vanilla MySQL)
- Database exists
- Schema compatible
- Connection pool health
Migration Validation Mode
Validate Dolt migrations:Agent Mode
Output diagnostics for AI agent consumption (ZFC-compliant):- Observed vs expected state
- Full prose explanations
- Exact remediation commands
- Source file references
- Severity levels
Flags
| Flag | Description |
|---|---|
--fix | Automatically fix issues |
--yes, -y | Skip confirmation prompts |
--interactive, -i | Confirm each fix individually |
--dry-run | Preview fixes without making changes |
--fix-child-parent | Remove child→parent dependencies (opt-in) |
--verbose, -v | Show all checks (default: only warnings/errors) |
--perf | Run performance diagnostics |
--output <file> | Export diagnostics to JSON file |
--check <name> | Run specific check (artifacts, pollution, validate) |
--clean | Delete detected items (with —check) |
--deep | Full graph integrity validation |
--server | Dolt server health checks |
--migration <phase> | Migration validation (pre or post) |
--agent | Agent-facing diagnostic mode |
--json | Machine-readable output |
Examples
Basic Health Check
Fix All Issues
Preview Fixes
Fix Without Confirmation
For automation/CI:Clean Up Classic Artifacts
After migrating to Dolt:Remove Test Pollution
Performance Diagnostics
- Operation timings
- System info
- CPU profile
- Database stats
Export for Bug Reports
Validate Dolt Migration
Before migration:- JSONL file valid
- All issues present
- No blocking issues
- Dolt database healthy
- All issues migrated
- No data loss
- No uncommitted changes
Fixing Issues
Automatic Fixes
bd doctor --fix can automatically repair:
- Missing git hooks
- Outdated .gitignore files
- Orphaned dependencies
- Test pollution
- Duplicate issues (merges them)
- Stale lock files
- Remote inconsistencies
- Classic artifacts
Manual Fixes Required
Some issues require manual intervention:- Circular dependencies (break the cycle)
- Database version mismatches (run migrations)
- Permission errors (fix file permissions)
- Dolt connection failures (start server)
- Configuration conflicts (resolve manually)
Suppressing Warnings
Suppress specific warnings via config:Troubleshooting
”Not in a beads repository”
Cause: No .beads/ directory found Solution: Runbd init or specify path: bd doctor /path/to/repo
”Database version mismatch”
Cause: CLI version doesn’t match database version Solution:“Cannot open database”
Cause: Database file locked or corrupted Solution:“Git hooks not working”
Cause: Hooks not installed or incorrect Solution:“Dolt server not reachable”
Cause: Server not running Solution:Exit Codes
0: All checks passed1: One or more checks failed
Related Commands
bd hooks- Manage git hooks directlybd migrate- Run database migrationsbd dolt- Dolt server managementbd backup- Create backups before repairs