Run one command with !
Start a message with ! and it runs as a command instead of going to the agent,
the way ! works in the CLIs. The command and everything it printed land in the
transcript as a card, in place, next to the conversation you were having.
Why you would use it
You are mid-conversation and want one command — git log -1, ls, npm test —
and you want the answer where you are reading. It does not switch you to
Shell mode and back, and the card stays in
the thread, so scrolling up an hour later still finds what the command said.
Asked as a message instead, a command was only a suggestion: claude answered
! rm -rf /tmp/… by listing the files and leaving them there.
How to use it
In Agent mode, type
!followed by the command in the composer (#draft), for example!git status.! git statuswith a space works too.
Send (
#send).The card appears in the transcript, says
running…, and fills in with the output when the command exits.
What you see
- The composer clears and a card appears at the end of the transcript, tagged
SHELL, with the command in the header in shell colouring. - While it runs the body reads
running…and the right of the header shows…. When it exits, the body is what the command printed — stdout and stderr in the order they came — and the…becomes how long it took. - A command that exits non-zero wears the error tag and its output ends with
exit <code>on a line of its own. - The copy button in the header copies the output.
- If the request itself could not be made — offline, or no tab open — nothing runs, a toast says why, and the text you typed goes back into the composer so you can edit rather than retype it.
Limits and known gaps
- One line only. A message with a newline in it is a message.
![is a markdown image and is sent to the agent.!!is a message, and so is a bare!.- At most 2000 characters of command; longer is refused as
a command is at most 2000 characters. - The agent is not told. The card is in the transcript and in the log, but nothing of it is sent into the agent's session — ask the agent about it and it has not seen it.
- Nothing is interactive: input is
/dev/null, so a command that asks a question reads end-of-file rather than waiting for you. - Output is cut at 8000 characters, and the card ends with
… output truncated at 8000 characters; the command is stopped when it hits that cap. - At most four commands run at once in one tab. A fifth is refused until one of the first four finishes.
- A command still running after 120 seconds is stopped — its process group is
signalled — and the card ends with
… stopped after 120s. - Sending is not queued: a
!line runs now, whether or not a turn is running, so it never joins the message queue. - It is not the shell pane and shares nothing with it: no
scrollback, no
cdthat survives to the next command, no history. Each!line is one command on its own.
Related
- shell-mode — stay in the shell for more than one command
- run-a-command-from-a-code-block — run a bash block from a reply with one tap
- shell-keys — single keys into the same pane
- shell-keys — single keys into the same pane
- send-a-message — the ordinary path
- agent-or-shell-mode — the chips this avoids switching
- read-the-transcript — the cards this one joins
- terminal-output-and-links — getting a URL out of the result