agentleFS
ngc-shjngc-shj/claude-code-config/skills/explore/SKILL.md

explore

Skill1 starsChanged 2 months agoMITView on GitHub

Deep codebase exploration and Q&A. Searches and analyzes code structure, traces call chains, and explains how things work. Use this skill when: asked to explain how something works; asked to find all usages or callers; asked to understand codebase architecture; asked to trace data flow or control flow.

67 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use agent-context-isolation, agentica-infrastructure and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 5 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 58 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If Ollama is unavailable, fall back to matching the question against these patterns directly:

    line 21
  2. Distinctive:

    Use local LLM to extract search keywords from the user's question:

    line 33
  3. Distinctive:

    If Ollama is unavailable, proceed to Step 3 with shell-only discovery results.

    line 57
  4. Distinctive:

    If sub-agents are unavailable, perform the analysis directly.

    line 89
  5. Distinctive:

    Follow-up suggestions for deeper exploration

    line 108

“Common” is measured: kept by at least 6 in 10 of the 58 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Explore Skill

Deep codebase exploration and Q&A using local LLM for file discovery and Sonnet for detailed analysis.


Step 1: Classify the Query (Local LLM, Zero Claude Tokens)

Offload exploration-type classification to the local LLM:

echo "[user's question]" | bash ~/.claude/hooks/llm-commands.sh classify-query

Expected output: one of explanation, usage-search, architecture, location, data-flow. If Ollama is unavailable, fall back to matching the question against these patterns directly:

Query patternTypeStrategy
"How does X work?"explanationTrace implementation, explain flow
"Find all callers/usages of Y"usage-searchGrep + call chain tracing
"What is the architecture of Z?"architectureDirectory structure + key file analysis
"Where is X defined/configured?"locationTargeted file search
"How does data flow from A to B?"data-flowTrace through layers

Step 2: Local LLM File Discovery (Zero Claude Tokens)

Use local LLM to extract search keywords from the user's question:

echo "[user's question]" | bash ~/.claude/hooks/llm-commands.sh generate-slug

Then use shell tools for initial file discovery (zero Claude tokens):

# Search for relevant files using keywords (use appropriate file types for the project)
grep -rl "[keyword]" .
# Or use glob patterns for structural exploration
find src/ -type f | head -50
# For architecture queries, get an overview of shared utilities
bash ~/.claude/hooks/scan-shared-utils.sh

For larger codebases, use local LLM to build a relevance map:

# Pipe discovered file contents for relationship analysis
bash ~/.claude/hooks/pre-review.sh code

If Ollama is unavailable, proceed to Step 3 with shell-only discovery results.

Step 3: Sonnet Deep Analysis (Sub-agent)

Launch a Sonnet sub-agent for detailed code tracing:

You are a senior engineer performing codebase exploration.

Query type: [explanation/usage-search/architecture/location/data-flow]
User's question: [original question]

Initial file discovery:
[File list and/or local LLM analysis]

Task:
1. Read the most relevant files from the discovery results
2. Based on query type:
   - explanation: Trace the implementation step by step, explain each layer
   - usage-search: Find all callers, build a dependency graph. **Derive the set from the defining primitive, not from the discovery keywords.** For "find every X" / "all callers of Y" / "everywhere that does Z", do not answer from the keyword-matched or "obvious" subset of files surfaced in Step 2 — identify the primitive that *defines* membership (the function/decorator/route-export/table/call whose presence makes a site a member) and `grep -rlE '<primitive>' <code roots>` across the whole tree to get the complete set. Then include *indirect* members the symbol grep alone misses: operations reached via a parent cascade, raw queries that bypass the ORM/guard layer, and calls routed through an aliased or wrapped caller. A keyword/path-scoped enumeration silently drops members under non-obvious paths — state the primitive you grepped so the completeness of the set is auditable. **Any count in the answer ships the command that reproduces it (R29).** "N call sites", "only M places do X", a coverage or occurrence figure — the number arrives in a frame ("derived from the code") that the reader, and every later round that restates it, treats as verified. Give the exact command beside the figure or omit the figure; a count summed over a subset of the tree reconciles with nothing and is the recurring shape.
   - architecture: Map the directory structure, identify key patterns
   - location: Pinpoint the exact file, line, and context
   - data-flow: Trace data through each transformation layer
3. Follow references to related files (imports, function calls, type definitions)
4. Build a clear, structured answer with file:line references

Output format:
- Start with a one-paragraph summary
- Then provide detailed explanation with code references
- End with a relationship diagram (ASCII) if applicable

If sub-agents are unavailable, perform the analysis directly.

Step 4: Synthesize and Present

Review Sonnet's analysis for completeness and accuracy:

  • Verify referenced files exist (automated): Pipe the sub-agent output through verify-references.sh to catch stale or missing file:line references in bulk before manual review:

    echo "[sub-agent output]" | bash ~/.claude/hooks/verify-references.sh

    Any MISSING or OUT-OF-RANGE line from the summary is a stale reference — remove or correct it.

  • Verify function/type existence: For each named function, type, or constant still in the output after the automated check, grep to confirm it exists at the stated location. Sub-agents may hallucinate names or locations even when the file:line resolves.
  • Fill in any gaps the sub-agent may have missed
  • Resolve any ambiguities

Present the answer to the user with:

  • Clear structure (summary → details → diagram)
  • Clickable file:line references (verified to exist)
  • Follow-up suggestions for deeper exploration

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.