Skip to content
BENIBIX Learn

! Shell Mode vs the Bash Tool

People think a ! command and a command Claude runs are the same thing. With !, you run the command yourself, at once, with no approval and outside the sandbox. The Bash tool is how Claude runs a command, so it goes through your permission rules and the sandbox. Both put the output in the chat.

AI⌨️ Claude Code

! Shell Mode

The ! prefix that runs your own shell command and puts its output in the chat.

Shell mode is the Claude Code feature you start by typing ! at the start of the prompt. The command runs in your shell at once, with no approval, and its output joins the chat. Claude then replies to it, at the cost of a normal prompt. It runs outside the sandbox, because the sandbox fences only Claude's commands. Esc or Backspace on an empty prompt leaves it.

Example
Leo types ! npm test. The tests fail, and Claude explains why without a second prompt.
Why it matters
You can run a quick command yourself and still give Claude what it printed.
Full entry
AI⌨️ Claude Code

Bash Tool

The tool that runs shell commands on your computer.

The Bash tool runs shell commands on your computer, such as tests, builds and git. Each command runs in its own process. A change of folder carries over to the next command, but a variable you export does not. A command stops after two minutes by default, and Claude can ask for up to ten. Long jobs, such as a dev server, can run in the background. Bash asks before it runs, unless a rule or your mode allows the command.

Example
Emma asks Claude to fix a failing test. It runs the tests with Bash, reads the error, makes a fix, and runs them again until they pass.
Why it matters
It is what lets Claude check its own work by running it, not just reading it.
Full entry

In one line

! Shell Mode
The ! prefix that runs your own shell command and puts its output in the chat.
Bash Tool
The tool that runs shell commands on your computer.