run

run is a command for Claude Code from MadAppGang/magus. It costs 38 tokens per session (743 once invoked), scanned A, original, MIT.

A command for running programs in an isolated terminal session while capturing their complete output and exit status. It cleans up the temporary session when the command finishes.

In plain words
What is it for?
Use it for tests, commands with prompts, terminal-rendered output, Docker Compose, and other tasks that need a real terminal. Use a watch command for processes that must keep running.
Why use it?
It provides a real terminal for interactive prompts, colored output, progress displays, and other commands that do not behave well in a basic shell call.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the terminal plugin — 5 skills, 7 commands, 1 agent shipped together

Good fit Use it for tests, commands with prompts, terminal-rendered output, Docker Compose, and…

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/madappgang/magus/run
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/MadAppGang/magus

Made for: Claude Code.

Or install terminal, the plugin that ships this one along with the rest of its 5 skills, 7 commands, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for run

README.md
[![agentmods](https://agentmods.dev/badge/commands/madappgang/magus/run.svg)](https://agentmods.dev/commands/madappgang/magus/run)
Your own site
<a href="https://agentmods.dev/commands/madappgang/magus/run"><img src="https://agentmods.dev/badge/commands/madappgang/magus/run.svg" alt="Measured on agentmods" height="20"></a>
Per session 38 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 743 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00038 $0.00743
Opus 5 $0.00019 $0.00371
Sonnet 5 $0.00008 $0.00149
Haiku 4.5 $0.00004 $0.00074

Measured 2d ago against content hash f5a3aa9cd115, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

run scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

/terminal:run "curl -s https://api.example.com/health | jq"
plugins/terminal/commands/run.md · 88 lines

How it starts

The opening of the file, as written. The whole thing — 88 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/terminal:run

Run a command in an isolated headless terminal, capture its output, and automatically clean up the session. This is the primary command for most terminal tasks.

Usage

/terminal:run {command}

Examples

/terminal:run npm test
/terminal:run bun test src/auth/
/terminal:run go test ./... -v
/terminal:run python3 -m pytest tests/
/terminal:run docker-compose up --build
/terminal:run "curl -s https://api.example.com/health | jq"

What It Does

  1. Executes the given command in an isolated headless session
  2. Captures the full output (no line limit — uses tee + file internally)
  3. Reports the results including exit code
  4. Auto-cleans the session on completion

The user never needs to manage session IDs or lifecycle.

When to Use /terminal:run vs Bash

Scenario Use
Simple non-interactive command Bash tool
Command with colored/formatted output /terminal:run
Command with interactive prompts /terminal:run
TUI-rendered output (progress bars, tables) /terminal:run
Commands needing a real TTY /terminal:run
Long-running continuous process /terminal:watch instead
Multi-step REPL session /terminal:repl instead

Behavior

For all one-shot commands

mcp__tmux__execute-command({ command: "<user_command>", headless: true })

Returns { output, exitCode } synchronously. Session is auto-destroyed. No session management needed.

For commands with complex output or streaming status

mcp__tmux__start-and-watch({
  command: "<user_command>",
  pattern: "\\$",
  triggers: "exit,error",
  mode: "medium",
  headless: true,
  timeout: 120
})

Use WatchResult.output for the results and WatchResult.event to distinguish success from error.

execute-command returns full output — no line limit since it captures via tee to a temp file rather than a fixed-size viewport.

Error Handling

  • If the command hangs, use mcp__tmux__pane-state to check if it is waiting for input
  • If WatchResult.event == "timeout", the command did not complete within the timeout — report and kill the session
  • For stuck processes, send C-c via mcp__tmux__send-keys with literal: false

Read the full file on GitHub · 88 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 88 lines · 38 tokens per session scan A f5a3aa9cd115

Subscribe to this mod's changes

run is a command published in the GitHub repository MadAppGang/magus (9 stars, last pushed 2d ago), licensed MIT. It adds 38 tokens to every session and 743 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-04.