Skip to content
Back to skills

Spawn Investigator

ASecurity

Investigate a codebase question using an isolated subagent. Use when you need to read many files without bloating the main context.

  • 666 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added June 10, 2026
ai-agentsgo

Security analysis

A100/100

Scanned June 10, 2026

npx -y skills add majiayu000/claude-skill-registry --skill spawn-investigator --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Spawn Investigator?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Spawn Investigator
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-spawn-investigator/badge)](https://www.skillsdirectory.com/skills/majiayu000-spawn-investigator)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: spawn-investigator
description: Investigate a codebase question using an isolated subagent. Use when you need to read many files without bloating the main context.
argument-hint: [question to investigate]
---

# Spawn Investigator

Launch an isolated investigation subagent to answer a codebase question without polluting the main conversation context.

## Why This Exists

Reading many files to answer a question fills up the main context window. By spawning an Explore-type subagent, the investigation happens in a separate context. Only the concise answer comes back, keeping the main context clean for actual work.

## Usage

- `/spawn-investigator <question>` — User-invoked investigation
- Claude can also auto-invoke this when it recognizes a question requiring broad codebase exploration

## Procedure

### Step 1: Formulate the Question

Parse `$ARGUMENTS` into a clear, specific investigation question. If the question is vague, refine it:

- BAD: "How does auth work?"
- GOOD: "What authentication middleware is used, where is it configured, and what are the auth routes?"

### Step 2: Spawn the Subagent

Use the Task tool with these parameters:

```
subagent_type: Explore
description: "Investigate: [short summary]"
prompt: |
  Investigate this question about the codebase:

  **Question:** [the question]

  Instructions:
  - Search broadly first (Glob for file patterns, Grep for keywords)
  - Read the most relevant files
  - Trace the code path if needed (follow imports, function calls)
  - Return a CONCISE answer (max 500 words) with:
    1. Direct answer to the question
    2. Key file paths discovered
    3. Any important caveats or gotchas
  - Do NOT include full file contents in your response
```

### Step 3: Report Back

When the subagent returns, present the findings to the user:

```
## Investigation Results: [question summary]

[Subagent's concise answer]

### Key Files
- `path/to/file1` — [what it does]
- `path/to/file2` — [what it does]
```

If the answer is insufficient, offer to spawn a follow-up investigator with a more specific question.

## When to Auto-Invoke

Claude should consider auto-invoking this skill when:
- The user asks a broad "how does X work?" question
- Answering requires reading 5+ files
- The main context is already large (approaching compaction)
- The question is about understanding, not modifying, code

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.