WorkspaceBrowse, save, and manage patterns without leaving the shell

Turborepo Per-Package AI Context

Root-level CLAUDE.md with per-package CLAUDE.md files that Claude auto-loads when working in subdirectories. Works with Turborepo, Nx, and pnpm workspaces.

heavyMonorepoFeatured
Q
Quzr27@quzr27

software engineer

1 followerquzr27
AI Tools
claude-codecopilotcursor
File structure7 files
16
Pros
Claude auto-loads ancestor and descendant CLAUDE.md files
Each package gets focused, domain-specific AI context
Cross-cutting concerns stay in root, domain rules in packages
Cons
Stale package-level docs are worse than no docs — requires maintenance discipline
Combined token count from multiple CLAUDE.md files can exceed practical limits
Overkill for monorepos with fewer than 3 packages
Avoid if
Your monorepo has fewer than 3 packages — a single CLAUDE.md is enough
Your team cannot commit to maintaining per-package documentation

Description

Claude Code automatically loads CLAUDE.md files from ancestor and descendant directories. In a monorepo, this means root/CLAUDE.md sets repo-wide conventions while packages/api/CLAUDE.md adds API-specific context. Claude merges them — child files append to parent context, they don't override. Cursor supports the same pattern with nested .cursor/rules/ directories. Copilot supports nested AGENTS.md files. The Puzzmo team found monorepos ideal for LLM work because schema, API definitions, and implementation are all accessible in one place. Keep the root file under 200 lines covering cross-cutting concerns, and let package-level files handle domain specifics.

Who is this for

Teams running Turborepo, Nx, or pnpm workspace monorepos with 3+ packages or services.

Why files are split this way

A single CLAUDE.md cannot capture domain-specific context for multiple packages without becoming unwieldy. Per-package files mirror how the code itself is organized. Root handles shared conventions (Git workflow, CI, coding standards). Package files handle domain rules (API validation patterns, frontend component structure, shared library constraints).

What changed from the previous setup

A single root-level CLAUDE.md trying to cover all packages, or per-package README files that AI tools did not read automatically.