utilities

Reset Beads

Cleanly wipe the beads database and issues while preserving configuration and git tracking.

Reset Beads Database Skill

This skill enables a clean, beads-native reset of the local issue tracking database. Perfect for starting fresh while preserving your project configuration (issue prefix, sync branch, etc.).

When to Use

  • ๐Ÿ—‘๏ธ You want a completely fresh beads database
  • ๐Ÿ”„ You're reorganizing your issue structure
  • ๐Ÿงน You accumulated too many test/draft issues
  • โœจ You want to start setup from scratch
  • ๐Ÿš€ You're onboarding and want a clean slate

What Gets Wiped

โœ… Deleted:

  • SQLite database (beads.db + .shm + .wal)
  • JSONL issue store (issues.jsonl)
  • Interaction logs (interactions.jsonl)
  • Daemon state (socket, lock, pid, log files)
  • Metadata cache (last-touched)

โœ‹ Preserved (git-tracked):

  • config.yaml (your issue prefix, sync branch, etc.)
  • PRIME.md (session context)
  • scripts/ (custom automation)
  • README.md (documentation)

Quick Usage

# Run the reset skill
./.github/skills/reset-beads/reset.sh

# Verify it worked
bd status
bd list

What It Does

  1. Stops the daemon - Gracefully terminates any running beads daemon
  2. Wipes the database - Removes all SQLite files
  3. Clears issues - Truncates issues.jsonl
  4. Cleans daemon state - Removes socket, lock, and pid files
  5. Reinitializes - Runs bd status to reinitialize beads
  6. Confirms success - Shows final database status

Post-Reset Workflow

After reset, your beads configuration is fully intact:

# Your issue prefix is preserved
bd create "My first issue after reset"
# Creates: lista-1

# Your sync branch is preserved
bd config get sync.branch
# Shows: beads-sync (or whatever you configured)

# Ready to work
bd ready

Git Integration

The reset is git-clean:

  • .beads/ is already in .gitignore for database files
  • No git state is affected
  • No commits are created (you own when to commit)

Optional: Track the reset as a milestone

git add .beads/
git commit -m "chore: reset beads database for fresh start"

Troubleshooting

"Daemon already running" after reset?

pkill -9 -f beads.daemon
sleep 2
./.github/skills/reset-beads/reset.sh

Database still has old issues?

# Check if daemon is holding a lock
lsof | grep beads

# Kill it and retry
pkill -9 -f beads.daemon
./.github/skills/reset-beads/reset.sh

Want to preserve one issue?

Before running reset:

bd show lista-123 > backup-issue.json

After reset:

# Manually recreate it
bd create "..." --from-json backup-issue.json

Safety Checks

The script includes these safety measures:

  • โœ… Verifies .beads/ directory exists
  • โœ… Warns before deletion
  • โœ… Shows what will be deleted
  • โœ… Confirms reinit success
  • โœ… Verifies beads daemon healthy afterward

Advanced: Manual Reset

If you prefer manual control:

# 1. Stop daemon
pkill -f beads.daemon
sleep 1

# 2. Delete database files
rm -f .beads/beads.db .beads/beads.db-shm .beads/beads.db-wal

# 3. Clear issues (but keep config)
> .beads/issues.jsonl
> .beads/interactions.jsonl

# 4. Clean daemon state
rm -f .beads/bd.sock .beads/daemon.* .beads/last-touched

# 5. Reinitialize
bd status

See Also