What Are Worktrees?
Worktrees let multiple directories share a single ByteRover context tree. Instead of each directory maintaining its own.brv/ knowledge base, child directories point back to a parent project. Curate once, query everywhere.
This is especially useful for:
- Monorepos — All packages share the root project’s context tree
- Git worktrees — Parallel checkouts share knowledge without re-curating
- Sibling directories — Related projects under a common parent
How It Works
ByteRover uses a git-style.brv file/directory duality — the same pattern Git uses for .git in worktrees:
When you add a worktree, ByteRover:
- Creates a
.brvfile (not directory) in the target, pointing to the parent - Registers the worktree in the parent’s
.brv/worktrees/directory
Resolution
When you run anybrv command from a worktree directory, ByteRover walks up from the current directory and stops at the first .brv it finds:
- If it’s a directory — you’re in the real project
- If it’s a file — follow the pointer to the parent project
packages/api/ automatically use the monorepo’s context tree.
Commands
All worktree commands are available as both CLI commands and TUI slash commands.worktree add
Register a directory as a worktree of the current project.
- CLI
- TUI
Flags:
Examples:
worktree list
Show the current worktree status and all registered worktrees.
- CLI
- TUI
worktree remove
Remove a worktree registration and delete its .brv pointer file.
- CLI
- TUI
Examples:
If the worktree was added with
--force (and a .brv-backup/ exists), the backup is automatically restored as .brv/ on removal. Your original context tree is preserved.Backup and Recovery
The--force flag enables safe migration of directories that already have their own .brv/ setup:
Error Handling
Integration with Other Features
Queries and Curation
From a linked worktree, all queries and curations operate on the parent project’s context tree:Sources
Sources configured in the parent project are automatically available from all worktrees:Status
brv status shows worktree information when you’re in a linked directory: