Turn any codebase into an interactive knowledge graph — 16.9k stars

Understand Anything 是一个 Claude Code Plugin,通过多 Agent 流水线分析项目,将每个文件、函数、类和依赖关系构建成交互式知识图谱,并提供可视化 Dashboard 供探索。支持 Claude Code、Codex、Cursor、Copilot、Gemini CLI、OpenClaw 等 14+ 平台。

“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.”

核心功能

  • 结构图探索:代码库可视化为交互式知识图谱,每个节点可点击查看英文摘要、关系和导览
  • 业务逻辑视图:Domain 视图展示代码到业务流程的映射(域/流程/步骤)
  • 知识库分析:/understand-knowledge 支持 Karpathy-pattern LLM wiki,提取 wikilink 和分类,LLM Agent 发现隐式关系,生成力导向知识图谱
  • 引导式导览:按依赖顺序自动生成架构 Walkthrough,帮助新人按正确顺序学习代码库
  • 模糊 + 语义搜索:按名称或语义搜索(如”哪些部分处理认证?”)
  • Diff 影响分析:提交前查看变更影响的系统范围
  • Persona 自适应 UI:根据用户角色(初级开发/PM/高级用户)调整 Dashboard 详细程度
  • 架构层可视化:自动按 API/Service/Data/UI/Utility 分层,颜色编码
  • 多语言输出:--language zh/ja/ko/ru 生成本地化节点描述和 UI

快速开始

# Claude Code 安装
/plugin marketplace add Lum1104/Understand-Anything
/plugin install understand-anything
 
# 分析代码库
/understand
 
# 打开可视化 Dashboard
/understand-dashboard
 
# 其他命令
/understand-chat How does the payment flow work?   # 问答
/understand-diff                                    # 变更影响分析
/understand-explain src/auth/login.ts              # 深入解释文件/函数
/understand-onboard                                 # 生成新人入职指南
/understand-domain                                  # 提取业务域知识
/understand-knowledge ~/path/to/wiki               # 分析 LLM wiki 知识库

其他平台一键安装:

curl -fsSL https://raw.githubusercontent.com/Lum1104/Understand-Anything/main/install.sh | bash -s openclaw
# 支持: codex, opencode, openclaw, gemini, pi, vibe, vscode, hermes, cline, kimi 等

平台支持

平台状态安装方式
Claude Code✅ 原生Plugin marketplace
Cursor✅自动发现
VS Code + Copilot✅自动发现
Codex / OpenClaw / Gemini CLI✅install.sh <platform>
共 14+ 平台✅—

知识图谱共享

图谱本质是 JSON 文件,提交一次后队友可跳过流水线直接使用:

# .gitignore 中排除临时文件
.understand-anything/intermediate/
.understand-anything/diff-overlay.json

启用 --auto-update 后,post-commit hook 会增量更新图谱,每次提交自动同步。

目录结构

Understand-Anything/
├── understand-anything-plugin/  # 核心 Plugin 实现
├── docs/                        # 文档
├── scripts/                     # 构建/发布脚本
├── install.sh / install.ps1     # 多平台安装脚本
└── homepage/                    # 官网前端

资源