Computes the relative path from the worktree root instead of the .beads directory. This ensures that FollowRedirect resolves paths correctly relative to the parent of .beads.
Centralizes repository context resolution via RepoContext API, fixing bugs where git commands run in the wrong repo when BEADS_DIR points elsewhere or in worktree scenarios.
- Add CheckReadonly calls to create/remove commands
- Add cleanup on partial failure (remove worktree if beads setup fails)
- Prevent removing main repository as worktree
- Fix gitignore entry to use relative path from repo root
- Remove misleading stash check (stashes are repo-wide, not per-worktree)
- Populate Name field in WorktreeInfo struct
- Add #nosec comments for exec.Command and file reads
🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Adds user-facing worktree management commands:
- bd worktree create <name> - creates worktree with beads redirect
- bd worktree list - shows all worktrees and their beads state
- bd worktree remove <name> - removes worktree with safety checks
- bd worktree info - shows current worktree info
The create command automatically sets up .beads/redirect to point to
the main repos .beads directory, ensuring all worktrees share
the same issue database. This enables parallel development with
multiple agents or features.
🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>