[BUG] CLAUDE.md File Not Visible in File Selection
Claude Code Bug Report: CLAUDE.md Files Not Visible in File Selection
Summary
When using @CLAUDE.md in Claude Code, the file is not visible in the file selection interface if it's listed in .gitignore, preventing users from referencing project-specific Claude instructions.
Environment
- Claude Code Version: [Current version]
- Platform: macOS 15.5 Sequoia
- Project Type: Xcode/Swift project
- Git Status:
CLAUDE.mdis gitignored but exists locally
Expected Behavior
When typing @CLAUDE.md or using file selection in Claude Code, the CLAUDE.md file should be visible and selectable even if it's in .gitignore, since it's a legitimate project file that users need to reference.
Actual Behavior
The CLAUDE.md file does not appear in the file selection interface when it's listed in .gitignore, making it impossible to reference project-specific Claude instructions.
Steps to Reproduce
- Create a project with a
CLAUDE.mdfile in the root directory - Add
CLAUDE.mdto.gitignore(common practice to keep instructions local) - In Claude Code, try to reference the file using
@CLAUDE.md - Observe that the file is not visible in the file selection interface
Root Cause Analysis
Claude Code's file picker appears to filter out gitignored files, but CLAUDE.md is a special case that should always be accessible regardless of git status since it contains project-specific instructions for Claude.
Current Status Verification
# File exists locally
$ ls -la CLAUDE.md
-rw-r--r-- 1 user staff 2047 Jul 16 13:48 CLAUDE.md
# But is ignored by Git
$ git status --ignored | grep CLAUDE.md
CLAUDE.md
# And not tracked by Git
$ git ls-files | grep -i claude.md
(no results)
Impact
- High User Impact: Users cannot access project-specific Claude instructions
- Workflow Disruption: Breaks the intended Claude Code workflow with project-specific context
- Inconsistent Behavior: Other tools typically show gitignored files that are needed for functionality
Proposed Solution
Claude Code should either:
- Always show CLAUDE.md files regardless of gitignore status
- Include gitignored files in file selection with visual indicators
- Add specific handling for Claude instruction files (.md files starting with CLAUDE)
Additional Context
Many projects keep CLAUDE.md in .gitignore to prevent committing developer-specific instructions while still needing to reference them during development. This is a legitimate use case that Claude Code should support.
Priority
High - This affects core Claude Code functionality and user workflow with project-specific instructions.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗