| name | code-explorer |
| description | Query and analyze codebases using the Code Explorer knowledge graph. Use for finding symbols, analyzing impact, understanding architecture, exploring code relationships, generating documentation, and asking questions about code. |
| argument-hint | [command] [arguments] |
| allowed-tools | Bash(code-explorer *), Bash(*/code-explorer *), Bash(cargo run -p code-explorer-cli -- *), Read, Grep, Glob |
Code Explorer — Knowledge Graph Code Intelligence
You have access to Code Explorer, a code-intelligence tool that builds a knowledge graph from source code. Use it to answer questions about codebases, find symbols, trace dependencies, and analyze impact — using a fraction of the context that reading files would cost.
Binary location
The CLI is code-explorer. After cargo build --release the binary is at target/release/code-explorer; put it on your PATH, or call it by full path from other projects. Inside the Code Explorer repo, cargo run -p code-explorer-cli -- also works.
See the value (quick)
code-explorer demo [path]
Available commands
1. Analyze a codebase (must run first)
code-explorer analyze [path]
code-explorer analyze [path] --force
code-explorer analyze [path] --incremental
code-explorer analyze [path] --embeddings
code-explorer analyze [path] --skip-git
code-explorer status
2. Search the knowledge graph
code-explorer query "authentication middleware"
code-explorer query "user service" --limit 5
3. Symbol context (360-degree view)
code-explorer context UserService
code-explorer context handleRequest --repo my-project
4. Impact analysis (blast radius)
code-explorer impact handleRequest --direction both
code-explorer impact UserService --direction upstream
code-explorer impact UserService --direction downstream
5. Ask questions (LLM-powered, requires ~/.codeexplorer/chat-config.json)
code-explorer ask "how does the bareme calculation work?" --path /path/to/project
code-explorer ask "which controllers call the external API?"
6. Code health report
code-explorer report --path /path/to/project
code-explorer report --path /path/to/project --json
7. Git analytics (requires the target to be a git repo)
code-explorer hotspots --path [path]
code-explorer coupling --path [path]
code-explorer ownership --path [path]
8. Tracing coverage & dead code
code-explorer coverage
code-explorer coverage UserService
code-explorer coverage --json
code-explorer coverage UserService --trace
9. Raw Cypher queries
code-explorer cypher "MATCH (n:Function) RETURN n.name LIMIT 10"
code-explorer cypher "MATCH (n:Controller)-[:DEFINES]->(a:ControllerAction) RETURN n.name, a.name"
code-explorer cypher "MATCH (n:Method) WHERE n.name STARTS WITH 'Get' RETURN DISTINCT n.name"
code-explorer cypher "MATCH (n:Function) WHERE n.name CONTAINS 'auth' OR n.name CONTAINS 'login' RETURN n"
code-explorer cypher "MATCH (n:Method) WHERE NOT n.filePath ENDS WITH '.test.cs' RETURN n.name"
Supported Cypher operators:
- WHERE:
=, <>, !=, CONTAINS, STARTS WITH, ENDS WITH
- Logic:
AND, OR, NOT (precedence: NOT > AND > OR)
- RETURN:
DISTINCT, count()
- Clauses:
ORDER BY [ASC|DESC], LIMIT
10. Interactive shell
code-explorer shell
11. MCP server (for AI agents)
code-explorer mcp
code-explorer mcp-install
12. HTTP server (REST API)
code-explorer serve --port 3000
code-explorer serve --port 3000 --host 0.0.0.0
13. Validate LLM config
code-explorer config test
14. List indexed repos
code-explorer list
15. Generate documentation (all formats)
code-explorer generate context --path [path]
code-explorer generate wiki --path [path]
code-explorer generate docs --path [path]
code-explorer generate docx --path [path]
code-explorer generate html --path [path]
code-explorer generate obsidian --path [path]
code-explorer generate all --path [path]
Flags on every generate subcommand: --output-dir <dir>, --enrich (LLM, needs chat-config.json), --enrich-profile <fast|quality|strict>, --enrich-lang <auto|fr|en>, --enrich-citations.
16. Other commands
code-explorer trace-files ClassName
code-explorer diagram ClassName --type flowchart|sequence|class
code-explorer rag-import <docs-folder> --path [path]
code-explorer watch [path]
code-explorer dashboard [path]
code-explorer clean [--force|--all]
code-explorer setup
How to use this skill
When the user asks about code structure, architecture, dependencies, or impact:
- Check if the repo is indexed: run
code-explorer status in the relevant directory.
- If not indexed: run
code-explorer analyze [path] first (add --skip-git if the target isn't a git repo).
- Choose the right command based on the question:
- "Where is X defined?" →
code-explorer query "X" or code-explorer context X
- "What calls X?" →
code-explorer impact X --direction upstream
- "What does X depend on?" →
code-explorer impact X --direction downstream
- "How healthy is the code?" →
code-explorer report
- "Which files change most?" →
code-explorer hotspots
- "Is this code used?" →
code-explorer coverage or code-explorer coverage ClassName
- "Explain how X works" →
code-explorer ask "how does X work?"
- "Show me the architecture" →
code-explorer generate html then read the output
- "Which files are involved in X?" →
code-explorer trace-files X
- "Generate a diagram of X" →
code-explorer diagram X --type flowchart
- Parse the output and present it clearly with file paths and relationships.
- Combine multiple commands for complex questions.
Graph node types
The knowledge graph contains 50+ node types:
- Code: Function, Method, Class, Interface, Struct, Enum, Module, Namespace
- ASP.NET: Controller, ControllerAction, Service, Repository, ExternalService
- UI: UiComponent (Telerik/Kendo grids), ScriptFile, AjaxCall
- Data: Entity (EF6), Association, NavigationProperty
- Infrastructure: File, Directory, Import, Export
- RAG: Document, DocChunk (from
rag-import)
Relationship types
Calls, CallsAction, CallsService — invocation chains
Imports, Exports — module dependencies
Inherits, Implements — type hierarchy
HasMethod, HasProperty — class membership
BelongsTo, Mentions — RAG doc-to-code anchors
Tips
- The
.codeexplorer/ directory in the repo root holds the serialized graph (graph.bin), meta.json, and metrics.json (index timing/throughput).
- Supports 14 languages: JS, TS, Python, Java, C, C++, C#, Go, Rust, Ruby, PHP, Kotlin, Swift, Razor.
- Skips
obj/, bin/, node_modules/, packages/ during analysis.
- Use
--skip-git for non-git folders; hotspots/coupling/ownership return empty there (expected).
- All
--json flags output machine-readable JSON.