gemini-cli - 💡(How to fix) Fix [Bug] Critical crash when optional .kilocode/rules directory is missing [1 pull requests]

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…

Error Message

When running the Gemini CLI in a workspace that does not contain a .kilocode/rules directory, the application crashes completely. Although the CLI correctly identifies that the directory is missing and logs a [WARN] message, it immediately throws a fatal error that halts execution, rendering the tool unusable in such environments: ` [WARN] Skipping unreadable directory: .kilocode/rules (Directory does not exist: /Users/{user}/Repositories/Breijer/.kilocode/rules) An unexpected critical error occurred:Error: Directory does not exist: /Users/{user}/Repositories/Breijer/.kilocode/rules The .kilocode/rules directory should be treated as optional. If the directory does not exist, the CLI should simply continue execution (the existing warning is sufficient), rather than throwing a critical error that forces the application to terminate.

Fix Action

Fixed

Code Example

> /about
╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                                                                                                                                │
About Gemini CLI│                                                                                                                                                                                                                                                │
CLI Version                                                                        0.42.0Git Commit                                                                         68e2196d5                                                                                                                                                   │
Model                                                                              gemini-2.5-flash-lite                                                                                                                                       │
Sandbox                                                                            no sandbox                                                                                                                                                  │
OS                                                                                 darwin                                                                                                                                                      │
Auth Method                                                                        Signed in with Google (mydutchproductions@gmail.com)Tier                                                                               Gemini Code Assist in Google One AI Pro│                                                                                                                                                                                                                                                │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
RAW_BUFFERClick to expand / collapse

What happened?

When running the Gemini CLI in a workspace that does not contain a .kilocode/rules directory, the application crashes completely. Although the CLI correctly identifies that the directory is missing and logs a [WARN] message, it immediately throws a fatal error that halts execution, rendering the tool unusable in such environments:

[WARN] Skipping unreadable directory: .kilocode/rules (Directory does not exist: /Users/{user}/Repositories/Breijer/.kilocode/rules) An unexpected critical error occurred:Error: Directory does not exist: /Users/{user}/Repositories/Breijer/.kilocode/rules at WorkspaceContext.resolveAndValidateDir (file:///opt/homebrew/Cellar/gemini-cli/0.42.0/libexec/lib/node_modules/@google/gemini-cli/bundle/chunk-7VVHSNDQ.js:308296:13) ...

What did you expect to happen?

The .kilocode/rules directory should be treated as optional. If the directory does not exist, the CLI should simply continue execution (the existing warning is sufficient), rather than throwing a critical error that forces the application to terminate.


Reproduction Steps

  1. Add some folder (.kilocode/rules in this case) to settings.json
  2. Open a terminal in a directory that does not contain a .kilocode/rules folder.
  3. Execute a direct command, e.g.: ggg --prompt "test"
  4. The CLI logs the warning about the missing folder and then crashes with the stack trace provided above.

settings.json: "context": { "fileName": [ "AGENTS.md", "GEMINI.md", "CLAUDE.md" ], "includeDirectories": [ ".kilocode/rules", ".cursor/rules" ], "loadFromIncludeDirectories": true, "fileFiltering": { "respectGitIgnore": false } },


Environment Info

  • CLI Version: 0.42.0
  • OS: Darwin (macOS)
  • Path: /opt/homebrew/Cellar/gemini-cli/0.42.0/

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.42.0                                                                                                                                                      │
│ Git Commit                                                                         68e2196d5                                                                                                                                                   │
│ Model                                                                              gemini-2.5-flash-lite                                                                                                                                       │
│ Sandbox                                                                            no sandbox                                                                                                                                                  │
│ OS                                                                                 darwin                                                                                                                                                      │
│ Auth Method                                                                        Signed in with Google ([email protected])                                                                                                        │
│ Tier                                                                               Gemini Code Assist in Google One AI Pro                                                                                                                     │
│                                                                                                                                                                                                                                                │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
</details>

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