[BUG] @ file picker does not refresh — newly created files invisible until session restart
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code
What's Wrong?
The @ file picker has an inconsistent behavior for files created after Claude Code is launched:
- The unfiltered list (typing just
@and looking at the dropdown) does include the newly created file. So a filesystem scan / watcher is clearly picking it up. - The prefix completion (typing
@<prefix>and expecting the dropdown to filter to matching files) does not match the new file. It silently behaves as if the file did not exist.
So the dropdown content and the prefix-matching index appear to be out of sync — the picker knows about the file when listing everything, but its prefix-matching layer doesn't.
What Should Happen?
Prefix completion should match all files currently in the working directory, including those created during the session — i.e., the same set of files that already appears in the unfiltered @ dropdown.
Steps to Reproduce
Tested in a non-git directory (no .git/, no .gitignore):
mkdir /tmp/picker-refresh-test && cd /tmp/picker-refresh-testecho "a" > existing_one.txt && echo "b" > existing_two.txtclaude- In the prompt, type
@→ dropdown listsexisting_one.txt,existing_two.txt✅ - Type
@exist→ dropdown filters correctly to both ✅ - From a separate shell, while claude is still running:
echo "new" > /tmp/picker-refresh-test/brand_new.txt
- Back in claude, type
@→ dropdown lists all three files includingbrand_new.txt✅ - Type
@brand→ no suggestion ❌ (despite the file being visible in the unfiltered list one keystroke earlier) /exitand relaunchclaude- Type
@brand→brand_new.txtis now suggested ✅
Claude Code Version
2.1.119
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
GNOME Terminal (bash)
Is this a regression?
I don't know
Additional Information
Related but distinct from #47523 / #48968 / #40082 / #26464, which are about files already present at session start not being indexed at all because the picker uses git ls-files as its only source. The bug here is different: in a non-git directory the filesystem scan does pick up new files for the unfiltered list, but the prefix-matching index is stale and doesn't include them until the session is restarted. Likely the same root cause class (cached file index without invalidation) but a different symptom.
I have not tested whether this also reproduces inside a git init'd repo — that case may overlap with the existing untracked-file bugs above and is harder to disentangle.
4 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Not a duplicate of the three issues the bot suggested — they affect different features. Quick triage:
.claude/skills/. Not the@file picker.~/.claude/commands/. Not the@file picker.~/.claude/projects/<key>/. Not the@file picker.So this issue stands on its own. That said, the bot is picking up a real underlying theme: across skills, slash commands, session lists, and now the
@file picker prefix index, multiple Claude Code subsystems appear to lack filesystem-watcher-driven refresh and require a session restart to pick up newly created files. Might be worth investigating as a class rather than four separate bugs.ok seems fixed now
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.