claude-code - 💡(How to fix) Fix [BUG/REGRESSION] @-completion no longer suggests gitignored files since v2.1.94 [2 comments, 2 participants]

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…
GitHub stats
anthropics/claude-code#45012Fetched 2026-04-09 08:15:25
View on GitHub
Comments
2
Participants
2
Timeline
8
Reactions
0
Author
Timeline (top)
labeled ×5commented ×2closed ×1

Since v2.1.94, the @ file picker only suggests files that are tracked by Git. Files matched by .gitignore no longer appear in the completion list. Previously, all workspace files were suggested regardless of Git status.

Root Cause

Since v2.1.94, the @ file picker only suggests files that are tracked by Git. Files matched by .gitignore no longer appear in the completion list. Previously, all workspace files were suggested regardless of Git status.

RAW_BUFFERClick to expand / collapse

Summary

Since v2.1.94, the @ file picker only suggests files that are tracked by Git. Files matched by .gitignore no longer appear in the completion list. Previously, all workspace files were suggested regardless of Git status.

Reproduction

  1. Create a workspace with a .gitignore that excludes most files (e.g. /* with selective ! exceptions).
  2. Type @ in a Claude Code prompt.
  3. Observe: only un-ignored files appear. Ignored files cannot be selected via @.

Expected

@-completion suggests all files in the workspace, independent of Git tracking status — or at minimum offers a setting to opt out of the gitignore filter.

Suspected cause

The v2.1.94 changelog entry "Fixed @ file completion paths in subdirectories, and improved fuzzy matching for @ file suggestions" appears to have tightened gitignore-respecting as a side effect.

Why this matters: knowledge-work use cases

Claude Code is increasingly used outside traditional code repositories — knowledge vaults, documentation sites, research notes — where Git is not the source of truth for "which files exist."

A common pattern: a large markdown knowledge base where only a small .claude/ config directory is Git-tracked, while the actual content is managed by a separate sync system to avoid two sync mechanisms fighting over the same files. Under the new behavior, @-completion only suggests files inside that small tracked directory — i.e. ~1% of the files the user actually wants to reference. This is a hard blocker.

Request

Add an opt-out for the gitignore filter in @-completion. Possible shapes:

  • settings.json: "fileDiscovery": { "respectGitignore": false } or "includeGitignored": true
  • A .claudeinclude whitelist that overrides .gitignore for Claude's file index
  • Env var: CLAUDE_CODE_IGNORE_GITIGNORE=1

The previous behavior was the right default for non-code workspaces. Please consider reverting or making it configurable.

Environment

  • Claude Code v2.1.94
  • Platform: macOS (Darwin 25.4.0)
  • Shell: zsh

Related (closed as completed, different scope): #2305, #5105

extent analysis

TL;DR

The most likely fix is to add an opt-out for the gitignore filter in @-completion, allowing all files in the workspace to be suggested regardless of Git tracking status.

Guidance

  • Review the changelog entry "Fixed @ file completion paths in subdirectories, and improved fuzzy matching for @ file suggestions" in v2.1.94 to understand the potential cause of the issue.
  • Consider adding a configuration option, such as "fileDiscovery": { "respectGitignore": false } in settings.json, to opt out of the gitignore filter.
  • Evaluate the use of a .claudeinclude whitelist to override .gitignore for Claude's file index as an alternative solution.
  • Test the @-completion feature with different Git tracking statuses and .gitignore configurations to verify the issue and potential fixes.

Example

No code snippet is provided as the issue is related to configuration and behavior rather than code implementation.

Notes

The issue is specific to Claude Code v2.1.94 and may not apply to other versions. The requested fix is to revert or make configurable the behavior of respecting .gitignore in @-completion.

Recommendation

Apply a workaround by adding a configuration option to opt out of the gitignore filter, as this allows for flexibility and customization of the @-completion feature.

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