[FEATURE] Keyboard shortcut to submit prompt in a fresh session (e.g., Cmd+Enter)

Resolved 💬 4 comments Opened Jan 29, 2026 by felho Closed Feb 28, 2026

Problem Statement

When working in an interactive Claude Code session, I frequently want to start a task with a clean context. My current workflow requires multiple manual steps:

  1. Type my prompt
  2. Instead of pressing Enter, I stop
  3. Copy my prompt
  4. Run /clear and wait
  5. Paste my prompt back
  6. Press Enter

This is a common pattern when switching between unrelated tasks within the same terminal, or when I know the accumulated context will hurt rather than help the next task. The friction of these manual steps adds up significantly over a day of work.

Proposed Solution

Add a keyboard shortcut (e.g., Cmd+Enter on macOS, Ctrl+Enter on Linux/Windows) that submits the current prompt in a fresh session context. Functionally equivalent to /clear + submit, but as a single atomic action.

User experience

  1. I type my prompt in the interactive REPL
  2. Instead of pressing Enter (which submits in the current context), I press Cmd+Enter
  3. Claude Code clears the context and immediately processes my prompt in the fresh session
  4. I stay in the same interactive session (same terminal, same process)

Bonus: Programmatic access

If this feature exists as a keybinding, it would also be valuable to expose it programmatically — for example, as a hook output action ({ "executeCommand": "/clear" }) or a composable keybinding sequence. But the keyboard shortcut alone would already be a significant workflow improvement.

Alternatives Considered

  • UserPromptSubmit hook + external automation (AppleScript/Keyboard Maestro): Works but fragile — relies on timing, terminal focus, and external tools. Not portable across environments.
  • Custom slash command: Slash commands cannot invoke other slash commands like /clear, so this doesn't work.
  • Keybinding sequences: Current keybindings only support single actions, not chains like "clear then submit."
  • Manual /clear + re-type: This is what I do today. It works but creates unnecessary friction.

Additional Context

  • macOS user, running Claude Code in various terminals (Cursor integrated terminal, iTerm2, Terminal.app)
  • This would pair well with the existing mode-switching shortcuts (Shift+Tab, Alt+T for thinking, etc.)
  • The /compact command partially addresses this but doesn't give a truly fresh context

View original on GitHub ↗

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