gemini-cli - 💡(How to fix) Fix GEMINI CLI aggressively scans .venv in custom skills (ignores .gitignore / .geminiignore)

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…

Code Example

Resources to be shared with the model:                                                                                 
Showing up to 200 items (files + folders). Folders or files indicated with ... contain more items not shown, were      
ignored, or the display limit (200 items) was reached.                                                                 
                                                                                                                       
C:\Users\...\.gemini\skills\my-skill\                                         
├───SKILL.md                                                                                                           
└───scripts\                                                                                                           
    ├───main.py                                                                                                  
    ├───pyproject.toml                                                                                                 
    ├───uv.lock                                                                                                        
    └───.venv\                                                                                                         
        ├───.gitignore                                                                                                 
        ├───.lock                                                                                                      
        ├───CACHEDIR.TAG 
        ...

---

CLI Version                              0.42.0                                                                      
Git Commit                               68e2196d5                                                                   
Model                                    Auto (Gemini 3)                                                             
Sandbox                                  no sandbox                                                                  
OS                                       win32                                                                       
Auth Method                              Signed in with Google (jan.krakora@valeo.com)                               
Tier                                     Gemini Code Assist Standard                                                 
GCP Project                              valeo-cp2384-dev
RAW_BUFFERClick to expand / collapse

What happened?

When developing a custom skill inside the .gemini/skills/ directory using Python and a package manager like uv (which creates a local .venv folder), the Gemini CLI automatically maps and shares the entire .venv directory with the model.

Any attempts to ignore this folder using standard .gitignore or .geminiignore files placed directly in the skill directory (or its subdirectories) are completely ignored by the CLI parser.

Example project

GeminiCliTestBench.zip

Resources to be shared with the model:                                                                                 
Showing up to 200 items (files + folders). Folders or files indicated with ... contain more items not shown, were      
ignored, or the display limit (200 items) was reached.                                                                 
                                                                                                                       
C:\Users\...\.gemini\skills\my-skill\                                         
├───SKILL.md                                                                                                           
└───scripts\                                                                                                           
    ├───main.py                                                                                                  
    ├───pyproject.toml                                                                                                 
    ├───uv.lock                                                                                                        
    └───.venv\                                                                                                         
        ├───.gitignore                                                                                                 
        ├───.lock                                                                                                      
        ├───CACHEDIR.TAG 
        ...

Impact

  • Token waste: Sending thousands of irrelevant library files to the LLM context.
  • Performance issue: Unnecessary local file mapping slows down the execution.
  • UX degradation: The terminal log hits the 200 items limit instantly, obscuring the actual relevant source files from the user's view.

What did you expect to happen?

The CLI should evaluate the skill context efficiently. It should either:

  • Ignore common heavy development directories by default (.venv, node_modules, pycache, .git).
  • Explicitly respect .gitignore or .geminiignore rules located within the skill's root directory.

Client information

Environment:

  • OS: Windows (but likely affects all OS)
  • Tooling: Python / uv

Client Information:

CLI Version                              0.42.0                                                                      
Git Commit                               68e2196d5                                                                   
Model                                    Auto (Gemini 3)                                                             
Sandbox                                  no sandbox                                                                  
OS                                       win32                                                                       
Auth Method                              Signed in with Google ([email protected])                               
Tier                                     Gemini Code Assist Standard                                                 
GCP Project                              valeo-cp2384-dev

Login information

Google Account

Anything else we need to know?

No response

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