Inline shell command execution from the Claude Code prompt (! prefix or /run command)

Status Closed — not planned
Maintainer reply None cached
Activity 2 comments · opened Mar 5, 2026 · closed Apr 3, 2026

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:

  1. Suspending or context-switching away from Claude Code
  2. Opening a new terminal tab or pane
  3. Running the command
  4. 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 status execute shell commands inline
  • Vim: :!command runs shell commands without leaving the editor
  • Many REPLs support ! or .shell escapes for this reason

This would be a small surface-area addition with a disproportionately large quality-of-life impact for terminal-native workflows.

View original on GitHub ↗

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