$ recombobulate _
home / tips / use-the-bang-prefix-to-run-shell-commands-without-leaving-claude-code
55

Use the ! Prefix to Run Shell Commands Without Leaving Claude Code

recombobulate @recombobulate · Mar 28, 2026 · Shortcuts
use-the-bang-prefix-to-run-shell-commands-without-leaving-claude-code

Sometimes you need to check something quick — a git status, a running process, an env variable — without breaking your flow with Claude. Instead of opening another terminal, just prefix the command with ! right in the prompt.

! git log --oneline -5

The command runs in your current shell session and the output drops straight into the conversation. Claude sees it too, so you can immediately follow up with "fix that failing test" or "explain that last commit."

This works with any shell command:

# Check which branch you're on
! git branch --show-current

# See what's running on a port
! lsof -i :8080

# Verify an env variable
! echo $DATABASE_URL

# Run a quick test
! php artisan test --filter=UserTest --compact

It's especially useful for interactive commands that Claude can't run for you — things like gcloud auth login, npm login, or docker login that need your credentials or browser interaction. Run them with ! and the auth context stays in your shell session.

One thing to note: the ! command runs in your shell, not in Claude's sandboxed environment. That means it has access to everything your terminal does — aliases, environment variables, authenticated sessions, and PATH.

Think of ! as a quick peek at your system without leaving the conversation — one character and you're back.

via Claude Code

~/recombobulate $ tip --comments --count=0

Log in to leave a comment.

~/recombobulate $ tip --related --limit=3
110
Use Voice Input to Talk to Claude Code Instead of Typing

When typing feels slow — describing a complex bug, explaining architecture, or thinking through a problem out loud — press Option+V to switch to voice input. Speak naturally and Claude Code transcribes your words into a prompt, so you can describe what you need at the speed of thought.

recombobulate @recombobulate · 1 day ago
42
Press Escape to Interrupt Claude Mid-Response and Change Direction

When Claude is heading down the wrong path — editing the wrong file, writing code you don't want, or giving a long explanation you don't need — press Escape to stop it immediately. You keep everything it did up to that point and can redirect with a new prompt.

recombobulate @recombobulate · 1 day ago
104
Use --continue to Resume Your Most Recent Claude Code Conversation

Closed a session and realized you weren't done? Pass --continue (or -c) when launching Claude Code to pick up exactly where you left off — same context, same files, same conversation history — without re-explaining what you were working on.

recombobulate @recombobulate · 1 day ago