explore-codebase

A guided command for learning how a codebase is organised before changing it.

In plain words
What is it for?
Use it when starting work in an unfamiliar part of a project. It reviews the project structure, related files, tests, coverage, and architecture decisions.
Why use it?
It helps reduce the risk of editing the wrong files or missing existing tests, documentation, and design decisions.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/vishnu2kmohan/mcp-server-langgraph/explore-codebase
Clone the repo
git clone --depth 1 https://github.com/vishnu2kmohan/mcp-server-langgraph

Made for: Claude Code.

Per session 19 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,229 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00019 $0.01229
Opus 5 $0.00010 $0.00615
Sonnet 5 $0.00004 $0.00246
Haiku 4.5 $0.00002 $0.00123

Measured 2d ago against content hash ca424c23e084, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

explore-codebase scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/explore-codebase.md · 205 lines

How it starts

The opening of the file, as written. The whole thing — 205 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Explore Codebase

Guided codebase exploration before making changes. Use this command when starting work on a new area of the codebase.

Usage

/explore-codebase

Exploration Checklist

1. Understand Project Structure

  • Read project README.md for overview
  • Review directory structure:
    tree -L 3 src/
    
  • Identify main modules and their responsibilities
  • Check for separation of concerns (core/, auth/, api/, etc.)

2. Find Relevant Files

Use these commands to locate code related to your task:

# Find files by name pattern
find src/ -name "*pattern*"

# Search for specific functions/classes
grep -r "class ClassName" src/
grep -r "def function_name" src/

# Find all imports of a module
grep -r "from module import" src/
grep -r "import module" src/

# Search for specific functionality
grep -r "keyword" src/ --include="*.py"

3. Read Existing Tests

  • Locate test files for the area you're working on:
    find tests/ -name "*test_module*"
    
  • Read tests to understand expected behavior
  • Identify test patterns and fixtures used
  • Check test coverage:
    pytest --cov=src/module tests/test_module.py
    

4. Review Architecture Decisions

  • Check for relevant ADRs (Architecture Decision Records):
    ls adr/ | grep -i "topic"
    cat adr/ADR-00XX-decision-name.md
    
  • Read ADR index: adr/README.md
  • Understand rationale for current implementation

5. Identify Patterns

  • Look for similar implementations:

    # Find similar class structures
    grep -r "class.*Base" src/
    
    # Find similar API endpoints
    grep -r "@router\.(get|post)" src/
    
    # Find similar error handling
    grep -r "try:" src/module/
    
  • Identify coding conventions:

    • Naming patterns (snake_case, PascalCase)
    • Docstring format
    • Type hint usage
    • Error handling approach

6. Check Dependencies

  • Review module's dependencies:
    # Read imports in target file
    head -20 src/module/file.py | grep "import"
    
  • Check for circular dependencies
  • Understand external library usage

Read the full file on GitHub · 205 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 205 lines · 19 tokens per session scan A ca424c23e084

Subscribe to this mod's changes

explore-codebase is a command published in the GitHub repository vishnu2kmohan/mcp-server-langgraph (4 stars, last pushed 9d ago), licensed MIT. It adds 19 tokens to every session and 1,229 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.