[BUG] Tab-completing @ file reference after /command deletes previously typed text
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 invoking a slash command (e.g., /review, /init) and typing additional text
before adding an @ file reference, pressing Tab to autocomplete the file path
deletes all text between the command and the @ reference.
What Should Happen?
Tab-completion should only replace the @... token with the completed file path,
preserving all text between the slash command and the file reference.
Error Messages/Logs
All text typed between the slash command and the `@` reference is erased upon
Tab-completion.
Steps to Reproduce
- Type a slash command followed by some text and a file reference, e.g.:
/review please check this code @../some_project/
- Press Tab to autocomplete the
@file reference - The text "please check this code" is deleted — only the slash command and the
completed file reference remain
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.50
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
WSL (Windows Subsystem for Linux)
Additional Information
Environment
- Claude Code version: 2.1.50
- Platform: Linux (WSL2, kernel 6.6.87.2-microsoft-standard-WSL2)
- Terminal: CLI
Notes
This also reproduces with custom skills (e.g., /spec). It may be related to #13940
(prompt suggestion replacing text, fixed in v2.0.70), but that fix addressed prompt
suggestions on empty input. This bug is specifically about @ file reference
Tab-completion within slash commands wiping intermediate text.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗