Skip to main content

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:
Times key operations (bd ready, bd list, bd show), collects system info, and generates CPU profile.

Specific Check Mode

Run a specific check in detail:

Deep Validation Mode

Validate full graph integrity (may be slow):
Additional checks:
  • Parent consistency
  • Dependency integrity
  • Epic completeness
  • Agent bead integrity
  • Mail thread integrity
  • Molecule integrity

Server Mode

Health checks for Dolt server connections:
Checks:
  • 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):
Includes:
  • Observed vs expected state
  • Full prose explanations
  • Exact remediation commands
  • Source file references
  • Severity levels

Flags

Examples

Basic Health Check

Output:

Fix All Issues

Prompts for confirmation before making changes:

Preview Fixes

Shows what would be fixed without making changes.

Fix Without Confirmation

For automation/CI:

Clean Up Classic Artifacts

After migrating to Dolt:

Remove Test Pollution

Performance Diagnostics

Generates report with:
  • Operation timings
  • System info
  • CPU profile
  • Database stats

Export for Bug Reports

Saves full diagnostic report with timestamp and platform info.

Validate Dolt Migration

Before migration:
Verifies:
  • JSONL file valid
  • All issues present
  • No blocking issues
After migration:
Verifies:
  • 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:
Check names are converted to slugs: “Git Hooks” → “git-hooks”. To unsuppress:

Troubleshooting

”Not in a beads repository”

Cause: No .beads/ directory found Solution: Run bd 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 passed
  • 1: One or more checks failed

See Also