How to Give Claude Code Context Across Repositories
This is a practical, step-by-step guide. By the end, Claude Code will be able to answer questions and plan changes that span more than one repository. Pick the level that matches your setup: steps 1–3 work with nothing but Claude Code, and step 4 adds organisation-wide context.
Before you start
- Claude Code installed and signed in (claude --version should work).
- The repositories you care about, ideally cloned side by side, for example ~/code/web, ~/code/api and ~/code/shared.
Step 1: List which repositories a change touches
Before you open Claude, write down the path of the change: the code that starts the behaviour (for example web), every service it calls (api), and every shared package involved (shared). If you can't answer this, skip to step 4; that's exactly the problem an index solves.
Step 2: Start Claude Code with those repositories
From the main repository, add the others as extra working directories:
cd ~/code/web
claude --add-dir ../api --add-dir ../sharedAlready in a session? Use /add-dir ../api.
Then confirm Claude can see them:
"List the top-level folders you can access and summarise what each repository does."
Step 3: Write a cross-repository CLAUDE.md
Create a CLAUDE.md in your main repository describing how the pieces connect:
## System map
- web: Next.js frontend. Calls api over REST (/v1/*).
- api: Node service. Owns the orders and payments tables.
- shared: types and validation used by both web and api.
## Rules
- Changing an API response? Check web/src/lib/api.ts for consumers.
- Shared types change? Update both web and api in the same task.Claude reads this at the start of each session, so it begins with a map instead of rediscovering the system every time.
Step 4: Add organisation-wide context with CodeZero
Steps 1–3 depend on you knowing the system and keeping the notes up to date. For larger organisations, use CodeZero, a VS Code extension that sits alongside Claude Code.
- Install CodeZero from the VS Code Marketplace (requires VS Code 1.90.0 or newer).
- Sign in with Frigga and select your organisation.
- Connect GitHub, GitLab or Bitbucket and choose the repositories to index. Indexing runs in the background.
- Open the Files view. You'll see every indexed repository, including ones you haven't cloned, and you can open their files from the index.
- Ask in CodeZero's chat, for example: "Which services consume the orders API, and where?" The answer can draw on evidence from any indexed repository.
- Plan the change. A plan can name several repositories; CodeZero keeps them in scope for Claude and shows the dependencies in Tasks.
- Clone only what you edit. If the plan needs to write to a repository you haven't cloned, Tasks offers Clone, and you choose where.
Check it worked
Ask a question that can only be answered with another repository's code:
"If I rename the status field in the orders response, what breaks in other repositories?"
A good answer names specific files in other repositories. A vague answer means Claude still can't see them.
FAQ
Which step should I stop at?
Steps 2–3 are enough for a few well-known repositories. Use step 4 when you have many repositories or don't know in advance what a change touches.
Does CodeZero read my uncommitted changes?
When a repository is checked out locally, CodeZero prefers your working tree, including uncommitted changes. For repositories you haven't checked out, it uses the organisation index.