CLI tool that explores codebases and answers questions with file:line references using LLM-powered analysis.
bun install
bun run build# Local directory
code-explorer ./src "How does authentication work?"
# GitHub repo (uses API - no clone needed)
code-explorer github:anthropics/claude-code "How does the CLI parse arguments?"
# GitLab repo
code-explorer gitlab:group/project "What testing framework is used?"
# Any git URL (shallow clones)
code-explorer https://github.com/oven-sh/bun.git "How is the CLI structured?"| Flag | Description | Default |
|---|---|---|
-m, --model |
LLM model (gemini or haiku) | gemini |
-d, --max-depth |
Tree depth limit | 6 |
-e, --exclude |
Additional patterns to exclude | - |
-i, --include |
Additional patterns to include | - |
-b, --branch |
Branch/tag/commit for remote repos | main/master |
-v, --verbose |
Show exploration steps | false |
| Variable | Required For |
|---|---|
GEMINI_API_KEY |
Gemini model (default) |
ANTHROPIC_API_KEY |
Haiku model |
GITHUB_TOKEN |
Private GitHub repos, higher rate limits |
GITLAB_TOKEN |
Private GitLab repos |
- Phase 1: Overview - Generates a filtered directory tree
- Phase 2: Exploration - LLM explores files using read, grep, glob tools
- Phase 3: Answer - Synthesizes answer with file:line references
Install as a skill:
cp skill.md ~/.claude/skills/code-explorer.mdThen use: /code-explorer ./src "How does X work?"