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.
npx agentmods add commands/madappgang/magus/replgit clone --depth 1 https://github.com/MadAppGang/magusWrote 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.
[](https://agentmods.dev/commands/madappgang/magus/repl)<a href="https://agentmods.dev/commands/madappgang/magus/repl"><img src="https://agentmods.dev/badge/commands/madappgang/magus/repl.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00044 | $0.00883 |
| Opus 5 | $0.00022 | $0.00441 |
| Sonnet 5 | $0.00009 | $0.00177 |
| Haiku 4.5 | $0.00004 | $0.00088 |
Grade A, and why
repl 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.
How it starts
The opening of the file, as written. The whole thing — 94 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/terminal:repl
Open an interactive REPL or database shell, execute queries/expressions, and manage the session lifecycle.
Usage
/terminal:repl {application} [query]
Examples
Database shells:
/terminal:repl psql $DATABASE_URL
/terminal:repl "psql -d myapp" "SELECT count(*) FROM users"
/terminal:repl mongosh $MONGO_URI
/terminal:repl redis-cli
/terminal:repl "turso db shell mydb"
Language REPLs:
/terminal:repl python3
/terminal:repl node
/terminal:repl "bun repl"
/terminal:repl irb
What It Does
- Creates a headless session:
create-headless({ name: "repl" })→{ paneId } - Opens the REPL application with
start-and-watch, blocking until the prompt appears:start-and-watch({ paneId, command: app, pattern: <prompt_pattern>, timeout: 15 }) - Executes each query with
run-in-repl:run-in-repl({ paneId, input: query, promptPattern: <pattern>, timeout: 10 })→ returns{ output }directly (no snapshot needed) - Exits the REPL with
run-in-repl({ input: exit_command, promptPattern: "\\$" }) - Closes the session with
kill-session
Prompt Patterns for run-in-repl
| Application | promptPattern |
|---|---|
| psql | "=#" |
| mongosh | ">" |
| redis-cli | "127\\.0\\.0\\.1:\\d+>" |
| python3 | ">>> " |
| node / bun | "> " |
| irb | "irb>" |
| turso shell | ">" |
| bash/zsh shell | "\\$\\s*$" |
REPL Exit Commands
| Application | Exit Command |
|---|---|
| psql | \q |
| mongosh | .exit or Ctrl+D |
| redis-cli | quit or Ctrl+D |
| python3 | exit() or Ctrl+D |
| node / bun | .exit or Ctrl+D |
| irb | exit or Ctrl+D |
| turso shell | .quit |
Multi-Query Sessions
Each query is one run-in-repl call — output is returned directly, no screen scraping needed:
result1 = run-in-repl({ input: "SELECT count(*) FROM users;", promptPattern: "=#" })
result2 = run-in-repl({ input: "SELECT * FROM settings LIMIT 5;", promptPattern: "=#" })
// output fields contain the full query results
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.
- 2d ago First seen · 94 lines · 44 tokens per session scan A 0f73ed388890
repl is a command published in the GitHub repository MadAppGang/magus (9 stars, last pushed 2d ago), licensed MIT. It adds 44 tokens to every session and 883 once invoked, about $0.0002 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-09-04.
Other commands, from other repositories
gen
Automatically generates type definitions based on your Postgres database schema.
generate-model
Génération Model SQLAlchemy.
drizzle-orm-rules
Rules for using Drizzle ORM within the src/lib/db directory. Ensures consistent data modeling and database interactions.
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
specify
Create or update the feature specification from a natural language feature description.