claude-code - 💡(How to fix) Fix [BUG] @-file tab completion replaces entire prompt when slash command is present and filename starts with / [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#51623Fetched 2026-04-22 07:57:17
View on GitHub
Comments
2
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×4commented ×2

Error Message

Error Messages/Logs

Code Example

None
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

When a prompt begins with a slash command and you use the @ file finder to reference a file whose path starts with /, pressing Tab to autocomplete replaces the entire prompt minus the slash command with just the completed file path. In addition the file finder is stuck, it won't continue searching.

What Should Happen?

Tab should complete only the @/... token in place, leaving the rest of the prompt intact.

Error Messages/Logs

None

Steps to Reproduce

  1. Start a prompt with a slash command, e.g. /blueprint something
  2. Type @/ and begin typing a file path
  3. Press Tab to autocomplete
  4. The entire prompt minus the slash command is replaced with just the completed file path (e.g. /some/file.ts)

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.116

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

No response

extent analysis

TL;DR

The issue can be addressed by modifying the autocomplete functionality to only replace the @/... token in the prompt, rather than the entire prompt minus the slash command.

Guidance

  • Review the code responsible for handling the Tab key press event in the autocomplete feature to ensure it correctly identifies and replaces only the @/... token.
  • Verify that the file finder's search functionality is properly reset after a successful autocomplete, allowing it to continue searching for other files.
  • Investigate the interaction between the slash command and the file finder to prevent the entire prompt from being replaced.
  • Test the autocomplete feature with different file paths and slash commands to ensure the issue is fully resolved.

Example

No code snippet is provided as the issue does not contain sufficient information about the implementation details.

Notes

The issue may be specific to the Sonnet model or the Windows Terminal, so testing on different platforms and models may be necessary to confirm the fix.

Recommendation

Apply a workaround to modify the autocomplete functionality, as the root cause of the issue is likely related to the implementation of the @ file finder and Tab key press event handling.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] @-file tab completion replaces entire prompt when slash command is present and filename starts with / [2 comments, 2 participants]