! 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.
! 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.
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.
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.