investigate

investigate is a command for Claude Code from MadAppGang/magus. It costs 20 tokens per session (1,191 once invoked), scanned A, original, MIT.

A read-only command that delegates code investigation to specialist agents and reports how an implementation works or where a problem originates.

In plain words
What is it for?
Tracing features, understanding component relationships, finding bug origins, and reviewing test coverage.
Why use it?
It lets you examine architecture, code paths, bugs, or test gaps without changing the project.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; mentions CLAUDE.md; names the AskUserQuestion tool.

Part of the dev plugin — 18 skills, 14 commands, 13 agents shipped together

Good fit Tracing features, understanding component relationships, finding bug origins, and reviewing test coverage.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/madappgang/magus/investigate
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 dev, the plugin that ships this one along with the rest of its 18 skills, 14 commands, 13 agents.

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 investigate

README.md
[![agentmods](https://agentmods.dev/badge/commands/madappgang/magus/investigate/github.svg)](https://agentmods.dev/commands/madappgang/magus/investigate)
Your own site
<a href="https://agentmods.dev/commands/madappgang/magus/investigate"><img src="https://agentmods.dev/badge/commands/madappgang/magus/investigate/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 investigate

Your own site · 80×15
<a href="https://agentmods.dev/commands/madappgang/magus/investigate"><img src="https://agentmods.dev/badge/commands/madappgang/magus/investigate.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 20 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,191 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.00020 $0.01191
Opus 5 $0.00010 $0.00596
Sonnet 5 $0.00004 $0.00238
Haiku 4.5 $0.00002 $0.00119

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

Security

Grade A, and why

investigate 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 5d 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/dev/commands/investigate.md · 133 lines

How it starts

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

<user_request>$ARGUMENTS</user_request>

<critical_override> THIS COMMAND OVERRIDES THE CLAUDE.md TASK ROUTING TABLE. WHY: This is a READ-ONLY orchestrator. It must NEVER self-handle investigation work. RULE: ALL investigation must be delegated via Agent tool to the resolved agent. NEVER: Read files, trace code, or analyze architecture inline. NOTE: No autonomy question — investigation is inherently read-only and non-destructive. </critical_override>

  question: "What do you want to investigate?"
  header: "Investigation Scope"
  options:
    - label: "Architecture"
      description: "How system components connect and why — map the big picture"
    - label: "Implementation"
      description: "How a specific feature or flow works — trace the code path"
    - label: "Bug hunt"
      description: "Trace error origins and find where failures occur"
    - label: "Test coverage"
      description: "What is and isn't tested — find coverage gaps"
    - label: "Comprehensive"
      description: "Full multi-perspective analysis — all of the above"

  Inference rules (skip AskUserQuestion if match is confident):
  - "how does X work", "explain", "understand", "trace" → implementation
  - "architecture", "design", "components", "structure", "system" → architecture
  - "error", "crash", "why does", "broken", "bug", "fail" → bug-hunt
  - "test", "coverage", "tested", "untested", "gaps" → test-audit
  - "everything", "full", "comprehensive", "deep", "complete" → comprehensive
</step>

<step number="2" name="Plugin Check">
  Check if the code-analysis plugin is available:

  ```bash
  ls "${HOME}/.claude/plugins/cache/" 2>/dev/null | grep -q "code-analysis"
  ```

  If code-analysis is installed: proceed to step 3a.
  If absent: proceed to step 3b.
</step>

<step number="3a" name="Delegate (code-analysis present)">
  Map scope to investigation mode:
    architecture  → mode: architecture, skill: code-analysis:investigate
    implementation → mode: implementation, skill: code-analysis:investigate
    bug-hunt      → mode: bug, skill: code-analysis:investigate
    test-audit    → mode: test, skill: code-analysis:investigate
    comprehensive → skill: code-analysis:deep-analysis (no mode parameter — it has none)

  Launch the agent:

  Agent(
    run_in_background: false,
    description: """
      Investigate: {$ARGUMENTS}

      Investigation mode: {mode}
      Load skill: {skill} and use mode={mode}.

      RULES:
      - This is READ-ONLY analysis. Do not modify any files.
      - Use the code-analysis MCP tools (mcp__plugin_code-analysis_ca__*) for semantic code navigation.
      - Produce a clear investigation report with findings and evidence.

      FOCUS BY MODE:
      - architecture: system boundaries, component relationships, data flows,
        architectural patterns, PageRank analysis of core abstractions.
      - implementation: entry points, call chains, data transformations,
        exact file/line evidence for each claim.
      - bug: error origins, failure conditions, blast radius,
        reproduction steps, root cause identification.
      - test: what is tested, what is not, coverage gaps,
        risky untested paths, test quality assessment.
      - (comprehensive scope routes to code-analysis:deep-analysis, which takes no
        mode) all 4 modes above, synthesized into unified report
        with cross-cutting observations.
    """,
    subagent_type: "code-analysis:detective"
  )
</step>

Read the full file on GitHub · 133 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. 5d ago First seen · 133 lines · 20 tokens per session scan A adf1db214fb2

Subscribe to this mod's changes

investigate is a command published in the GitHub repository MadAppGang/magus (9 stars, last pushed today), licensed MIT. It adds 20 tokens to every session and 1,191 once invoked, about $0.0001 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.

Related

Other commands, from other repositories