gemini-cli - ✅(Solved) Fix Add folders while in gemini-cli session not allow their connection using @ notation inside gemini cli [2 pull requests, 3 comments, 3 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#25104Fetched 2026-04-11 06:31:39
View on GitHub
Comments
3
Participants
3
Timeline
13
Reactions
0
Timeline (top)
commented ×3labeled ×3cross-referenced ×2mentioned ×2

Fix Action

Fix / Workaround

As a workaround, the usage of the gemini --resume command

PR fix notes

PR #25117: Fix stale @ completion for files/folders created during active sessions

Description (problem / solution / changelog)

Summary

Fixes stale @ completion/indexing when files or folders are created after Gemini CLI has already started.

Previously, recursive @ completion could miss newly created paths until the CLI was restarted, because the file search layer relied on a snapshot built during initialization.

What changed

  • Updated recursive file search to supplement the cached snapshot with a live filesystem refresh during search
  • Kept the existing cached index as the primary fast path
  • Added a fallback refresh path for newly created nested matches that are not present in the original snapshot
  • Added regression tests covering:
    • new root-level paths created after initialization
    • new nested paths created after initialization

Why

@ completion builds an index once per workspace directory and does not currently refresh when files/folders are added inside an already-tracked workspace directory. This makes completion stale during long-running sessions.

This change makes newly created paths visible to @ completion without requiring a restart.

Validation

npx vitest run src/utils/filesearch/fileSearch.test.ts

in packages/core.

Notes

This PR is scoped to @ completion/indexing behavior during active sessions. Direct exact-path @path resolution uses a separate path-resolution flow.

Fixes #25104

Changed files

  • packages/core/src/utils/filesearch/fileSearch.test.ts (modified, +68/-0)
  • packages/core/src/utils/filesearch/fileSearch.ts (modified, +126/-15)

PR #25118: Fix stale @ completion for files/folders created during active sessions

Description (problem / solution / changelog)

Fixes #25104

Summary

Fixes stale @ completion/indexing when files or folders are created after Gemini CLI has already started.

Previously, recursive @ completion could miss newly created paths until the CLI was restarted, because the file search layer relied on a snapshot built during initialization.

What changed

  • Updated recursive file search to supplement the cached snapshot with a live filesystem refresh during search
  • Kept the existing cached index as the primary fast path
  • Added a fallback refresh path for newly created nested matches that are not present in the original snapshot
  • Added regression tests covering:
    • new root-level paths created after initialization
    • new nested paths created after initialization

Why

@ completion builds an index once per workspace directory and does not currently refresh when files/folders are added inside an already-tracked workspace directory. This makes completion stale during long-running sessions.

This change makes newly created paths visible to @ completion without requiring a restart.

Validation

npx vitest run src/utils/filesearch/fileSearch.test.ts

in packages/core.

Notes

This PR is scoped to @ completion/indexing behavior during active sessions. Direct exact-path @path resolution uses a separate path-resolution flow.

Changed files

  • packages/cli/src/ui/hooks/useAtCompletion.test.ts (modified, +53/-0)
  • packages/core/src/utils/filesearch/fileSearch.test.ts (modified, +273/-0)
  • packages/core/src/utils/filesearch/fileSearch.ts (modified, +165/-15)
RAW_BUFFERClick to expand / collapse

What happened?

Good morning! As I mentioned, if I create folders while in a Gemini CLI session, they are not visible using @notation

What did you expect to happen?

A correct connection of folders and files inside Gemini CLI using @ annotation

Client information

<details> <summary>Client Information</summary>

Run gemini to enter the interactive CLI, then run the /about command.

> /about
 About Gemini CLI                                                                                                                                                                      │ 
│                                                                                                                                                                                       │ 
│ CLI Version                                                    0.37.1                                                                                                                 │ 
│ Git Commit                                                     3b2d4f100                                                                                                              │ 
│ Model                                                          gemini-2.5-flash-lite                                                                                                  │ 
│ Sandbox                                                        no sandbox                                                                                                             │ 
│ OS                                                             win32                                                                                                                  │ 
│ Auth Method                                                    Signed in with Google ([email protected])                                                                    │ 
│ Tier                                                           Gemini Code Assist for individuals                                                                                     │ 
│ IDE Client                                                     VS Code                                 

</details>

### Login information

Google Account

### Anything else we need to know?

As a workaround, the usage of the gemini --resume command

extent analysis

TL;DR

  • Using the gemini --resume command may help mitigate the issue of newly created folders not being visible using @notation in the Gemini CLI session.

Guidance

  • Try running the gemini --resume command as a potential workaround to refresh the connection and make newly created folders visible.
  • Verify that the issue persists after running the gemini --resume command to determine if this workaround is effective.
  • Check the Gemini CLI version and Git commit to ensure you are running the latest version, which might include fixes for similar issues.
  • Consider reporting the issue to the Gemini development team if the workaround does not resolve the problem, providing the client information and login details for further investigation.

Notes

  • The provided workaround may not be a permanent fix, and the root cause of the issue may still need to be addressed.
  • The effectiveness of the gemini --resume command as a workaround is uncertain and may vary depending on the specific use case and environment.

Recommendation

  • Apply workaround: Using the gemini --resume command may provide a temporary solution to the issue, allowing you to continue working with the Gemini CLI while a more permanent fix is investigated.

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