Skip to content

Gemini CLI loads both GEMINI.md and gemini.md on case-insensitive filesystems, duplicating context #19904

@vektorich

Description

@vektorich

What happened?

On a case-insensitive filesystem (macOS/Darwin), the Gemini CLI appears to be searching for both GEMINI.md and gemini.md during context initialization. Because the filesystem is case-insensitive, both paths resolve to the exact same physical file.

As a result, the CLI loads the same instructional context twice into the model's prompt, wasting context window space.

Technical Evidence:
Running ls -lai in the root directory confirms that both names point to the same inode:

1 65116059 -rw-r--r-- 1 user group 10933 16 Feb 15:59 gemini.md
2 65116059 -rw-r--r-- 1 user group 10933 16 Feb 15:59 GEMINI.md
Attempting to ignore the duplicate via .geminiignore (adding gemini.md) did not resolve the issue.

What did you expect to happen?

The loader should deduplicate files based on their device/inode ID to avoid this redundancy on case-insensitive systems.

Client information

  • CLI Version: 0.29.5
  • Git Commit: 2ef872e
  • Session ID: e1271f57-9a91-4673-a40e-cc2da331b334
  • Operating System: darwin v22.17.0
  • **Sandbox E

Login information

No response

Anything else we need to know?

No response

Metadata

Metadata

Assignees

Labels

area/coreIssues related to User Interface, OS Support, Core Functionalityhelp wantedWe will accept PRs from all issues marked as "help wanted". Thanks for your support!priority/p2Important but can be addressed in a future release.type/bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions