What if your AI coding sidekick treated your sprawling codebase like a goldfish with amnesia—brilliant one tank at a time, blank slate the next?
That’s Claude Code in multi-repo land. You’re knee-deep in a Node.js API, hammering out JWT auth flows, then tab over to Next.js frontend. Poof. Gone are the response shapes, the shared types, the quirky conventions you’d just drilled into its skull.
And here’s the kicker: Anthropic built this for speed, not sprawl. But devs don’t live in monorepos anymore—microservices, shared libs, frontend-backend splits rule.
Claude Code with multiple repositories? It’s the silent killer of productivity. Until now.
Why Does Claude Code Dump Context Mid-Session?
Look, it’s not malice. Claude Code lacks persistent memory—sessions reset on new projects, switches nuke prior context.
Your API repo shares TypeScript interfaces with frontend? Tough. Coordinated migrations across three codebases? Re-explain every time. Backend loves ISO dates, frontend expects timestamps? Chaos.
“Claude Code doesn’t have persistent memory across sessions or across repositories. When you open a new project, it starts fresh.”
That’s straight from the trenches. Tokens burn fast recapping—hit limits before coding a line. Anthropic’s betting on short bursts; reality demands marathons.
My unique take? This echoes Git’s early days—submodules promised multi-repo harmony but birthed nightmares. Claude needs its .gitignore equivalent: a context anchor. Enter CLAUDE.md.
The CLAUDE.md Ritual: Cross-Repo Glue
Root-level CLAUDE.md in each repo. Simple. Brutal. Effective.
In API:
## This project
REST API using Node.js + Express + PostgreSQL
Auth: JWT tokens, 15min access / 7day refresh
## Paired with: frontend repo at ../frontend
Frontend expects:
- All API responses: { data: ..., error: null } or { data: null, error: "message" }
- Date format: ISO 8601 strings (not timestamps)
Boom. Claude ingests this first—knows pairings, conventions, gotchas. No more “What’s the auth header?” loops.
Frontend mirrors it:
## Paired with: API repo at ../api
API base URL: http://localhost:3001
All fetch calls use: src/lib/api.ts (do not call fetch directly)
Wander between repos? Context travels. It’s like whispering secrets to a shared diary the AI can’t ignore.
But for active wars—say, avatar upload spanning DB, API, UI—level up.
CONTEXT.md: Your Temporary War Room
Workspace root. CONTEXT.md. Claude reads it first—command it explicitly: “Read CONTEXT.md first, then let’s continue.”
# Active work context - 2026-04-08 [wait, typo in original? Anyway]
## Current task
Adding user avatar upload feature
- API changes: POST /api/users/avatar, returns { avatarUrl: string }
- Frontend changes: ProfilePage.tsx needs upload button + preview
Status checklists. Constraints (5MB max, JPEG/PNG/WebP only). Claude stays locked on task, no drift.
Short para. Genius.
Now, scale it. Three repos? CONTEXT.md balloons—tokens evaporate.
Is Dual Claude Instances the Pro Move?
Two terminals. Two Claudes.
Terminal 1: cd /workspace/api; claude — “You own backend. Output exact response shapes.”
Terminal 2: cd /workspace/frontend; claude — “API returns X. You handle UI. No API touches.”
Copy-paste outputs. Surgical. No context bleed, no overload.
Hacky? Sure. But monorepos failed for reasons—team autonomy, deploy speed. Multi-repo wins; AI must adapt.
Prediction: Anthropic ignores this, community forks a “Claude Workspace” tool by summer. Mark it.
Shared Contracts: The Source of Truth
Don’t stop at docs. shared-types/contract.ts—imported everywhere.
export interface ApiResponse<T> {
data: T | null;
error: string | null;
timestamp: string; // ISO 8601
}
CLAUDE.md points: “See ../shared-types/contract.ts — source of truth. Never duplicate.”
Claude groks the architecture. Changes? Update once, propagate.
Critique time: Anthropic’s PR spins Claude as dev-ready, but no native multi-repo? Sloppy. They’re consumer-first—chatbots, not codebases. Devs hack around it, always have.
Rate limits? Proxy via ANTHROPIC_BASE_URL=https://simplylouie.com/api/proxy. $2/month vs. $200 Claude Max. Long sessions, no cuts.
Why Does Multi-Repo Mastery Matter for AI Coders?
2024’s not 2010. Codebases fragment—services, libs, apps. AI coding tools ignoring this? Doomed to toy status.
This workflow isn’t patch; it’s blueprint. Forces Claude to think systemically—how APIs handshake, UIs consume, DBs underpin.
Devs, adopt. Anthropic, watch. Or lose the pro tier.
Stretch it: Imagine Nx or Turborepo plugins auto-generating CLAUDE.md from manifests. Future’s here, if you build it.
And yeah, context burns tokens—but smart priming saves more. One upfront recap beats ten mid-task nudges.
🧬 Related Insights
- Read more: Anonymous Contributions in Open Source: Freedom or Free-for-All?
- Read more: Claude Finds Code Flaws—But Who’s Minding the AI Chaos?
Frequently Asked Questions
How to use Claude Code with multiple repositories?
Drop CLAUDE.md in each repo root with cross-references, conventions, pairings. For tasks, add workspace/CONTEXT.md and prompt Claude to read it first.
Does Claude Code remember context across repos?
No native persistence. Use docs and shared contracts to prime it fresh each time—works like a charm.
Best proxy for Claude Code rate limits?
SimplyLouie at $2/month handles heavy multi-repo sessions without interruptions.