gemini-cli - 💡(How to fix) Fix Add a setting to control @ file path context in VSCode terminal [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
google-gemini/gemini-cli#25012Fetched 2026-04-10 03:45:29
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×3commented ×1unlabeled ×1
RAW_BUFFERClick to expand / collapse

Hello team!

I've noticed a change in behavior since version 0.36.0 regarding how file paths are resolved for @ mentions when running gemini-cli inside the VSCode integrated terminal.

Before v0.36.0: When I launched gemini-cli (in VSCode) from a specific folder, for example my_project/src/component1/, any file I referenced with @ would use a path relative to that components directory. For instance, a file at my_project/src/component1/button.js could be referenced simply as @button.js. I found this quite logical, and easy to use.

From v0.36.0 onwards: The context for @ mentions seems to be the entire path. Using the same example, if my workspace root is my_project, the reference to the same file becomes @c:/Users/User/path_to_project/src/component1/button.js. In addition, it also shows files outside of the cwd, that are in the project. This becomes very inconventient if your project contains many folders that are called similarly, for example, if I also have a button in another component (e.g. c:/Users/User/path_to_project/src/component2/button.js)

Interestingly, if I run gemini-cli v0.36.0 in a standalone terminal, it still operates with the old, desired behavior. This leads me to believe the change is specific to the VSCode integration.

After looking through the changelog, I believe this change might have been introduced by the following pull request: #21380: fix(cli): automatically add all VSCode workspace folders to Gemini context

While I understand the idea of making the context the entire workspace, it would be great to have control over this behavior. Would it be possible to introduce a setting (perhaps in settings.json) that allows users to choose the desired context for @ file mentions?

Alternatively, if there's an existing workflow to achieve the old behavior within VSCode that I'm not aware of, I would also be helped to get to know more about that instead!

Thanks in advance!

extent analysis

TL;DR

Introduce a setting in settings.json to allow users to choose the desired context for @ file mentions, potentially reverting to the pre-v0.36.0 behavior.

Guidance

  • Investigate the changes introduced by pull request #21380 to understand how the Gemini context is now being set.
  • Consider adding a configuration option to settings.json to allow users to specify the context for @ file mentions, such as a "contextRoot" or "relativePath" setting.
  • Review the gemini-cli documentation and VSCode integration settings to see if there are any existing options or workarounds that can achieve the desired behavior.
  • If a setting is introduced, verify its functionality by testing @ file mentions in different scenarios, such as within a component directory and across multiple components with similar file names.

Notes

The issue seems to be specific to the VSCode integration, and the desired behavior is to have control over the context for @ file mentions. Introducing a setting to allow users to choose the desired context would provide flexibility and potentially resolve the issue.

Recommendation

Apply workaround: Introduce a setting in settings.json to allow users to choose the desired context for @ file mentions, as this would provide a flexible solution to the issue and cater to different user preferences.

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

gemini-cli - 💡(How to fix) Fix Add a setting to control @ file path context in VSCode terminal [1 comments, 2 participants]