[FEATURE] !! prefix — fire-and-forget shell escape (no context injection, works anytime)
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
! bash mode serves two distinct user needs with one mechanism:
- "Run this and show Claude" — the output is part of the conversation.
! git statusso Claude sees the result and acts on it. - "Run this for myself" — the user needs to check something. Tail a log, verify a file, check disk space. Claude doesn't need to know.
Today, both use !, both inject into context, and both only work when Claude is idle. This creates two pain points:
- Context waste: Output from "just checking" commands burns context window for no reason. A
tail -100 app.logordf -hthat the user glances at and moves on from shouldn't cost tokens. - Idle-only limitation: The moments you most need a quick check are exactly when Claude is busy — and
!doesn't work then (#34995).
---
Prior Reports (related but distinct)
Several issues request overlapping pieces of this capability, but none propose the !! syntax or the explicit context/no-context split:
| Issue | Request | Status | Gap |
|-------|---------|--------|-----|
| #34995 | Non-blocking ! during processing | Open | Would change ! semantics based on timing — same syntax, different behavior |
| #36820 | /btw !command for non-interrupting shell | Open | Heavier syntax, requires /btw prefix awareness |
| #27793 | Auto-continue after ! completes | Closed (stale) | Wouldn't be needed if the command never interrupted Claude |
| #3674 | $ prefix for immediate shell + context capture | Closed | Opposite direction — wanted context injection, not exclusion |
This issue consolidates them into one clearly scoped, opinionated proposal.
---
Proposed Solution
Add a !! prefix for fire-and-forget shell commands:
| Prefix | When it works | Output in context? | Use case |
|--------|--------------|-------------------|----------|
| ! | Idle only (current behavior, unchanged) | Yes | "Run this and show Claude" |
| !! | Anytime (idle or processing) | No | "Run this for myself" |
---
Why Two Prefixes Instead of Changing !
#34995 proposes making ! itself work during processing, but with no context injection. This creates an inconsistency: ! would behave differently depending on whether Claude is idle or busy. Same syntax, different semantics based on timing.
A separate !! makes intent explicit regardless of Claude's state:
!always means "Claude should see this" (current behavior, untouched)!!always means "this is for me, not Claude"
No ambiguity. No behavior that changes based on timing. Users choose the prefix based on their intent, not based on what Claude happens to be doing.
---
Alternative Solutions (current workarounds)
| Workaround | Downside |
|------------|----------|
| Switch to another terminal tab | Breaks flow, Claude has no visibility into what was run |
| Wait for Claude to finish, then use ! | Defeats the purpose when you need a quick check mid-task |
| Use /btw with shell output | /btw doesn't execute commands, only injects text |
| Run command in another pane, paste result | Extra steps, manual, loses momentum |
Other tools' approaches:
- IPython/Jupyter:
!commandruns immediately regardless of kernel state - Vim:
:!commandis always available, never blocked by editor state - bash itself:
!!re-runs the last command — different semantics, but the "double for variant" convention is established
---
Priority
Medium — Significant quality-of-life improvement
Feature Category
TUI / Bash mode
---
Use Case Example
"Claude was generating a 200-line refactor across 3 files. I wanted to check if the staging server had deployed — just a quickcurl -s localhost:8080/health. I couldn't type!because Claude was busy. I switched to another terminal, ran the curl, confirmed the deploy, switched back. By the time I returned, Claude had finished and was waiting for input. The entire context switch took 15 seconds for a command that takes 0.2 seconds."
With !!:
# Claude is actively generating — check something for yourself
> !! curl -s localhost:8080/health
{"status":"ok"}
# Output displayed, Claude keeps working, no context burned
# Tail logs while Claude debugs
> !! tail -5 /var/log/app.log
# Glance at output, move on
# Interactive tool while Claude works
> !! htop
# Full interactive session, Claude unaware
---
Additional Context
Technical considerations:
!!subprocess shares CWD with the Claude Code session (same as!)- Output should be visually distinct (dimmed or prefixed) to signal it's user-only, not part of the conversation
- No interaction with Claude's turn state — fires during idle, processing, or tool approval
Ctrl+Ccancels the!!subprocess without affecting Claude's process- Long-running
!!commands (e.g.,tail -f) should work naturally
The /btw precedent:
/btw already proves the non-interrupting injection pattern works during active turns. !! is an even lighter-weight version — no AI processing needed, just subprocess execution.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗