with one click
explore-codebase
// RLM-style large-codebase comprehension — build a mental map of any codebase by dispatching sub-agents to explore regions without bloating main context
// RLM-style large-codebase comprehension — build a mental map of any codebase by dispatching sub-agents to explore regions without bloating main context
Multi-source research synthesis — aggregate and compare 3+ sources or any source >5KB using sub-agent dispatch and SharedState
Find your way home — register with the yoyo family, introduce yourself, and participate in family discussions
Systematically find blind spots in code, architecture, APIs, and deployment — structured critique that catches what familiarity hides
Interact with the community through GitHub Discussions — reply, share, learn
Read X (Twitter) via xurl — search posts, fetch threads, read profiles, and read long-form articles
Evaluate readiness and publish to crates.io
| name | explore-codebase |
| description | RLM-style large-codebase comprehension — build a mental map of any codebase by dispatching sub-agents to explore regions without bloating main context |
| tools | ["bash","read_file","list_files","search","sub_agent","shared_state"] |
| core | false |
| origin | yoyo |
| status | active |
| score | 0.59 |
| uses | 1 |
| wins | 1 |
| last_used | 2026-04-30T12:03:36Z |
| last_evolved | null |
| parent_pattern_key | null |
| keywords | ["explore codebase","understand module","map dependencies","large refactor scope","archaeology","comprehension"] |
You are building a mental map of an unfamiliar or large codebase region. The goal is structural comprehension — understanding what the code does, how it's organized, and what the key entry points and invariants are — without loading everything into your main context window.
This skill exists because codebases are too large to read in one prompt. The pattern (Recursive Language Model — see the RLM substrate section in CLAUDE.md) is: keep your root context small, dispatch sub-agents to read individual files or modules, and have each sub-agent return a structured summary. Synthesize the summaries into a coherent map.
This skill covers any codebase the agent encounters — forks, dependencies, unfamiliar regions, user projects. For analyzing yoyo's own source to find bugs and gaps, use self-assess instead.
Trigger this skill when ANY of these hold:
/add brought in a large project and you need structural context before actingDefine the exploration scope — be specific:
src/format/src/agent_builder.rs src/main.rs src/tools.rs~/.cargo/registry/src/*/yoagent-*/src/git diff main..feature-branch --name-onlyIf the scope is vague ("understand this project"), start with orientation (Step 2). If the scope is precise (a named set of files), skip to Step 3.
Before dispatching sub-agents, gather cheap structural signals directly:
# Project structure
find <root> -type f -name '*.rs' | head -50
# or use /map if available in the REPL
# README / docs
cat <root>/README.md 2>/dev/null | head -100
# File sizes (to plan dispatch)
wc -l <root>/src/*.rs | sort -rn | head -20
# Recent activity
git log --oneline -20 -- <root>/src/
From this, build a file inventory with rough sizes. Files >300 lines are candidates for sub-agent exploration. Files ≤300 lines can be read directly if needed later.
For each file in the region:
read_file or bash. No sub-agent needed.If the total region is small enough to read directly (≤5 files, all ≤5KB), skip sub-agents entirely — just read and synthesize in your main context.
Store each file's content in shared state, then dispatch a sub-agent to summarize it. One file per sub-agent — files are the natural unit of structure in code.
shared_state set key="explore.<region>.<filename>" value="<file contents>"
Namespace convention: explore.<region>.<filename> (e.g., explore.format.markdown, explore.yoagent.agent).
If a single file exceeds 30KB (~120,000 bytes), chunk it before storing:
explore.<region>.<filename>.chunk-1, .chunk-2, etc.sub_agent: You are exploring a source file to build a structural summary.
The file is stored in shared state under key "explore.<region>.<filename>".
Read it with: shared_state get key="explore.<region>.<filename>"
Describe this file's structure in a JSON response. Reply with ONLY a JSON object (no markdown fences, no prose):
{
"file": "<filename>",
"purpose": "1 sentence: what this file does",
"public_api": ["list of exported functions/structs/traits with 1-line descriptions"],
"key_invariants": ["non-obvious behaviors, constraints, or assumptions"],
"dependencies": ["other modules/crates this file depends on"],
"dependents": ["who calls into this file, if visible from imports/use statements"],
"complexity": "low|medium|high",
"deeper_question": "a follow-up question if something is unclear, or null"
}
Skills do not chain. Sub-agents don't load this skill or any other; include the full question and shared-state key reference directly in the sub-agent's prompt.
Parse each sub-agent's response as JSON:
explore.<region>.<filename>.summary for the synthesis step.{"file": "<filename>", "purpose": "<first 200 chars of response>", "public_api": [], "key_invariants": [], "dependencies": [], "dependents": [], "complexity": "unknown", "deeper_question": null}.If a sub-agent returns a non-null deeper_question and complexity is "high":
Hard cap: recursion depth = 3. That's: initial dispatch → 1st recursion → 2nd recursion. After depth 3, accept whatever you have. If you find yourself wanting depth 4, your initial scope was probably too broad — narrow the region and retry.
After all per-file summaries are collected, dispatch a synthesis sub-agent (or do this in your main context if the total summary data is small enough, ≤5KB):
sub_agent: You are synthesizing per-file summaries into a structural map of a codebase region.
The following shared-state keys contain per-file summaries:
- explore.<region>.<file1>.summary
- explore.<region>.<file2>.summary
...
Read each summary, then produce a structural map as a JSON object:
{
"region": "<region name>",
"overview": "2-3 sentences: what this region does as a whole",
"module_graph": ["<file-A> -> <file-B>: <relationship>", ...],
"entry_points": ["the key functions/structs a caller would use"],
"invariants": ["cross-file constraints or assumptions"],
"risk_areas": ["files or interactions that look fragile or complex"],
"open_questions": ["things the summaries couldn't resolve"]
}
The mental map is your working context for the rest of the session. Reference it when:
Store the final map in shared state under explore.<region>.map so sub-agents in later steps can reference it without re-exploring.
shared_state get instead of re-dispatching sub-agents.An exploration is "good enough" when ALL of:
If the map fails any of these, narrow the region and re-explore the gap, or accept the partial result and document open questions.
self-assess. This skill builds the map; self-assess uses the map to find problems.