本文由 GitRead 中文社区 使用 AI 辅助生成,基于项目 README 与公开资料整理成中文解读, 并结合中文开发者的常见使用场景补充技术选型参考。内容可能存在疏漏,具体以项目官方文档为准。
这份资源讲了什么
Understand Anything 是一个把任意代码库、知识库或文档转成可交互知识图谱的工具,主体用 TypeScript 写成,MIT 协议开源。它挂在 GitHub 上时,最容易被误解成又一个"代码可视化玩具"——但它的定位其实更接近"给 AI 编程助手装上项目地图"。
它覆盖的主题大致是三块:入口(把仓库/目录/文档喂进去)、图化(抽取实体与关系,生成节点和边)、交互(浏览、搜索、对着图谱提问)。README 里那句 “Graphs that teach > graphs that impress” 是整份资料的立场声明:不追求炫酷的三维粒子特效,而在意图能不能真的帮人理解一个陌生项目。
面向的读者不是纯新手,而是已经会用 Claude Code / Codex / Cursor / Copilot / Gemini CLI 这类代理式工具、但苦于它们"只见树木不见森林"的中高级开发者。和同类资料最大的区别在于:市面上多数"代码理解"资源要么是静态架构文档,要么是 IDE 内的符号跳转;Understand Anything 想提供的是可被 Agent 消费的结构化上下文,让模型回答"这个改动会影响哪些模块"时有据可依。
graph TD
A[Understand Anything] --> B[输入层]
A --> C[图化层]
A --> D[交互层]
A --> E[接入层]
B --> B1[代码仓库]
B --> B2[知识库 / 文档]
C --> C1[实体抽取]
C --> C2[关系建模]
C --> C3[图生成与索引]
D --> D1[浏览与检索]
D --> D2[对的图谱提问]
E --> E1[Claude Code / Codex]
E --> E2[Cursor / Copilot]
E --> E3[Gemini CLI / 其他]
C1 --> F[Agent 可消费的上下文]
F --> G[回答影响面 / 定位模块]
Graphs that teach > graphs that impress. Turn any code into an interactive knowledge graph you can explore, search, and ask questions about. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, and more.
Turn any codebase, knowledge base, or docs into an interactive knowledge graph you can explore, search, and ask questions about. Works with Claude Code, Devin, Codex, Cursor, Copilot, Gemini CLI, and more.
From the team behind Understand Anything: Meet Ego, a personal AI agent that builds your store and sells for you.
Build something. Let Ego sell it. Free to use.
You just joined a new team. The codebase is 200,000 lines of code. Where do you even start?
Understand Anything is a Claude Code Plugin that analyzes your project with a multi-agent pipeline, builds a knowledge graph of every file, function, class, and dependency, then gives you an interactive dashboard to explore it all visually. Stop reading code blind. Start seeing the big picture.
The goal isn’t a graph that wows you with how complex your codebase is — it’s a graph that quietly teaches you how every piece fits together.
✨ Features
Note 注意
Want to skip the reading? Try the live demo in our homepage — a fully interactive dashboard you can pan, zoom, search, and explore right in your browser.
Explore the structural graph
Navigate your codebase as an interactive knowledge graph — every file, function, and class is a node you can click, search, and explore. Select any node to see plain-English summaries, relationships, and guided tours.
Understand business logic
Switch to the domain view and see how your code maps to real business processes — domains, flows, and steps laid out as a horizontal graph.
Analyze knowledge bases
Point /understand-knowledge at a Karpathy-pattern LLM wiki and get a force-directed knowledge graph with community clustering. The deterministic parser extracts wikilinks and categories from index.md, then LLM agents discover implicit relationships, extract entities, and surface claims — turning your wiki into a navigable graph of interconnected ideas.
🧭 Guided Tours
Auto-generated walkthroughs of the architecture, ordered by dependency. Learn the codebase in the right order.
🔍 Fuzzy & Semantic Search
Find anything by name or by meaning. Search "which parts handle auth?" and get relevant results across the graph.
📊 Diff Impact Analysis
See which parts of the system your changes affect before you commit. Understand ripple effects across the codebase.
🎭 Persona-Adaptive UI
The dashboard adjusts its detail level based on who you are — junior dev, PM, or power user.
🏗️ Layer Visualization
Automatic grouping by architectural layer — API, Service, Data, UI, Utility — with color-coded legend.
📚 Language Concepts
12 programming patterns (generics, closures, decorators, etc.) explained in context wherever they appear.
Using a local model? For privacy or enterprise setups, point your platform at a local model provider such as Ollama — follow their integration guide to change the model provider.
2. Analyze your codebase
/understand
A multi-agent pipeline scans your project, extracts every file, function, class, and dependency, then builds a knowledge graph saved to .ua/knowledge-graph.json. (Projects that already have a .understand-anything/ directory keep using it — it stays the data directory when present, so nothing needs migrating.)
Heads up on token usage: The initial /understand analyzes your whole codebase and can consume a significant number of tokens on large projects. We recommend running it on a token plan / subscription, or using a local model (see above) for initialization. Subsequent runs are incremental by default — only changed files are re-analyzed — so they use far fewer tokens.
Localized output: Use --language to generate content in your preferred language:
# Generate Chinese content (知识图节点描述和 Dashboard UI)
/understand --language zh
# Supported languages: en (default), zh, zh-TW, ja, ko, ru, vi
On the first run in a project — when you don’t pass --language and no language is stored yet — /understand detects the language you’re conversing in. If it isn’t English, it asks you to confirm (or override) before generating; English conversations are unaffected. Your choice is saved to .ua/config.json and reused on every later run.
The --language parameter affects:
Node summaries and descriptions in the knowledge graph
Dashboard UI labels, buttons, and tooltips
Guided tour explanations
3. Explore the dashboard
/understand-dashboard
An interactive web dashboard opens with your codebase visualized as a graph — color-coded by architectural layer, searchable, and clickable. Select any node to see its code, relationships, and a plain-English explanation.
4. Keep learning
# Ask anything about the codebase
/understand-chat How does the payment flow work?
# Analyze impact of your current changes
/understand-diff
# Deep-dive into a specific file or function
/understand-explain src/auth/login.ts
# Generate an onboarding guide for new team members
/understand-onboard
# Extract business domain knowledge (domains, flows, steps)
/understand-domain
# Analyze a Karpathy-pattern LLM wiki knowledge base
/understand-knowledge ~/path/to/wiki
# Re-run anytime — incremental by default (only re-analyzes changed files)
/understand
# Auto-update on every commit via a post-commit hook
/understand --auto-update
# Scope to a subdirectory (for huge monorepos)
/understand src/frontend
🌐 Multi-Platform Installation
Understand-Anything works across multiple AI coding platforms.
The installer clones the repo to ~/.understand-anything/repo and creates the right symlinks for the chosen platform. Restart your CLI/IDE afterwards.
Note on invoking skills: the invocation prefix differs per platform. Most platforms use slash commands (/understand), but Codex uses $ instead — type $understand, not /understand. If neither prefix is recognized on your platform, just ask in plain language: “Use the understand skill to analyze this project.”
Cursor auto-discovers the plugin via .cursor-plugin/plugin.json when this repo is cloned. No manual installation needed — just clone and open in Cursor.
If auto-discovery doesn’t pick it up, install it manually: open Cursor Settings → Plugins, paste https://github.com/Egonex-AI/Understand-Anything into the search field, and add it from there.
VS Code with GitHub Copilot (v1.108+) auto-discovers the plugin via .copilot-plugin/plugin.json when this repo is cloned. No manual installation needed — just clone and open in VS Code.
For personal skills (available across all projects), run the install.sh above with the vscode platform.
Kiro CLI: kiro-cli chat --agent understand "Analyze this project"
Kiro IDE: The skills are symlinked into ~/.kiro/skills/ and the understand agent is written to ~/.kiro/agents/understand.json, so both are available after restarting the IDE.
For personal skills (available across all projects), run the install.sh above with the kiro platform.
Devin
Devin support comes in two parts: a plugin that generates graphs, and an optional MCP server for querying them and opening dashboards.
Plugin (recommended). You get the namespaced /understand-anything:* skills, the post-commit auto-update hooks, and the analysis subagents. Devin loads the plugin through its Claude-plugin compatibility:
Skills only. This uses the one-line installer above with the devin platform. It symlinks the skills into ~/.agents/skills/, which Devin loads globally, and gives you un-namespaced /understand, /understand-chat, etc. It does not register the auto-update hooks.
MCP server (optional). It serves an existing graph to Devin (status / search / explain / diff / onboard / dashboard). Build the workspace once (pnpm install && pnpm -r build), then register the server in the project’s .devin/config.json:
What to commit: everything in .ua/exceptintermediate/ and diff-overlay.json (those are local scratch). (Legacy projects use .understand-anything/ — substitute that directory name below if it’s the one present.)
.ua/intermediate/
.ua/diff-overlay.json
Keep it fresh: enable /understand --auto-update — a post-commit hook incrementally patches the graph so each commit lands with a matching graph. Or re-run /understand manually before releases.
Once a graph has been generated and committed, anyone on the team can open it with one command — no Claude Code, no LLM, no API key. Only Node.js (>= 18) is required:
The terminal prints a tokenized URL (http://127.0.0.1:5173/?token=…) and opens the full interactive dashboard in your browser. The project directory (default: current directory) must contain the committed data directory (.ua/, or legacy .understand-anything/). Everything is served read-only from local disk — no LLM calls, no data leaves your machine.
Working from a clone instead? pnpm install && pnpm --filter @understand-anything/core build, then GRAPH_DIR=/path/to/analyzed/project pnpm dev:dashboard does the same via the Vite dev server.
🔧 Under the Hood
Tree-sitter + LLM hybrid
Static analysis and LLMs do what each does best:
Tree-sitter (deterministic) — parses source into a concrete syntax tree and extracts structural facts: imports, exports, function/class definitions, call sites, inheritance. Pre-resolved into an importMap during the scan phase and passed to file-analyzers so they don’t re-derive imports from source. Same input → same output, every run. Also powers fingerprint-based change detection for incremental updates.
LLM (semantic) — reads the parsed structure alongside the original source to produce what parsers can’t: plain-English summaries, tags, architectural layer assignments, business-domain mapping, guided tours, language concept callouts.
This split is why the graph is reproducible on the structural side (the same code always yields the same edges) while still capturing intent on the semantic side (what a file is for, not just what it imports).
Multi-Agent Pipeline
The /understand command orchestrates 5 specialized agents, /understand-domain adds a 6th, and /understand-knowledge adds a 7th:
Agent
Role
Used By
project-scanner
Discovers files, detects languages and frameworks
/understand
file-analyzer
Extracts functions, classes, imports; produces graph nodes and edges
/understand
architecture-analyzer
Identifies architectural layers
/understand
tour-builder
Generates guided learning tours
/understand
graph-reviewer
Validates graph completeness and referential integrity. Runs inline by default; use --review for full LLM review
/understand
domain-analyzer
Extracts business domains, flows, and process steps
/understand-domain
article-analyzer
Extracts entities, claims, and implicit relationships from wiki articles
/understand-knowledge
File analyzers run in parallel, up to 5 concurrent workers and 20–30 files per batch.
The pipeline also supports incremental updates: only files changed since the last run are re-analyzed.
评论