Skip to main content
The bash_tool primitive runs arbitrary shell commands inside the chat’s sandbox. Combined with the pre-installed stack, the model can do anything a developer can do.

Languages

Behavior

  • Streaming output. The tool streams stdout/stderr back to the model with 15-second heartbeats — no silent hangs.
  • Truncation-aware. Output caps at 30K chars (first 15K + last 15K), so a runaway grep doesn’t blow the context window.
  • Semantic exit codes. grep returning 1 is treated as “no match,” not an error.
  • Timeout. Commands die after COMMAND_TIMEOUT seconds (default 120). Override per call.

Typical patterns

Data wrangling
Media
Git
Server
The sandbox has its own network namespace — long-running servers stay up until the container is GC’d.

When to prefer a skill

If a task fits a skill (docx, xlsx, pptx, pdf, playwright-cli, …), the skill has curated scripts that are faster, safer, and produce more polished output than hand-rolled bash. The model picks automatically based on the <available_skills> block in its system prompt.