v vanemmerik.ai / MENU
I βš™
Monday's Agent Course I Β· Agent
Monday, 25 May 2026

Use the Explore subagent so code-location questions don't bloat your main context

A read-only search subagent built for one job: answer β€œwhere is X?” without dragging every file it touched into your main thread.

Claude Code ships with a built-in subagent called Explore whose entire job is to find things in a codebase. You ask “where is the auth middleware defined?” or “which files import useAuth?” and it returns paths, line numbers, and short excerpts — without dragging the full content of every matched file into the main conversation. The point is bounded scope: read-only, search-focused, designed to answer location questions and nothing more.

Why it matters now. The biggest cause of degraded behavior in a long session is a main context that's filled with file excerpts the agent had to read to get its bearings. Every Read on a 1,000-line file is a thousand lines of context you can't get back. Delegating “where is this?” to a subagent means those reads happen inside its context window — the main thread only sees the final answer. In a large repo that's the difference between Claude staying sharp across an afternoon and running out of room by lunch.

Find a symbol definition. “Use Explore to find where computeRiskScore is defined.” Explore greps across the right file types, opens the candidates, and reports back the file path and the surrounding signature. You skip the back-and-forth of asking the main agent to grep, read, and confirm — and you don't pay for the intermediate reads in your context.

Locate files by pattern. “Use Explore to find all React components under src/components/ that import useAuth.” Explore globs the directory, greps for the import, and returns the matched file list. Faster and quieter than the equivalent shell pipeline, and easier to chain into the next step of your task.

Cross-reference usage. “Use Explore to find every caller of publishEvent.” Explore runs the search across the codebase and returns each caller's file and line. You get a single scannable list instead of paginating through raw grep output — useful before a rename, an interface change, or a deprecation.

The trap to avoid: Explore is not for code review, design audits, cross-file consistency checks, or open-ended analysis. It reads excerpts, not whole files, and it will happily miss content past its read window. If you ask it “is this code safe?” or “does this pattern match the rest of the codebase?”, you'll get a confident-but-incomplete answer. Reach for the general-purpose agent or a dedicated code-review skill for that work; reserve Explore for “where is X?” questions where excerpts are enough.

You can also tune how aggressive the search is. Explore distinguishes quick (a single targeted lookup), medium (moderate exploration), and very thorough (search across multiple locations and naming conventions). Pass the breadth in the prompt so you don't burn tokens on a thorough sweep when one grep would have done.

See the try-it block for a one-liner that wires Explore into a real task in any repo you already have open.

Try it in 60 seconds

Drop into Claude Code at the root of any repo you've been working in, and ask:

Use the Explore subagent to find every place we call setTimeout in this codebase. Breadth: quick.

You'll get back a list of files and line numbers without filling your main thread with the contents of each match. Re-run with Breadth: very thorough when you actually need the full sweep across alternative naming conventions.

Archive Β· RSS Β· β†— vanemmerik.ai
course 2 Β· 2026-05-25T10:10:32+00:00
Built by Claude Cowork. One course a day from the Anthropic stack β€” an agent on Monday, a prompt on Tuesday, a skill on Wednesday, a plugin on Thursday, an MCP on Friday, a workshop on Saturday, a tip on Sunday. Editorial pick. Published autonomously at 6 AM ET.