[BUG] [Claude Desktop] Tab completes but also submits and runs command
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?
In Claude Code running inside the Claude Desktop app (macOS), pressing Tab to
accept a slash-command autocomplete does not just complete the text — it
immediately submits and runs the command, with no Enter step. And when the typed
prefix is ambiguous, Tab full-accepts the highlighted built-in rather than my
custom skill.
Real consequence: I have a skill invoked as /clean-up. Typing /clea + Tab lands
on the built-in /clear (not /clean-up) and executes it instantly — wiping my
entire conversation context before I can react. No Enter, no confirmation. /clear
has no undo (#39975), so a single stray Tab silently destroys the session.
What Should Happen?
Tab should complete text only and leave the command in the input; Enter should be
the only action that submits/runs it (standard readline/shell behavior). Accepting
a completion must never, by itself, execute a command.
On an ambiguous prefix, Tab should complete to the longest common prefix and keep
the menu open, instead of full-accepting the highlighted entry (see #65743).
At minimum, a destructive built-in like /clear should never be runnable from a
single Tab, and/or should confirm before discarding context.
Error Messages/Logs
Steps to Reproduce
- In the Claude Desktop app (macOS), start a Claude Code session.
- Have any slash command/skill sharing a prefix with a built-in — e.g. a
clean-up skill (shares the clea prefix with /clear).
- Type
/cleain the prompt. - Press Tab once.
- Result: autocomplete accepts
/clearand runs it immediately — the whole
conversation context is wiped. Enter was never pressed.
Reproduces with any prefix collision against a built-in; clean-up↔clear is just a
common one. (Related: #37497 reports the double-Tab variant of accidental submission.)
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.181 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
Surface: Claude Code inside the Claude Desktop app on macOS — this is why
"Terminal/Shell" is set to Other (it's not a terminal). Please label area:desktop
- platform:macos (area:tui / area:skills as appropriate).
Prior art (all CLOSED — not a duplicate of any open issue, and each covers only
one facet, so please don't auto-close as duplicate):
- #65743 — Tab should complete to longest common prefix, not full-accept first
match (closed as duplicate; the wrong-match facet).
- #37497 — Prevent accidental command submission via double tab completion
(closed/locked; the execute-on-Tab facet).
- #39975 — [FEATURE] /unclear to undo /clear (closed; confirms no recovery today).
Suggested fix: separate "accept completion" from "submit" — Tab = insert text only
(autocomplete:accept), Enter = submit; optionally add an autocomplete:completePrefix
action (per #65743) and a confirmation guard on /clear.