AI agent workflow for monorepos
Use AI coding agents in monorepos by scoping packages, commands, ownership boundaries and verification paths.

Put it into practice
What you will produce
A package-scoped change with the smallest relevant checks plus a documented cross-package impact review.
- 01
Locate package ownership
Trace the changed symbol to its package and inspect workspace manifests and dependency direction.
Expected result: The owning package and allowed dependency edges are known.
- 02
Read the package contract
Identify its scripts, public exports, generated files, and consumers that may be affected.
Expected result: The boundary includes actual callers, not only the edited directory.
- 03
Make a package-scoped change
Request the smallest edit in the owning package and leave unrelated packages and lockfile sections untouched.
Expected result: The diff stays within the package unless another change is justified.
- 04
Run scoped and impact checks
Run relevant package checks, then inspect dependent packages or exports where a boundary is crossed.
Expected result: Local validation and cross-package effects are recorded.
Acceptance checks
- The owning package and allowed dependency edges are known.
- The diff stays within the package unless another change is justified.
- Local validation and cross-package effects are recorded.
Limits and trade-offs
Workspace scripts may execute across many packages. Inspect command scope before running agents or broad install/build tasks.
Official sources
Scope a monorepo task
Related guides
Claude Code Subagents: Parallel Agents
Learn when Claude Code subagents help, how to split parallel work, and how to configure a focused custom subagent without creating conflicts.
Subagents are useful when a task can be split cleanly: one agent searches the authentication code, another traces the database path, and the main conversation compares what they found. They add little to "read this file" or to work where every step depends on the same context. Short version: delegate independent research or a separate review when the results are worth the extra context and usage. Give each agent a narrow scope, the files or area to inspect, and a specific report format. Keep dependent work in the main conversation. Claude Code agents vs subagents Claude Code's documentation calls delegated workers subagents and uses Agent for the tool that starts them. When people search for Claude Code agents in this context, they usually mean subagents: workers that handle a delegated task in their own context and return a result to the main conversation. Claude Code's subagent documentation uses this terminology.…
Read the guideClaude Code Plan Mode: A Practical Guide
Claude Code Plan Mode lets you review and steer a task plan before any file is touched. Full guide: shortcut (Shift+Tab), activation, when to use it, and how to execute the plan.
Most people use Claude Code like a chat: describe the task, watch it execute. That works for small changes. For anything touching more than two files, there's a better path. If you are looking for the shortcut, press Shift+Tab to toggle Plan Mode. To turn it off, press Shift+Tab again or use /plan only for the prompt that needs planning. The dedicated Plan Mode troubleshooting guide covers the common terminal and version issues. Plan Mode. What Plan Mode does When you activate Plan Mode, Claude reads your codebase and produces a step by step execution plan but makes no changes. You see exactly what it intends to do before a single file is written. This gives you a checkpoint: approve the plan, redirect it, or catch a wrong assumption before it cascades into 15 wrong edits. How to activate Plan Mode the shortcut Two ways: Keyboard shortcut : press Shift+Tab…
Read the guide