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 a cross-repository code graph.
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 a code graph 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 a cross-repository code graph with CodeZero
Steps 1–3 depend on you knowing the system and keeping the notes up to date. For larger systems, 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.
- Add the repositories you work on with the + button. CodeZero indexes each one's main branch on your machine and links them into one graph.
- Open the Files view to browse the repositories you've added.
- Ask in CodeZero's chat, for example: "Which services consume the orders API, and where?" The answer can draw on evidence from any repository you've added.
- Plan the change. A plan can name several repositories; CodeZero keeps them in scope for Claude and shows the dependencies in Tasks.
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?
Yes. The agent reads your local working tree directly, so it sees uncommitted changes. CodeZero's graph covers each repository's main branch.