AIToday
AI Coding AssistantsLarge Language ModelsZenn AI/MLPublished: Nov 23, 2026, 04:00 JST

Claude Code: use Explore subagents to keep main context clean

Send on LINE
Claude Code: use Explore subagents to keep main context clean

3 Key Points

  1. What happened

    The guide recommends running codebase research in a separate-context subagent — built-in Explore (read-only, with quick/medium/very thorough depth) or a custom investigator.md — so only a summary returns to the main chat.

  2. Why it matters

    Reading files piles their contents into the main conversation and buries the actual instructions; offloading research preserves context, and limiting tools to read-only prevents accidental edits by design.

Not sure about something? Ask the AI

Questions and answers are published on this page.

Summaries like this, every morning.

By signing up you agree to the Terms of Service and Privacy Policy.

Context & Analysis

The problem the guide addresses is structural: when research happens inside the main conversation, every file read accumulates as context, and the original instruction gets buried under it. Subagents are presented as the fix — each runs in its own context window with its own system prompt, tool allowance and permissions, and hands back only a summary.

Claude Code ships three built-in types with different jobs. Explore is read-only and specialized for searching and understanding a codebase, called with a depth setting of quick, medium or very thorough. Plan does preparatory research during Plan mode, also read-only, so the main conversation stays read-only as well. general-purpose can both research and modify, and has access to every tool available to subagents. Explore and Plan skip loading CLAUDE.md and the git state snapshot to start faster and cheaper; when an investigation needs CLAUDE.md's assumptions, the guide suggests loading it in a custom agent instead.

Custom agents are Markdown files with YAML front matter, placed in .claude/agents/ for a single project (shareable through version control) or ~/.claude/agents/ for all projects on a machine, with the project definition winning on name collisions. The name and description fields are required, and description is what Claude reads to decide whether to delegate. The example investigator.md limits tools to Read, Grep and Glob and uses model: haiku, so a read-only investigation cannot turn into an edit and routine work runs fast and cheap. Note that subagent runs consume the same usage allowance as the main conversation, so the guide advises reserving them for investigations worth delegating.

FAQ
How much of the main context does delegating research actually save?
There is no fixed number. The saving comes from the contents of researched files not flowing into the main chat, and it is easiest to notice in investigations that span many files.
Why does my custom agent never get called?
Claude decides whether to delegate based on the description field. Write it short and specific about what the agent does and what output it returns, or call the agent explicitly with an @ mention or the Agent tool.
When should I use Explore versus a custom investigator agent?
Built-in Explore is enough for one-off searching and understanding. Create a custom agent when you repeatedly send the same kind of investigation or want the report format, allowed tools and model fixed.
Send on LINE

AI news that matters for your work, delivered every morning.

Pick your industry and the AI tools you use, and get news related to your work every day.

By signing up you agree to the Terms of Service and Privacy Policy.

Free · 30 seconds with Google · unsubscribe anytimeWhat is AIToday? →

Ask AI

Ask AI anything about this article. The AI reads this article, earlier AIToday articles, and Wikipedia, and cites its sources. Q&As are published on this page for other readers too.

Questions and answers are published on this page.

Related Articles

Next articleAnthropic IPO filing flags AI that refuses stop orders, games tests