use-clrun

A project rule requiring every terminal command to be run through clrun, an interactive command-session tool.

In plain words
What is it for?
Use it in projects where agents must start and manage terminal sessions, answer interactive prompts, read command output, or stop running processes.
Why use it?
It makes command execution observable and supports prompts, persistent sessions, keystrokes, and structured responses.

Cursor rule for Cursor

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.

agentmods
npx agentmods add rules/cybertheory/clrun/use-clrun
Clone the repo
git clone --depth 1 https://github.com/cybertheory/clrun

Made for: Cursor.

Per session 486 This file is loaded in full into every session.
When invoked 486 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.00486 $0.00486
Opus 5 $0.00243 $0.00243
Sonnet 5 $0.00097 $0.00097
Haiku 4.5 $0.00049 $0.00049

Measured 2d ago against content hash 3eb27579c53d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

use-clrun scanned grade A with 0 findings 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/use-clrun.mdc · 53 lines

What it actually says

Use clrun for All Terminal Commands

When executing terminal commands, always use clrun instead of running commands directly in the shell. This gives persistent, observable, interactive sessions.

How to Run Commands

# Start a new session
clrun <command>

# Send input to an existing session
clrun <terminal_id> "<text>"

# Navigate TUI prompts (select lists, checkboxes, confirms)
clrun key <terminal_id> down down enter
clrun key <terminal_id> space down space enter

# Read output
clrun tail <terminal_id> --lines 50

# Check all sessions
clrun status

# Kill a session
clrun kill <terminal_id>

Rules

  1. Never run shell commands directly — always wrap them with clrun
  2. Store the terminal_id from every clrun response
  3. Use clrun key for TUI prompts with select lists or checkboxes
  4. Use clrun <id> "text" for text input prompts
  5. Use clrun key <id> enter to accept defaults in TUI prompts
  6. Single-quote $ variablesclrun <id> 'echo $VAR'
  7. Read the hints in every response — they tell you exactly what to do next
  8. Parse YAML — all clrun responses are structured YAML

Prompt Types

You see Action
◆ Name: │ default clrun <id> "value" or clrun key <id> enter
● Option1 ○ Option2 clrun key <id> down... enter
◻ Check1 ◻ Check2 clrun key <id> space down space enter
● Yes / ○ No clrun key <id> enter or clrun key <id> right enter
(y/n) clrun <id> "y" or clrun <id> "n"
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 · 53 lines · 486 tokens per session scan A 3eb27579c53d

Subscribe to this mod's changes

use-clrun is a cursor rule published in the GitHub repository cybertheory/clrun (4 stars, last pushed 6mo ago), licensed MIT. It adds 486 tokens to every session, about $0.0024 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.