claude-code - 💡(How to fix) Fix [FEATURE] Limit @ file picker scope to working directory in monorepo [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#54617Fetched 2026-04-30 06:40:44
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Author
Timeline (top)
labeled ×2commented ×1

Fix Action

Fix / Workaround

  • Typing a more specific path prefix after @ (e.g., @src/pages/) helps narrow results, but still shows matches from other apps if the path pattern overlaps.
    • Adding deny permission rules in .claude/settings.json blocks file access from other apps, but does not affect what appears in the @ picker UI.
    • No current workaround fully solves the problem without manual effort on every file reference.
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • This is a single feature request (not multiple features)

Problem Statement

When working inside a monorepo, launching Claude Code from a subdirectory (e.g., apps/app-product) does not limit the @ file picker scope to that directory. Instead, the picker searches and displays matches from the entire git repository root, which includes all other applications in the monorepo.

This creates significant noise during development: when I type @ to reference a file, results from unrelated sibling apps appear alongside the files I actually want, making it hard to quickly locate the right file.

The current behavior is inconsistent with the expectation that launching Claude Code from a subdirectory should scope its context to that directory.

Proposed Solution

The @ file picker should default to searching from the working directory where Claude Code was launched, not the git repository root.

Ideally:

  • When Claude is launched from apps/app-product, the @ picker should only show files under that directory by default.
  • Optionally, a configuration setting (e.g., filePickerRoot in settings.json) could allow users to explicitly override this scope.
  • Alternatively, a CLI flag like --scope-to-cwd could enforce this behavior when needed.

Alternative Solutions

  • Typing a more specific path prefix after @ (e.g., @src/pages/) helps narrow results, but still shows matches from other apps if the path pattern overlaps.
  • Adding deny permission rules in .claude/settings.json blocks file access from other apps, but does not affect what appears in the @ picker UI.
  • No current workaround fully solves the problem without manual effort on every file reference.

Priority

High - Significant impact on productivity

Feature Category

Interactive mode (TUI)

Use Case Example

  1. I have a monorepo with 7+ frontend applications under apps/.
  2. I launch Claude Code from apps/app-product to work on a single app.
  3. I type @index in the prompt to reference a page file.
  4. The picker returns matches from app-bidding/src/pages/index.tsx, micro-goods/src/pages/index.tsx, and other unrelated apps.
  5. I have to manually scan the list and identify the correct file, defeating the purpose of the picker.

With this feature, only files under apps/app-product would appear, making the picker fast and accurate.

Additional Context

This is a common pain point in monorepo setups where multiple applications share a single git root. Tools like VS Code handle this by allowing users to open a subfolder as the "workspace root," effectively scoping all file operations to that directory. A similar concept in Claude Code would greatly improve the developer experience for monorepo users.

extent analysis

TL;DR

Implement a configuration setting or CLI flag to scope the @ file picker to the working directory where Claude Code was launched.

Guidance

  • Consider adding a filePickerRoot setting in settings.json to allow users to explicitly override the scope of the @ file picker.
  • Introduce a CLI flag like --scope-to-cwd to enforce the behavior of scoping the @ file picker to the current working directory.
  • Review the current implementation of the @ file picker to understand how it determines the search scope and identify potential modifications to default to the working directory.
  • Evaluate the feasibility of automatically detecting the launch directory and adjusting the @ file picker scope accordingly.

Example

No code snippet is provided as the issue does not contain specific implementation details.

Notes

The proposed solution requires modifications to the existing implementation of the @ file picker. The exact changes will depend on the current codebase and may involve updates to the search logic, configuration handling, or CLI flag parsing.

Recommendation

Apply a workaround by using a more specific path prefix after @ (e.g., @src/pages/) until a permanent solution is implemented, as this can help narrow down the results, although it may not fully solve the problem.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [FEATURE] Limit @ file picker scope to working directory in monorepo [1 comments, 2 participants]