Problem
Claude Context indexes the entire codebase without a way to limit traversal depth. For large monorepos, this can be slow and include files that are irrelevant to the current task.
Solution
Add a --max-depth CLI flag (default: unlimited) that stops traversal at the specified directory depth. This allows users to scope the context to the relevant subtree.
Use case
A developer working in packages/api/src/ doesn't need the entire monorepo context — --max-depth 4 would capture the relevant package scope without pulling in unrelated packages/web/ or packages/shared/ content. This would also reduce indexing time and API costs for large codebases.
Notes
Non-breaking addition — existing behavior unchanged when flag is omitted.
Problem
Claude Context indexes the entire codebase without a way to limit traversal depth. For large monorepos, this can be slow and include files that are irrelevant to the current task.
Solution
Add a
--max-depthCLI flag (default: unlimited) that stops traversal at the specified directory depth. This allows users to scope the context to the relevant subtree.Use case
A developer working in
packages/api/src/doesn't need the entire monorepo context —--max-depth 4would capture the relevant package scope without pulling in unrelatedpackages/web/orpackages/shared/content. This would also reduce indexing time and API costs for large codebases.Notes
Non-breaking addition — existing behavior unchanged when flag is omitted.