codebase-explorer — Claude Code subagent: project overview
Maps an unfamiliar project’s stack, architecture, entry points, and data flow. It can also write findings to CLAUDE.md on request.
npx claude-code-templates@latest --agent development-tools/codebase-explorerWhat codebase-explorer does
The subagent examines project files and Git history, then maps dependencies, routing, the data layer, and recurring patterns. It returns a structured project overview with key directories, entry points, development commands, and notable details.
After the overview, it can ask whether you want a CLAUDE.md for future sessions. If you agree, it writes the file at the project root. Its available tools are Read, Write, Edit, Bash, Grep, and Glob. It skips files that are not present; if a CLAUDE.md already exists, it reads it and offers an update instead of replacing it.
What it helps with
- understand the architecture of a newly cloned repository
- locate application entry points and routes
- map project dependencies and its data layer
- save project context in
CLAUDE.md
Example prompts for the agent
- Explore this repository and explain its structure.
- I just cloned this project. Map its architecture and entry points.
- Review the codebase and ask whether to save the findings in
CLAUDE.md.
How to install codebase-explorer
1claude-code-templates
npx claude-code-templates@latest --agent development-tools/codebase-explorer2Manually: put the files in place
.claude/agents/codebase-explorer.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention
Manually: put the files in place
.codex/agents/codebase-explorer.tomlCodex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/
Manually: put the files in place
.cursor/agents/codebase-explorer.mdCursor also reads .claude/agents/
Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean
Questions about codebase-explorer
How do I install codebase-explorer in Claude Code?
Run npx claude-code-templates@latest --agent development-tools/codebase-explorer. The agent file is placed at .claude/agents/codebase-explorer.md.
What does codebase-explorer do?
It inspects a project and builds a structured map of its stack, architecture, dependencies, and data flow. With your approval, it writes a CLAUDE.md at the repository root.
What happens if the project already has a CLAUDE.md?
The subagent reads the existing file first and offers to update it rather than replace it.