[BUG] @ file complete does not terminate on space or other non-file path inputs

Resolved 💬 3 comments Opened Mar 13, 2026 by billybrickner Closed Apr 12, 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?

When I try to terminate an @ file reference with space instead of enter:

  1. it lets me continue typing
  1. when I press enter to send a prompt it auto-replaces the last word of my prompt in an unintuitive way

Seems similar to https://github.com/anthropics/claude-code/issues/18702

What Should Happen?

when I use a non-escaped non-filepath character, the file complete lookup should stop/terminate the search

Error Messages/Logs

Steps to Reproduce

  1. @ file path terminate with space
  2. press enter, watch your last word be replaced

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.75 - @anthropic-ai/claude-code

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

_No response_

View original on GitHub ↗

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