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
- Add some folder (.kilocode/rules in this case) to settings.json
- Open a terminal in a directory that does not contain a .kilocode/rules folder.
- Execute a direct command, e.g.: ggg --prompt "test"
- 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
Client Information
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}@gmail.com) │
│ Tier Gemini Code Assist in Google One AI Pro │
│ │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Login information
Google Account
Anything else we need to know?
No response
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
settings.json:
"context": { "fileName": [ "AGENTS.md", "GEMINI.md", "CLAUDE.md" ], "includeDirectories": [ ".kilocode/rules", ".cursor/rules" ], "loadFromIncludeDirectories": true, "fileFiltering": { "respectGitIgnore": false } },Environment Info
Client information
Client Information
Run
geminito enter the interactive CLI, then run the/aboutcommand.Login information
Google Account
Anything else we need to know?
No response