investigate

investigate is a skill for Claude Code, Codex from rijuvashisht/Magneto. It costs 0 tokens per session (537 once invoked), scanned A, original, MIT.

A root-cause debugging workflow for investigating a bug or error before changing code. Root cause means the underlying reason a failure happens, rather than just its visible symptom.

In plain words
What is it for?
Use it to gather code and past-bug evidence, test several possible explanations, and produce a written analysis of the cause.
Why use it?
It reduces guesswork and discourages quick fixes that leave the real problem in place. It also limits investigation to the affected module.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to gather code and past-bug evidence, test several possible explanations, and produce a written analysis of the cause.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/rijuvashisht/magneto/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.

Any agent
npx skills add rijuvashisht/Magneto --skill investigate
Clone the repo
git clone --depth 1 https://github.com/rijuvashisht/Magneto

Made for: Claude Code, Codex.

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/skills/rijuvashisht/magneto/investigate/github.svg)](https://agentmods.dev/skills/rijuvashisht/magneto/investigate)
Your own site
<a href="https://agentmods.dev/skills/rijuvashisht/magneto/investigate"><img src="https://agentmods.dev/badge/skills/rijuvashisht/magneto/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/skills/rijuvashisht/magneto/investigate"><img src="https://agentmods.dev/badge/skills/rijuvashisht/magneto/investigate.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 537 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.00000 $0.00537
Opus 5 $0.00000 $0.00269
Sonnet 5 $0.00000 $0.00107
Haiku 4.5 $0.00000 $0.00054

Measured 11d ago against content hash e4097c8491aa, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, 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 11d 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.

src/templates/magneto-skills/skills/investigate/SKILL.md · 77 lines

How it starts

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

/investigate — Root-Cause Debugging with Auto-Freeze

Role: Debugger Inputs: bug description or error trace Outputs: review-report.md with root-cause analysis Audit actions: investigate.started, investigate.hypothesis_tested, investigate.resolved


Why This Skill Exists

Karpathy's Iron Law: No fixes without investigation. AI assistants fix symptoms. /investigate forces root-cause analysis before any change.

The Protocol

Step 1: Auto-freeze to the affected module

From the error trace or bug description, identify the primary file. Then:

magneto freeze <module-path>

This prevents drive-by fixes in unrelated code while debugging.

Step 2: Gather evidence (don't theorize yet)

magneto graph neighbors <failing-node>     # who calls this?
magneto query --search "<error-keyword>"   # has this happened before?
magneto memory show --tags bugs,debugging  # similar past bugs

Step 3: Generate 3 hypotheses

Write them down explicitly. Example:

  1. Race condition in token refresh (evidence: timestamps cluster during concurrent requests)
  2. Stale cache (evidence: fresh deploys always work)
  3. Upstream API changed schema (evidence: nothing local changed)

Step 4: Test each hypothesis with minimal code

For each:

  • Define the verification step
  • Execute it (add logging, run a test, inspect state)
  • Mark as confirmed, ruled-out, or inconclusive

Emit audit: magneto audit add investigate.hypothesis_tested --payload '{"hypothesis":"...","result":"..."}'

Step 5: STOP after 3 failed fix attempts

If 3 attempts to fix haven't resolved it, STOP and:

  • Write findings to review-report.md
  • Ask the user for more info
  • DO NOT keep trying variations — that's how bugs get hidden

Step 6: Apply the fix

Only after root cause is confirmed:

  • Apply the minimal fix (Karpathy Rule 2: simplicity first)
  • Add a regression test
  • Run magneto unfreeze

Trigger Phrases

  • "investigate"
  • "debug this"
  • "root cause"
  • "what's wrong with"

Read the full file on GitHub · 77 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. 11d ago First seen · 77 lines · 0 tokens per session scan A e4097c8491aa

Subscribe to this mod's changes

investigate is a skill published in the GitHub repository rijuvashisht/Magneto (6 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 537 tokens. 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

Other skills, from other repositories