The Problem
Real-world projects rarely live in a single directory. Monorepos contain multiple packages. Git worktrees create parallel checkouts. Related services live in separate repositories. Without multi-project support, each directory gets its own.brv/ context tree — forcing teams to curate the same knowledge multiple times.
ByteRover solves this with two complementary features:
When to Use Each
Worktrees — Same Project, Multiple Directories
Use worktrees when directories belong to the same logical project and should share a single context tree. Common scenarios:- Monorepo packages —
packages/api/,packages/web/,packages/shared/all share the monorepo’s curated knowledge - Git worktrees — Parallel checkouts of the same repo for concurrent work
- Sibling checkouts — Multiple clones of the same project
brv query from packages/api/ searches the monorepo’s context tree — no duplication needed.
Sources — Different Projects, Shared Knowledge
Use sources when you want to reference knowledge from another project without copying it. Common scenarios:- Platform team patterns — Your product repo references the auth service’s curated patterns
- Shared libraries — Multiple consumers reference the library’s documented conventions
- Design systems — Frontend repos reference the design system’s component guidelines
brv query "JWT validation" searches your local context tree plus both sources, with results attributed to their origin.
How They Work Together
The real power emerges when combining both features:packages/api/:
- ByteRover follows the
.brvpointer to the monorepo - Searches the monorepo’s context tree (local knowledge)
- Searches the design system’s context tree (shared source)
- Returns results with origin attribution:
[design]:components/button.md
Key Design Principles
- No duplication — Worktrees point to the parent’s context tree; sources reference in-place. Nothing is copied.
- Git-style mental model — Worktree pointers use the same
.brvfile/directory duality that Git uses for.gitin worktrees. - Read-only sources — Sources are never modified through the referencing project. Write guards prevent accidental mutations.
- Origin attribution — Query results always show where knowledge came from, so you know the source.
- No sync required — Both features are declarative references, not sync mechanisms. Changes in the target are immediately visible.
Next Steps
Worktrees
Link directories to share a single context tree across your workspace
Sources
Reference knowledge from other projects with read-only cross-project search