{"version":"2.1.305","anchor":"headless-bash-commands-from-remote-clients-get-a-full-ad","canonical_anchor":"headless-bash-commands-from-remote-clients-get-a-full-ad","heading":"'!' shell commands sent from elsewhere are now checked and can be refused","tier":"notice","area":"Sessions","scope":"individual","heads_up":true,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.305\/e\/headless-bash-commands-from-remote-clients-get-a-full-ad","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.305","markdown":"### '!' shell commands sent from elsewhere are now checked and can be refused\n\n'!' shell commands arriving from another client now pass a series of checks, and each refusal says why with a 'Not run:' message\n\n**Unclear.** Which ways of sending a '!' command to a session go through these checks is not clear.\n\n**What**\n\nIn Claude Code, a message that starts with `!` runs as a shell command on the computer directly, without going through Claude. When such a command arrives from another client, it now goes through a series of checks before it runs. It is refused when:\n\n- the session is a Remote Control session\n\n- the session is a background session\n\n- the session started before a restart\n\n- the command arrived more than 90 seconds after it was sent\n\n- the command contains control characters (hidden, non-printing characters)\n\n- the command is too long\n\n- another command is already running\n\n- the server did not confirm it received the command\n\nClaude Code waits for the server to confirm receipt before running anything. Each refusal comes back as a message starting with \"Not run:\" that explains the reason, for example that `!` commands are not available in Remote Control sessions and should be run directly on the computer the session is running on.\n\n**Why**\n\nShell commands sent from elsewhere are now much stricter, and when one does not run you are told why and usually whether to send it again.\n\n- Area: Sessions\n- Tier: You'll notice\n- Useful: 3\/5\n- Signal: 3\/5\n- Scope: individual\n- Heads-up: yes"}