setup

A setup command for installing and checking a project’s file-search helper and code-analysis service. It also reports which search tool is active and whether the service is healthy.

In plain words
What is it for?
Use it when setting up the development environment or diagnosing problems with file search and code-analysis tools.
Why use it?
It removes uncertainty about whether the tools needed for code searching and analysis are installed and working.

Command

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 commands/madappgang/magus/setup
Clone the repo
git clone --depth 1 https://github.com/MadAppGang/magus
Per session 27 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,463 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00027 $0.01463
Opus 5 $0.00014 $0.00732
Sonnet 5 $0.00005 $0.00293
Haiku 4.5 $0.00003 $0.00146

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

Security

Grade B, and why

setup scanned grade B 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

1. `~/.claude/settings.json`
plugins/code-analysis/commands/setup.md · 153 lines

How it starts

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

Set up code-analysis

Three things, in this order: the shim, the server, the engine. Report all three at the end even when nothing needed changing — a setup command that prints nothing on a healthy system teaches the user nothing about what healthy looks like.

1. The ripgrep shim

The Grep tool runs ripgrep as a subprocess and resolves rg against PATH. A real file at $HOME/.local/bin/rg is what makes that resolution land on us: the directory sits ahead of the usual package-manager paths, and the file's mere existence stops the shell snapshot from defining an rg function that would beat PATH inside Bash.

Read the current state first

ls -l "$HOME/.local/bin/rg" 2>/dev/null && head -6 "$HOME/.local/bin/rg" 2>/dev/null
command -v rg
type rg

The shim carries an owner marker in its header — OWNER= and VERSION= within the first six lines. Parse it and branch:

OWNER= Do
absent (no file) install
code-analysis upgrade in place if VERSION= differs from this plugin's version; otherwise leave it
anything else stop and ask. Another tool owns that path. Never clobber it silently

Install

mkdir -p "$HOME/.local/bin"
cp "${CLAUDE_PLUGIN_ROOT}/assets/rg" "$HOME/.local/bin/rg"
chmod +x "$HOME/.local/bin/rg"

Route the Grep tool at it

Add to the project's .claude/settings.json:

{ "env": { "USE_BUILTIN_RIPGREP": "0" } }

That setting is a preference, not a switch. The host reads it as "prefer a system rg" and falls through to its embedded copy without saying so when the PATH lookup finds nothing. So never infer routing from the setting — read ripgrepStatus instead:

claude doctor --json

ripgrepStatus.mode is system when routing is live and embedded when it is not; ripgrepStatus.systemPath says which file won.

Three things that break this silently

Symptom Check Meaning
command -v rg is not the shim path PATH order something earlier on PATH shadows it
type rg says "shell function" Bash only a function beats PATH; the shim is bypassed inside Bash calls
setting says 0, mode says embedded both of the above, or no file at all routing is not live, and nothing reported an error

Read the full file on GitHub · 153 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 · 153 lines · 27 tokens per session scan B c6f35ab11e0e

Subscribe to this mod's changes

setup is a command published in the GitHub repository MadAppGang/magus (9 stars, last pushed 4d ago), licensed MIT. It adds 27 tokens to every session and 1,463 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.