Queued messages with command syntax are sent as raw text instead of being executed

Resolved 💬 3 comments Opened Jan 15, 2026 by nsheaps Closed Jan 19, 2026

Summary

When a user queues a message while Claude is executing (mid-turn), special command syntaxes like inline bash commands (` !command ) and slash commands (/commit`) are sent as literal text to the LLM rather than being executed and having their results injected.

Expected Behavior

Commands queued during execution should be processed the same way as commands entered when Claude is idle:

  1. ` !ls -la ` should execute the bash command and inject the output
  • As a user, I want them to execute immediately upon submission, but it's output can be queued until it can be injected. I frequently use this for things like ` !code . ` to open the current directory in VS Code. This is very useful while running multiple sessions to ensure you get the correct vscode window.
  1. /commit should invoke the skill/slash command and inject its result

The LLM should receive the command output, the same as it would if it were not running a task and the user submitted it as a new message.

Actual Behavior

When queued during execution:

  1. ` !ls -la is sent as the literal string "!ls -la`" to the LLM
  2. /commit is sent as the literal string "/commit" to the LLM
  3. The LLM then has to interpret these as instructions rather than receiving pre-processed results. Rules allow it to understand how to treat that message, but it is less efficient and can lead to inconsistent behavior.

Impact (low)

  • Wasted tokens: The LLM spends cycles parsing and responding to command syntax instead of receiving results directly
  • Inconsistent behavior: Commands work differently depending on timing
  • User confusion: Users expect commands to work the same way regardless of when they're entered

Steps to Reproduce

  1. Start Claude Code
  2. Give Claude a task that takes several seconds (e.g., running a benchmark)
  3. While Claude is executing, type a queued message with command syntax:
  • Queue: ` !echo "test" `
  • Or queue: /commit
  1. Observe that when the message is processed, the raw syntax appears in the conversation instead of the command output

Environment

  • Claude Code CLI (2.1.7) / macos arm 64 / brew install
  • Observed in interactive terminal sessions

---

🤖 Generated with Claude Code

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗