analyze

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

A read-only codebase investigation command that traces architecture, feature flows, file locations, bugs, patterns, and dependencies.

In plain words
What is it for?
Use it to locate an implementation, follow a request from an endpoint to a database, explain how a system works, or investigate a bug.
Why use it?
It helps you understand unfamiliar code and find where a problem begins without changing any files.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool.

Part of the code-search plugin — 4 skills, 3 commands, 1 agent shipped together

Good fit Use it to locate an implementation, follow a request from an endpoint to a database, explain how a system works, or investigate a bug.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/madappgang/magus/analyze
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 code-search, the plugin that ships this one along with the rest of its 4 skills, 3 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 analyze

README.md
[![agentmods](https://agentmods.dev/badge/commands/madappgang/magus/analyze/github.svg)](https://agentmods.dev/commands/madappgang/magus/analyze)
Your own site
<a href="https://agentmods.dev/commands/madappgang/magus/analyze"><img src="https://agentmods.dev/badge/commands/madappgang/magus/analyze/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for analyze

Your own site · 80×15
<a href="https://agentmods.dev/commands/madappgang/magus/analyze"><img src="https://agentmods.dev/badge/commands/madappgang/magus/analyze.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 31 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 977 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00031 $0.00977
Opus 5.5 $0.00012 $0.00391
Sonnet 5.5 $0.00006 $0.00195
Haiku 4.5 $0.00003 $0.00098

Measured 2mo ago against content hash b4ef0197f1b3, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

analyze 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 2mo 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.

plugins/code-search/commands/analyze.md · 123 lines

How it starts

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

Mission

Dispatch the code-search:analyze agent at one question about this codebase. The answer comes back as file:line locations and the flow between them. Nothing is modified.

Analysis request

$ARGUMENTS

When to use it

  • Architecture — how is authentication implemented, what does the data layer look like
  • Location — where is the user registration logic, which file handles payments
  • Flow — follow a request from endpoint to database
  • Bugs — why login fails, where an error originates
  • Patterns — where API calls are made, which components use a given store
  • Dependencies — what uses this service, what breaks if it changes

Step 1 — read the request

Parse three things out of $ARGUMENTS before dispatching:

  1. What do they want to understand?
  2. Which functionality does it concern?
  3. What is the context — debugging, learning, or refactoring? The same question wants a different answer in each.

A specific question beats a broad one. "Analyze the codebase" buys a tour; "where is the email validation logic" buys a file and a line number. If the request is broad enough that the investigation would be spent on orientation, narrow it first — ask which part matters, or state the narrower question you are about to answer and why.

Step 2 — dispatch the analyze agent

Agent(
  subagent_type: "code-search:analyze",
  run_in_background: false,
  description: "Investigate [brief description]",
  prompt: `
    Investigate the following in the codebase:

    [the request, restated as one specific question]

    Context: [debugging | learning | refactoring]
    Working directory: [current working directory]

    Anchor: [the symbol, file, or specific behaviour to start from]
    Job: [locate | trace a flow | map dependencies | find a bug's origin]

    Return your Location report.
  `
)

Do not tell the agent which retrieval tool to use. It reads the tool list itself and routes per question — structural tools when the engine offers them, text search when the question is genuinely about an exact literal or a filename pattern. Prescribing a tool from here is how the command and the agent ended up contradicting each other.

Read the full file on GitHub · 123 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. 2mo ago Changed · -4 lines b4ef0197f1b3
  2. 2mo ago Changed 528115430f0b
  3. 3mo ago First seen · 127 lines · 31 tokens per session scan A 387b1a42bedd

Subscribe to this mod's changes

analyze is a command published in the GitHub repository MadAppGang/magus (16 stars, last pushed today), licensed MIT. It adds 31 tokens to every session and 977 once invoked, about $0.0001 per session on Opus 5.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.

Related

analyze compared with commands from other repositories

analyze next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
analyzeMadAppGang/magusCommand16todayMITA31Claude Code
qa-changesOpenHands/extensionsCommand190todayMITA63Claude Code
auditar-cascadingluanpdd/kit-mcpCommand5yesterdayMITA54Claude Code
react-nativegetsentry/toolkitCommand977yesterdaynoneA0Claude Code
doctordoncheli/don-cheli-sddCommand593mo agoApache-2.0A76Claude Code
doctorfatihkan/badiCommand81mo agoMITA0Claude Code
fixstefan-jansen/claude-code-toolkitCommand1014mo agoMITA9Claude Code