Agent skill

Codebase Explorer

by yologdev in yologdev/yoyo-evolve

Builds a structural map of a large or unfamiliar codebase by dispatching sub-agents to summarize regions, keeping the main context small.

MITAuto-check passedAgent Workflows

Install Codebase Explorer

skills CLI
$ npx skills add yologdev/yoyo-evolve --skill explore-codebase -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install yologdev/yoyo-evolve explore-codebase --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/yologdev/yoyo-evolve.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/explore-codebase .claude/skills/explore-codebase && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
explore-codebase
GitHub stars
1.9k
Token cost
~2.8k tokens
SKILL.md length
1,278 words
Files
1
Skills in repo
15
Repo updated
First seen
Licence
MIT

At a glance

Builds a structural map of a large or unfamiliar codebase by dispatching sub-agents to summarize regions, keeping the main context small.

  • Works in 7 steps: Identify the region → Orient — build a rough map → Decide: direct read or sub-agent? → …
  • Starting work in a large unfamiliar repository before planning changes
  • SKILL.md covers When to use, When NOT to use, Procedure and Pitfalls, plus 2 more sections
  • Calls git

What it does

Large codebases do not fit in one prompt, so this skill applies a recursive pattern: keep the root context small, send sub-agents to read individual files or modules, have each return a structured summary, and combine the summaries into a map of what the code does, how it is organized, and where the entry points and invariants are. It works on any codebase the agent meets, including forks, dependencies and user projects.

It lists when to trigger: a task touching more than 5 files you have not worked on lately, a bug spanning several modules, a new dependency whose API you need to understand, a fork whose changes you need to compare with upstream, or a direct request to map a codebase. It also lists when to skip: a single file under about 300 lines, precise edits across files that need shared context, sequential workflows, regions already known, and any sub-agent at depth 3, which should return what it has.

The procedure begins by defining the exploration scope precisely, such as a directory or a file glob. The excerpt ends there, so later steps are not covered. For analyzing the author's own agent source to find bugs, the skill points to a separate self-assess skill.

When your agent uses it

  • Starting work in a large unfamiliar repository before planning changes
  • Investigating a bug that crosses several modules you have not read recently
  • Learning a new dependency's public API and key invariants before integrating it

Example prompts

  • “Map the src/format directory and tell me how the pieces fit together.”
  • “Explore this forked repo and summarize what it changes compared with upstream.”
  • “Before we touch the billing code, explore the whole module with sub-agents and report back.”

Requirements

  • An agent that can dispatch sub-agents

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Identify the region
  2. Orient — build a rough map
  3. Decide: direct read or sub-agent?
  4. Dispatch per-file sub-agents
  5. Recurse on deeper questions
  6. Synthesize into a mental map
  7. Use the map

What it can do on your machine

Read from SKILL.md and the folder at commit df403df. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Codebase Explorer loads about 2.8k tokens when it runs. Until then it costs about 42 tokens; SKILL.md has 1,278 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~42
When it runs · the whole SKILL.md, loaded when a task matches
~2.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from yologdev/yoyo-evolve at commit df403df, republished under its MIT licence (© yologdev). 1,278 words, ~2,753 tokens.

Download SKILL.mdSave it as .claude/skills/explore-codebase/SKILL.md (or your agent's skills folder).
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.66
uses
2
wins
2
last_used
2026-05-22T02:49:39Z
last_evolved
2026-08-24
keywords
skills/explore-codebase, explore., key_invariants

Explore Codebase

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.

When to use

Trigger this skill when ANY of these hold:

  • A planned task touches >5 files you haven't recently worked on
  • A community issue references a feature or module you don't have a mental map for
  • You're investigating a bug whose surface spans multiple modules you haven't read recently
  • A new dependency is being introduced and you want to know its public API + key invariants before integrating
  • A user explicitly asks you to explore, understand, or map a codebase
  • /add brought in a large project and you need structural context before acting
  • You're working in a fork and need to understand what the fork changed relative to upstream

When NOT to use

  • Small known regions. A single file ≤300 lines, or a function you wrote yesterday — just read it directly. Sub-agent overhead exceeds the savings.
  • Precise edits across files. Refactoring needs mutual context (seeing all pieces at once), not summaries. Summaries lose the fidelity you need for surgical edits.
  • Sequential workflows with strong mutual context. When each step depends on the full output of the previous step, fan-out doesn't help — you need serial reading.
  • The region is already known. If you or the user can name the exact module and its API from memory, direct read is faster. Don't explore what you already understand.
  • You're inside a sub-agent at depth 3. Stop. Return what you have. Do not dispatch further.

Procedure

1. Identify the region

Define the exploration scope — be specific:

  • A directory: src/format/
  • A file glob: src/agent_builder.rs src/main.rs src/tools.rs
  • A dependency: ~/.cargo/registry/src/*/yoagent-*/src/
  • A commit range: git diff main..feature-branch --name-only

If 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.

2. Orient — build a rough map

Before dispatching sub-agents, gather cheap structural signals directly:

bash
# 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.

3. Decide: direct read or sub-agent?

For each file in the region:

  • ≤5KB (roughly ≤150 lines): Read directly with read_file or bash. No sub-agent needed.
  • >5KB: Dispatch a sub-agent (Step 4). Don't load large files into your main context.

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.

4. Dispatch per-file sub-agents

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.

4a. Store the artifact
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:

  • Split into chunks of ~80KB with 8KB overlap between consecutive chunks
  • Store as explore.<region>.<filename>.chunk-1, .chunk-2, etc.
  • Dispatch one sub-agent per chunk (same as analyze-trajectory's Section 3.5)
4b. Dispatch the sub-agent
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.

4c. Handle sub-agent responses

Parse each sub-agent's response as JSON:

  1. Valid JSON with all fields: Store the summary in shared state under explore.<region>.<filename>.summary for the synthesis step.
  2. Malformed JSON but readable text: Extract what you can. Construct a partial summary: {"file": "<filename>", "purpose": "<first 200 chars of response>", "public_api": [], "key_invariants": [], "dependencies": [], "dependents": [], "complexity": "unknown", "deeper_question": null}.
  3. Empty or errored: Fall back to direct read of the file's first and last 50 lines. Produce a low-confidence summary manually.
5. Recurse on deeper questions

If a sub-agent returns a non-null deeper_question and complexity is "high":

  1. Dispatch another sub-agent with the narrower question, referencing the same shared-state key.
  2. Merge the answer into the existing summary.

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.

Show full SKILL.md (496 more words)Show less
6. Synthesize into a mental map

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"]
}
7. Use the map

The mental map is your working context for the rest of the session. Reference it when:

  • Planning which files to modify for a task
  • Estimating the blast radius of a change
  • Deciding whether a refactor is safe
  • Explaining code structure to a user or in a journal entry

Store the final map in shared state under explore.<region>.map so sub-agents in later steps can reference it without re-exploring.

Pitfalls

  • Don't explore what you already know. If you wrote the code recently or have it in active memory, skip this skill. It's for building new understanding, not confirming existing knowledge.
  • Don't ask sub-agents to make decisions. They summarize structure; you decide what to do with it. Sub-agents that plan or recommend tend to drift.
  • Don't dump multiple files to one sub-agent. One file per dispatch keeps the JSON output reliable and the summary focused. The synthesis step is where cross-file reasoning happens.
  • Don't forget the recursion cap. 3 is the hard limit. If your region needs depth 4, the region is too broad — split it.
  • Don't explore before acting on small tasks. If the task is "fix this one function," reading that function directly is faster than exploring the whole module. Match the tool to the task size.
  • Don't re-explore within the same session. If you've already explored a region, the summaries are in shared state. Read them with shared_state get instead of re-dispatching sub-agents.
  • Per-file, not per-byte. Unlike analyze-trajectory (which chunks CI logs by byte offset), this skill fans out by file. Files are the natural structural unit in codebases. Only chunk within a file if it exceeds 30KB.

Verification

An exploration is "good enough" when ALL of:

  • The map names concrete files and functions (not "some module that handles X")
  • Each file in the region has a summary (even if low-confidence for some)
  • The module graph shows how files relate (who calls whom, who depends on whom)
  • Entry points are identified — a caller knows where to start
  • The total exploration used ≤ N+2 sub-agent dispatches where N is the number of files explored (N per-file + 1 synthesis + 1 possible recursion)
  • The work stayed within the depth-3 recursion cap

If the map fails any of these, narrow the region and re-explore the gap, or accept the partial result and document open questions.

What this skill deliberately does NOT do

  • Does not modify code. Exploration produces understanding, not changes. The actual edits are a separate task.
  • Does not find bugs. That's self-assess. This skill builds the map; self-assess uses the map to find problems.
  • Does not auto-create documentation. If the map is worth preserving as docs, that's a separate decision outside this skill's scope.
  • Does not write to the audit-log branch. The exploration results live in shared state for the current session only.

© yologdev, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/explore-codebase of yologdev/yoyo-evolve.

Open the folder on GitHubat commit df403df

Compare with similar skills

Codebase Explorer next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Codebase Explorer compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Codebase Explorer this skillyologdev/yoyo-evolve1.9k—~2.8kAutomated safety check: PassMIT
Caveman Repository ExplorerJuliusBrussee/caveman110k1 repos~492Automated safety check: PassApache-2.0
ccc Semantic Code Searchcocoindex-io/cocoindex-code2.7k—~938Automated safety check: PassApache-2.0
Repomix Codebase Packeryamadashy/repomix29k—~1.3kAutomated safety check: NotesMIT
Code Context Slicingtrailofbits/skills7.4k—~2.1kAutomated safety check: PassCC-BY-SA-4.0
MoAI Foundation Coremodu-ai/moai-adk1.2k—~5kAutomated safety check: PassApache-2.0

Similar skills

  • Caveman Repository Explorer

    JuliusBrussee/caveman

    A read-only explorer for cold-start orientation or failed searches that replies with nothing but file path and line range citations, keeping its reads out of main context.

    110k GitHub starsUsed in 1 repo~492 tokens
    Agent WorkflowsAuto-check passed
  • ccc Semantic Code Search

    cocoindex-io/cocoindex-code

    Semantic code search and index management with the ccc CLI: the agent initializes, indexes and queries the project by concept, filtering by language or path.

    2.7k GitHub stars~938 tokensUpdated yesterday
    Agent WorkflowsAuto-check passed
  • Repomix Codebase Packer

    yamadashy/repomix

    Packs a local directory or remote GitHub repository into one AI-friendly file with Repomix, then searches it to explore structure, find patterns and count tokens.

    29k GitHub stars~1.3k tokensUpdated 4 days ago
    Agent WorkflowsAuto-check: notes
  • Code Context Slicing

    trailofbits/skills

    Official

    Picks a small, graph-based slice of source with Trailmark and hands a focused code task to a smaller or local model without exposing the whole repository.

    7.4k GitHub stars~2.1k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • MoAI Foundation Core

    modu-ai/moai-adk

    Reference for MoAI-ADK's core development principles: TRUST 5 quality gates, SPEC-first domain-driven workflow, agent delegation and token budgeting.

    1.2k GitHub stars~5k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Agentsop Context Scope Discipline

    agentsope/SkillAlchemy

    Coder-agent working-file budget discipline: keep the editable working set (files you /add into writable context) under ~25k tokens, separate "read" from "edit", delegate breadth to a read-only…

    459 GitHub stars~3k tokensUpdated 1 mo ago
    Agent WorkflowsAuto-check passed

More from yologdev/yoyo-evolve

All 15 skills in this repo
  • Analyze Trajectory

    yologdev/yoyo-evolve

    Diagnoses a recurring failure such as a stuck task, repeated CI error or frequent reverts by sending sub-agents through the logs and returning one root-cause diagnosis.

    1.9k GitHub stars~3.6k tokensUpdated today
    Auto-check passed
  • Blindspot Code Critique

    yologdev/yoyo-evolve

    Runs a structured critique of code, architecture or APIs to surface what familiarity hides, such as panics, security holes and design debt.

    1.9k GitHub stars~2.2k tokensUpdated today
    Auto-check passed
  • Sets a warm, plain-spoken voice for an agent's journal entries and GitHub issue replies, with rules on openings, jargon, honesty and endings.

    1.9k GitHub stars~2.6k tokensUpdated today
    Auto-check passed
  • Crates.io Release Check

    yologdev/yoyo-evolve

    Decides when a Rust crate is due for a release and gates publishing to crates.io, using a short git-based cadence check run at the start of a session.

    1.9k GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • Agent Self-Evolution Rules

    yologdev/yoyo-evolve

    Sets ground rules for a coding agent that edits its own Rust source: read the code and journal first, write tests first, commit small changes and check compilation after each file.

    1.9k GitHub stars~1.9k tokensUpdated today
    Auto-check: warnings
  • Self Assess

    yologdev/yoyo-evolve

    Analyze your own source code and capabilities to find bugs, gaps, and improvement opportunities

    1.9k GitHub stars~547 tokensUpdated today
    Auto-check passed

Questions about Codebase Explorer

What does Codebase Explorer do?

Builds a structural map of a large or unfamiliar codebase by dispatching sub-agents to summarize regions, keeping the main context small. Large codebases do not fit in one prompt, so this skill applies a recursive pattern: keep the root context small, send sub-agents to read individual files or modules, have each return a structured summary, and combine the summaries into a map of what the code does, how it is organized, and where the entry points and invariants are. It works on any codebase the agent meets, including forks, dependencies and user projects.

When should I use Codebase Explorer?

Codebase Explorer fits situations like: starting work in a large unfamiliar repository before planning changes; investigating a bug that crosses several modules you have not read recently; learning a new dependency's public API and key invariants before integrating it.

How do I install Codebase Explorer in Claude Code?

Run `npx skills add yologdev/yoyo-evolve --skill explore-codebase -a claude-code`. Or copy the skill folder (skills/explore-codebase in yologdev/yoyo-evolve) into .claude/skills/explore-codebase in your project. Claude Code loads it when a task matches its description.

How do I install Codebase Explorer in Codex?

Run `npx skills add yologdev/yoyo-evolve --skill explore-codebase -a codex`. Or copy the skill folder (skills/explore-codebase in yologdev/yoyo-evolve) into .agents/skills/explore-codebase in your project. Codex loads it when a task matches its description.

Can I use Codebase Explorer in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add yologdev/yoyo-evolve --skill explore-codebase -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/explore-codebase, .gemini/skills/explore-codebase, .github/skills/explore-codebase and .opencode/skills/explore-codebase in your project.

What does Codebase Explorer need to run?

Going by SKILL.md and its folder, Codebase Explorer needs the command-line tools its instructions call (git). Our summary lists: An agent that can dispatch sub-agents.

Does Codebase Explorer access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Codebase Explorer safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Codebase Explorer use?

Codebase Explorer is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Codebase Explorer use?

About 2.8k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Codebase Explorer?

Skills that share tags, products or a category with Codebase Explorer: Caveman Repository Explorer (JuliusBrussee/caveman, 110k stars), ccc Semantic Code Search (cocoindex-io/cocoindex-code, 2.7k stars), Repomix Codebase Packer (yamadashy/repomix, 29k stars) and Code Context Slicing (trailofbits/skills, 7.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Codebase Explorer?

yologdev (a GitHub user) maintains it in yologdev/yoyo-evolve, which has 1,888 GitHub stars. The repository holds 15 skills in this directory. The repository was last updated on October 8, 2026.

Source: yologdev/yoyo-evolve on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.