[BUG] file picker stays open after the query uniquely matches, so Enter inserts a duplicate reference instead of submitting
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?
Description
When typing an @ file reference, the completion popup does not dismiss once the typed text has narrowed the candidate list to a single exact match. Typing a delimiter (space) after the complete path leaves the picker open, so the next Return is consumed by the picker — it accepts the highlighted completion and inserts the same path a second time — rather than submitting the message.
The practical failure is that any word typed after a completed file reference can be silently replaced by a second copy of that reference. In my case I typed a sentence ending in the word "enter" and the submitted message contained the file path there instead.
Steps to reproduce
- Type a message containing a fully-typed
@reference, e.g.
@~/.config/Code/User/profiles/ad9bf25/settings.json — the candidate list narrows to exactly one entry.
- Press space.
- Continue typing another word.
- Press Return.
Expected
Once the query uniquely identifies one candidate and a delimiter (space) is typed, the picker closes. Space is inserted literally, subsequent typing is plain text, and Return submits the message.
Actual
The picker remains open across the space and the following word. Return is captured by the picker: it accepts the highlighted completion, replacing/appending the file path, and does not submit. A second Return is needed to send, and the message now contains a duplicate @ reference where the typed word should be.
Workaround
Press Esc to dismiss the picker before continuing to type.
Environment
- Claude Code: 2.1.220
- Platform: Linux 7.0.0-28-generic (x86_64)
- Terminal: xterm-256color, bash
- Interface: terminal CLI
What Should Happen?
Once the query uniquely identifies one candidate and a delimiter (space) is typed, the picker closes. Space is inserted literally, subsequent typing is plain text, and Return submits the message.
Error Messages/Logs
Steps to Reproduce
- Type a message containing a fully-typed
@reference, e.g.
@~/.config/Code/User/profiles/ad9bf25/settings.json — the candidate list narrows to exactly one entry.
- Press space.
- Continue typing another word.
- Press Return.
Claude Model
None
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
Claude Code 2.1.220
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗