[FEATURE] Add "TAB accept only" mode for prompt suggestions to prevent accidental execution
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
The current prompt suggestion feature uses Enter to both accept the suggestion AND execute it in one keystroke. This creates a dangerous UX issue in idle sessions:
- User has an active Claude Code session but is working elsewhere (other terminal panes, applications, etc.)
- A prompt suggestion appears in the idle session
- User presses Enter to activate/focus the terminal (common behavior in tmux, multi-pane setups, or just to check which terminal is active, or in VIM mode)
- The suggestion is immediately accepted and executed without any opportunity for review
This is particularly risky in edit mode or auto-accept/skip permission mode, where accidental execution can lead to unintended file modifications or command execution with no confirmation prompt.
Proposed Solution
Add a configuration option for "TAB accept only" mode where:
- TAB: Accepts the suggestion into the prompt input (but does NOT execute)
- ⌘+Enter: Accept and Submit prompt suggestion
This ensures users always have a chance to review what they're about to execute before it runs.
Proposed Configuration
{
"promptSuggestions": {
"enabled": true,
"acceptBehavior": "tab-only" // or "enter-executes" (current default)
}
}
Or a simpler toggle in /config:
Prompt suggestion accept behavior: [TAB only] / [Enter accepts & executes]
Alternative Solutions
Current workaround is to completely disable suggestions via CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION=false or the /config toggle, but this loses the benefit of suggestions entirely. There's no middle ground option.
Priority
Medium - Would be very helpful
Feature Category
Interactive mode (TUI)
Use Case Example
- I have Claude Code running in one tmux pane, with other panes for shells, editors, etc.
- I'm working in another pane/window and Claude Code session is idle
- A prompt suggestion appears in the idle Claude Code session (I don't notice it)
- I press Enter to switch focus or check the terminal state
- Current behavior: The suggestion is immediately executed without my review
- Desired behavior: Enter does nothing to the suggestion; I must press TAB to accept it first, giving me a chance to review what I'm about to execute
Additional Context
_No response_
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗