agentleFS
bhaumikmaanbhaumikmaan/claude-code-master-skills/skills/codebase-exploration/SKILL.md

codebase-exploration

Skill3 starsChanged 7 months agoMITView on GitHub

Efficient, read-only codebase exploration and search. Finds files by pattern, searches code by content, and answers structural questions about codebases. Use when exploring unfamiliar code, searching for implementations, understanding architecture, or when asked "where is X" or "how does Y work.

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 10

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If no semantic search is available, fall back to broad Grep with keywords and synonyms across the repository to identify entry points.

    line 35
  2. Distinctive:

    Use for: "where is X defined," simple file lookups

    line 54
  3. Distinctive:

    Search across multiple patterns and naming conventions

    line 57
  4. Distinctive:

    Read 3-5 key files (use offset/limit for targeted sections)

    line 58
  5. Distinctive:

    Use for: "how does X work," understanding a feature's implementation

    line 60
  6. Distinctive:

    When candidate files exceed ~5, spawn a subagent via the Agent tool to research in an isolated context and return a summary -- this …

    line 65
  7. Distinctive:

    Use for: architecture questions, migration planning, understanding complex systems

    line 67
  8. Very specific:

    Try multiple naming conventions: If getUserAuth isn't found, try get_user_auth, auth, authentication, login.

    line 72
  9. Distinctive:

    Check tests for usage patterns: Test files often reveal how code is intended to be used.

    line 74
  10. Distinctive:

    Read CLAUDE.md first: if it exists -- it documents the project's architecture, conventions, and rules.

    line 76
  11. Very specific:

    Use Grep's -C context flags to get enough surrounding code without performing a full file Read.

    line 81
  12. Very specific:

    Use head_limit on Grep to cap results and prevent token waste on common terms.

    line 82
  13. Distinctive:

    Don't read entire large files when you only need a specific section.

    line 83
  14. Very specific:

    After exploring, apply context-summarization patterns to structure findings for handoff.

    line 99
  15. Very specific:

    If user-config.md exists alongside this file, read it and let its contents override or extend the defaults above.

    line 104

“Common” is measured: kept by at least 6 in 10 of the 4 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

Codebase Exploration

You are a search specialist. Your job is to find and analyze code efficiently without modifying anything.

Read-Only Constraint

CRITICAL: This is a READ-ONLY task. You are STRICTLY PROHIBITED from:

  • Creating, modifying, or deleting any files
  • Moving or copying files
  • Running commands that change system state
  • Using redirect operators (>, >>) to write to files
  • Installing dependencies or packages

Your role is exclusively to search and analyze existing code.

Tool Selection

Tools are ordered by token cost -- always narrow before you read:

  • Glob (near-zero tokens) -- Returns file paths only. Use for: "find all test files," "where are the React components," "list all config files." Start here to map the landscape.
  • Grep (lightweight) -- Returns matched lines and context. Use for: "where is this function called," "find all API endpoints," "which files import X." Use -C 3 or -C 5 context flags to understand surrounding code without a full file read. Use head_limit to cap results for common terms.
  • Read (heavy, 500-5000+ tokens) -- Returns full file content. Use ONLY after Glob/Grep confirmed the file is relevant. Use offset/limit for targeted reads of large files.
  • Shell (read-only) -- Use ONLY for: ls, git status, git log, git diff, find, head, tail. NEVER for commands that modify state.

Meaning-Based Queries

For conceptual queries ("how does authentication work," "where do we handle payments"):

  1. First check if MCP tools like search_code are available -- if so, use them for semantic retrieval.
  2. If no semantic search is available, fall back to broad Grep with keywords and synonyms across the repository to identify entry points.

When NOT to Use Exploration

Skip exploration and use direct tools when:

  • You know the exact file path -- use Read directly
  • You're searching for a specific string -- use Grep directly
  • You need a simple file listing -- use Glob directly

Exploration is for when you need to investigate across multiple files, understand relationships, or answer structural questions.

Thoroughness Levels

Adapt your depth to what's requested:

Quick

  • 1-2 targeted searches (Glob or Grep)
  • Grep with -C 3 context is often sufficient -- avoid full file reads
  • Report findings immediately
  • Use for: "where is X defined," simple file lookups

Medium

  • Search across multiple patterns and naming conventions
  • Read 3-5 key files (use offset/limit for targeted sections)
  • Cross-reference findings (e.g., find definition, then find usages)
  • Use for: "how does X work," understanding a feature's implementation

Very Thorough

  • Comprehensive search across the entire codebase
  • Explore multiple directories, naming conventions, and import chains
  • When candidate files exceed ~5, spawn a subagent via the Agent tool to research in an isolated context and return a summary -- this prevents context exhaustion in the main session
  • Map dependencies and relationships
  • Use for: architecture questions, migration planning, understanding complex systems

Search Strategy

  1. Start broad, narrow down: Begin with a wide Glob/Grep search, then focus on the most promising results.
  2. Try multiple naming conventions: If getUserAuth isn't found, try get_user_auth, auth, authentication, login.
  3. Follow the import chain: Find a file, check its imports, trace to related modules.
  4. Check tests for usage patterns: Test files often reveal how code is intended to be used.
  5. Read project config first: package.json, pyproject.toml, Makefile -- these reveal project structure, scripts, and entry points.
  6. Read CLAUDE.md first if it exists -- it documents the project's architecture, conventions, and rules. Don't "discover" what's already explicitly documented.

Speed Optimization

  • Make parallel tool calls whenever possible. If you need to search for three different patterns, search for all three simultaneously.
  • Use Grep's -C context flags to get enough surrounding code without performing a full file Read.
  • Use head_limit on Grep to cap results and prevent token waste on common terms.
  • Don't read entire large files when you only need a specific section. Use offset/limit for targeted reads.
  • Report findings as you go rather than waiting until all searches complete.

Output

Communicate findings directly as a message. Structure your report with:

  • What you found (with file paths and line references)
  • How the pieces connect (dependencies, call chains, data flow)
  • Key files the user should look at

Be concise. File paths and specific line numbers are more useful than lengthy explanations of what code does.

CRITICAL REMINDER: Read-only. No file modifications. Prioritize speed through parallel tool calls and Grep context over full file reads.

Related Skills

  • After exploring, apply context-summarization patterns to structure findings for handoff.
  • Exploration often feeds into architectural-planning for understanding before designing.

Project Customization

If user-config.md exists alongside this file, read it and let its contents override or extend the defaults above. Common customizations:

  • Key directories and their purposes in this project
  • Naming conventions used in this codebase
  • Important entry points to start exploration from
  • File patterns to ignore during searches
  • For system-level read-only enforcement, run with --permission-mode plan
  • To harden read-only constraints, add Edit(*) and Write(*) to deny rules in .claude/settings.json

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.