[BUG] file picker stays open after the query uniquely matches, so Enter inserts a duplicate reference instead of submitting

Status Open
Reported on v2.1.220
Maintainer reply None cached
Activity 1 comment · opened Jul 27, 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?

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

  1. 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.

  1. Press space.
  2. Continue typing another word.
  3. 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

  1. 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.

  1. Press space.
  2. Continue typing another word.
  3. 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_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗