!command shell passthrough should not consume model tokens

Open 💬 0 comments Opened Jul 8, 2026 by chidambaram-manivannan

Description

When using the \!\ prefix to run a shell command directly (e.g. \!pwd\), the command is executed by the harness itself rather than being routed through the model. However, the command's output is still appended to the conversation context and appears to be billed/counted as if the model had processed it.

Expected behavior

Since \!\-prefixed commands are a harness-level passthrough and don't require the model to generate or interpret them, their output should either:

  • Be excluded from token/cost accounting, or
  • At minimum, not require a model turn just to relay the result back into context.

Why this matters

Users running quick shell commands (e.g. \!pwd\, \!ls\) to inspect state before continuing a conversation shouldn't be charged model tokens for output that never needed to touch the model in the first place.

View original on GitHub ↗