[FEATURE] Bash mode variant that does not add the command and its output to context (e.g. `!!`)

Status Open
Maintainer reply None cached
Activity 0 comments · opened Jul 28, 2026

What I'm trying to do

Run trivial, high-frequency shell commands — pwd, ls, git status, cd — without them entering the conversation context.

Current behaviour

Bash mode (! prefix) adds both the command and its output to context, unconditionally. This is documented and clearly deliberate — from the interactive-mode docs:

Bash mode: Adds the command and its output to the conversation context Shows real-time progress and output

There is no way to opt out. The settings reference has only two bash-mode settings, and neither applies: defaultShell (picks bash vs powershell) and disableSkillShellExecution (blocks inline ` !... ` in skills — it stops commands running, rather than keeping output out of context).

Why this is a problem

To be precise about the cost, because it is easy to state this wrongly: ! already avoids an LLM round-trip for execution. The command runs straight in the shell and output appears immediately. That part is great and I'm not asking to change it.

The cost is deferred. Because the output joins the conversation, it is carried in every subsequent request for the rest of the session. So a handful of ls calls on a large directory permanently inflate the prompt — paying tokens and latency on every later turn, for output whose entire useful lifetime was the two seconds I spent reading it.

There is also a signal-to-noise cost: context fills with directory listings that were never meant for the model, which is exactly the material you would want out of a long session.

Proposal

Make visibility opt-in per command, rather than always-on:

  • ! — unchanged. Runs, displays, adds to context. Still the default.
  • !! (or !?, or similar) — runs and displays to the user, but does not add the command or its output to context.

A settings key could flip which one is the default, with the other prefix as the escape hatch, but the per-command form is the important part.

The tradeoff, acknowledged

Visibility is often load-bearing. If I run rm somefile quietly, the agent's picture of the working tree is silently stale, and the next thing it tells me about that tree may be wrong.

That is a strong argument for opt-in per command and against a global "hide by default" setting — the user should choose silence for the command where it is obviously safe (ls), and keep the default everywhere it matters (anything mutating). Framing it as opt-in visibility rather than opt-out logging seems the safer design.

Current workaround, and why it's unsatisfying

Run the command in a separate terminal. That works and is genuinely private, but it gives up the integrated flow that makes bash mode worth having — you lose the shared working directory and the single-window workflow.

Related

  • #13882 — feature request for a fuller interactive shell in bash mode (history search, completions). Different concern, same surface; worth considering together if bash mode gets attention.
  • #50130 — docs issue that quotes the current "adds the command and its output to the conversation context" behaviour.

View original on GitHub ↗