How to Map Any Codebase in 10 Minutes: A Practical Guide to Interactive Knowledge Graphs
Learn how to transform any codebase into an interactive knowledge graph in just 10 minutes. This step-by-step tutorial covers installing the Understand Anything plugin, analyzing project architecture, navigating module dependencies, querying code logic, and automatically generating onboarding documentation.

When I was handed a legacy microservices project with over 200,000 lines of Java code, I didn't read it line by line. I used a knowledge graph to understand it in 10 minutes.
Last week, a new backend developer joined our team. The tech lead gave him three days to understand a microservices project that had been running for five years before he could start fixing bugs. Three days later, he still couldn't map out the dependency chain between the Payment and Order modules. I knew his struggle all too well. I used to wander through thousands of files like a headless chicken, Ctrl+F-ing until my fingers cramped, only to change a Service and accidentally break some obscure Listener down the line.
The problem isn't the volume of code; it's the lack of a "map".
Today, I'll show you how to use an open-source tool—Understand Anything—to turn any codebase into a searchable, clickable, and queryable interactive knowledge graph. This isn't just a pretty architecture diagram generator. It actually parses every file, function, and dependency, letting you explore and master unfamiliar projects right in your browser.
By the end of this guide, you'll know how to: Install the tool → Analyze a target repo → Launch the Knowledge Graph Dashboard → Visualize module relationships → Query code logic → Generate an onboarding guide. The whole workflow takes about 10 minutes.
Prerequisites
- Node.js 18+ installed on your machine
- At least one AI coding tool: Claude Code, Cursor, VS Code (with GitHub Copilot), Codex, or Gemini CLI
- A target project to analyze (local directory or cloned repository)
- Note: If using Claude Code, you'll need Claude API access. If using Cursor/Copilot, just open your IDE.
I'll use Claude Code as the primary example, but installation commands for other platforms are provided at the end.
Step 1: Install the Plugin
Understand Anything is fundamentally a Claude Code plugin, with auto-discovery support for Cursor and VS Code Copilot.
If you're using Claude Code, run the following in your project root:
bash
## Add from the plugin marketplace
/plugin marketplace add Egonex-AI/Understand-Anything
## Install it
/plugin install understand-anything
Why install it this way? Claude Code's plugin system is sandboxed, keeping your global environment clean. Plugins only activate within the current Claude Code session, ensuring security and isolation.
If you're using Cursor, it's even simpler: clone the repository into your project directory. Cursor automatically detects .cursor-plugin/plugin.json and loads it—no extra setup needed. VS Code + Copilot works identically.
For other platforms (Codex, Gemini CLI, OpenCode, etc.), a single command does the trick:
bash
curl -fsSL https://raw.githubusercontent.com/Egonex-AI/Understand-Anything/main/install.sh | bash -s codex
## Replace 'codex' with your platform name: gemini, opencode, cline, kiro, etc.
Restart your CLI or IDE to activate the plugin.
Step 2: Analyze Your Codebase
This is the core step. In Claude Code, run:
bash
/understand --language en
(Note: Replace en with your team's primary language, e.g., zh, es, etc.)
What does this command do? It triggers a multi-agent pipeline in the background:
- project-scanner – Scans the project structure, identifies programming languages and frameworks.
- file-analyzer – Parses every file using Tree-sitter to extract functions, classes, and import/export relationships.
- architecture-analyzer – Identifies architectural layers (API, Service, Data, etc.).
- tour-builder – Generates a guided learning path based on dependency chains.
- graph-reviewer – Validates graph completeness and reference consistency.
Why a Tree-sitter + LLM hybrid? Relying solely on LLMs for code parsing is slow and non-deterministic. Tree-sitter is a deterministic parser: the same code always yields the exact same AST structure. The LLM only handles "intent understanding"—what a file does, which business domain it belongs to—without touching structural analysis. Clear division of labor means speed, reliability, and accuracy.
Using --language en ensures graph descriptions, UI labels, and guided paths are localized for your team. On the first run, if you omit the flag, the tool detects your current chat language, prompts for confirmation, and remembers your choice.
After analysis completes, .understand-anything/knowledge-graph.json is generated in your project root. Large projects may take a few minutes initially, but don't panic—subsequent analyses are incremental, only re-parsing modified files.
Step 3: Open the Dashboard and Actually "See" the Code
bash
/understand-dashboard
Your browser automatically opens an interactive dashboard. You'll see:
- A color-coded knowledge graph by architecture layer (green for API, blue for Service, orange for Data, etc.)
- A search bar (top-right) supporting both fuzzy and semantic search
- A right-side panel showing code summaries, dependencies, and plain-English explanations when you click any node.
Try it yourself: Search for "Payment". The graph automatically highlights all payment-related files and functions. Click a Payment Service node, and you'll instantly see which Controllers call it and which Repositories it depends on. One view clears the entire dependency chain.
Real-World Practice: Analyzing an Open Source Project
Let's analyze Google's microservices-demo. It spans Go, Java, Python, and Node.js, perfectly demonstrating multi-language parsing capabilities.
1. Clone & Analyze
bash
git clone https://github.com/GoogleCloudPlatform/microservices-demo.git
cd microservices-demo
/understand --language en
2. Explore the Graph
Open the Dashboard and switch to Domain View. You'll see business flows: Frontend → Ad Recommendation → Cart → Payment → Currency Converter. Much more intuitive than scanning code. You instantly spot where a payment failure might ripple downstream to other services.
3. Ask Questions
bash
/understand-chat What is the complete flow for Cart checkout?
The tool answers in natural language based on the graph's knowledge, pinpointing exact files and functions involved. You can drill down into any step with follow-up questions.
4. Generate an Onboarding Guide
bash
/understand-onboard
Automatically generates an onboarding document, structuring modules by dependency order. New hires can follow it independently, saving you hours of manual walkthroughs.
Team Collaboration: Commit the Graph to Git
The knowledge graph is essentially a structured JSON file. Commit it to your repository so teammates can open the Dashboard immediately after cloning—no re-analysis needed.
gitignore
## .gitignore
.understand-anything/intermediate/
.understand-anything/diff-overlay.json
Be sure to ignore intermediate/ (temp files) and diff-overlay.json (local overrides). If the graph exceeds 10MB, manage it with Git LFS:
bash
git lfs install
git lfs track ".understand-anything/*.json"
Want it to update automatically on every commit? One command:
bash
/understand --auto-update
It hooks into your post-commit workflow to incrementally update the graph, ensuring every commit has a matching knowledge snapshot.
Troubleshooting & Tips
- First run takes time: 5-10 minutes for large repos is completely normal. Incremental updates later take seconds.
- Node.js version: Must be 18+. Use
nvm use 20if your current version is outdated. - Multi-language support: Excellent coverage for Java, Go, Python, JS/TS. Less common languages like Rust or Dart might have incomplete parsing due to Tree-sitter grammar coverage limits.
- Memory usage: Very large projects (hundreds of thousands of lines) may consume 2-4GB RAM. If it stalls, scope the analysis:
--scope src/frontend.
Summary
Recap the workflow: Install plugin → /understand → /understand-dashboard → Search, click, query → Generate onboarding doc. Under 10 minutes. A massive efficiency leap over blindly grep-ing and IDE-jumping.
For developers constantly onboarding onto new projects, this builds instant global awareness of the codebase. For tech leads, committing the graph to the repo turns it into living documentation for PR reviews and team onboarding.
Next steps: Run it on your main production project. Focus on the Domain View and Guided Tours features—they're invaluable for grasping business logic. If your team uses Cursor, Copilot, or Gemini CLI, just swap the platform name in the install command. The workflow remains identical.
🌐 Tool Repo: Egonex-AI/Understand-Anything (MIT License)