Allow running shell commands during active turn without canceling
Problem
When Claude is mid-turn (thinking, generating, or executing tools), any text typed into the input is queued as a regular chat message for the next turn. There's no way to run a quick shell command (e.g., check a process, tail a log, run git status) without either:
- Pressing Escape to cancel the current turn (losing all in-progress work), then using
! command - Switching to a separate terminal/tmux pane entirely
This is a significant friction point for developers who work fullscreen in Claude Code and need to occasionally run a quick command while Claude is working on a long task.
Proposed solution
Add a keybinding (e.g., Ctrl+! or Ctrl+Shift+X) that opens a shell command prompt without interrupting the current turn. The command runs in the background, output is displayed inline or in a transient panel, and Claude's turn continues unaffected.
Alternatively, detect the ! prefix on queued input and route it to the shell instead of treating it as a chat message.
Related issues
- #4319 — Persistent interactive shell mode
- #6854 — Non-blocking background tasks / notification when bash finishes
- #31274 — Inline shell command execution (
!prefix)
Those are adjacent but none address the specific case of user-initiated shell commands during an active Claude turn.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗