Inline shell command execution from the Claude Code prompt (! prefix or /run command)
Feature Request
Allow users to execute shell commands directly from the Claude Code prompt without switching to another terminal window or tab.
Proposed Interface
A ! prefix (common convention from Python REPLs, Vim, and other tools) or a /run slash command:
> !git status
> !ls -la
> /run curl -s https://example.com
Output would appear inline in the conversation, then Claude Code resumes as normal.
Problem
Today, running a quick shell command mid-session requires:
- Suspending or context-switching away from Claude Code
- Opening a new terminal tab or pane
- Running the command
- Switching back
This is a significant friction point for users who work in fullscreen terminal sessions where tabbing out means losing visual context entirely. Split-pane setups help, but not everyone uses them — and even then, the cognitive context switch adds up over a long session.
Workflow Advantages
- Verify state without leaving context — check a file exists, confirm a deploy went live, inspect an env var, all without breaking flow
- Fullscreen terminal users — many power users work fullscreen and this would eliminate the need to exit or tile just to run a one-liner
- Faster iteration loops — tighten the cycle between Claude suggesting something and the user verifying it
- Reduced window sprawl — fewer terminal tabs open, cleaner workspace
- Natural pairing with Claude's output — if Claude suggests a command, the user can immediately run it inline and paste or reference the result in the same turn
Prior Art
- IPython/Jupyter:
!ls,!git statusexecute shell commands inline - Vim:
:!commandruns shell commands without leaving the editor - Many REPLs support
!or.shellescapes for this reason
This would be a small surface-area addition with a disproportionately large quality-of-life impact for terminal-native workflows.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗