[BUG] `@` file mentions don't suggest untracked files in git repositories with no commits

Resolved 💬 2 comments Opened Apr 16, 2026 by harunonsystem Closed Apr 16, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

The @ file mention autocomplete does not suggest any project files when the git repository has no commits and all files are untracked. Only global files (e.g., ~/.claude/CLAUDE.md) appear as suggestions. Even typing the exact prefix of an existing file (e.g., @docs-hub for docs-hub.png) produces no matches.

What Should Happen?

Files in the working directory should appear as autocomplete suggestions regardless of their git tracking status.

Error Messages/Logs

Steps to Reproduce

  1. mkdir test-repo && cd test-repo && git init
  2. echo "hello" > test.txt
  3. Do NOT run git add or git commit (all files remain untracked)
  4. Run claude
  5. Type @test in the prompt
  6. No autocomplete suggestions appear for test.txt
  7. Global files like ~/.claude/CLAUDE.md still appear when typing @

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.110

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

It appears that @ autocomplete indexes only git-tracked files (git ls-files). In a repo with 0 tracked files / 0 commits, the index is empty, so no project files are suggested. Untracked files in any repo may also be affected.

Claude can still read these files via the Read tool, so they are accessible — just not discoverable via @.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗