investigate

investigate is a command for Claude Code from MadAppGang/magus. It costs 20 tokens per session (1,334 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 — 19 skills, 15 commands, 12 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 19 skills, 15 commands, 12 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,334 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.01334
Opus 5.5 $0.00008 $0.00534
Sonnet 5.5 $0.00004 $0.00267
Haiku 4.5 $0.00002 $0.00133

Measured 2mo ago against content hash 0181dbd946f5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 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/dev/commands/investigate.md · 140 lines

How it starts

The opening of the file, as written. The whole thing — 140 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">
  Look for `code-search:analyze` in the Agent tool's list of available agent types.

  That list is the only authority: it is what this session actually loaded, after
  scope, enablement and version resolution. Do not check the disk instead. The plugin
  cache is laid out `cache/<marketplace>/<plugin>/<version>`, and a cached plugin can
  be disabled or installed after this session started.

  If `code-search:analyze` is listed: proceed to step 3a.
  If it is not listed: proceed to step 3b.
</step>

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

  Launch the agent:

  Agent(
    subagent_type: "code-search:analyze",
    run_in_background: false,
    description: "Investigate: {target in three or four words}",
    prompt: """
      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-search MCP tools (mcp__plugin_code-search_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-search:deep-analysis, which takes no
        mode) all 4 modes above, synthesized into unified report
        with cross-cutting observations.
    """
  )
</step>

Read the full file on GitHub · 140 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 · -1 lines 0181dbd946f5
  2. 2mo ago Changed · +8 lines 8287474bd5ac
  3. 2mo ago Changed 939510d1a521
  4. 2mo 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 (16 stars, last pushed today), licensed MIT. It adds 20 tokens to every session and 1,334 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-09-04.

Related

investigate compared with commands from other repositories

investigate next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
investigateMadAppGang/magusCommand16todayMITA20Claude 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