Claude Code 代码库图谱工具:本地索引与调用关系分析
Have Claude Code 𝘁𝘂𝗿𝗻 𝘆𝗼𝘂𝗿 𝘄𝗵𝗼𝗹𝗲 𝗿𝗲𝗽𝗼 𝗶𝗻𝘁𝗼 𝗮 𝗴𝗿𝗮𝗽𝗵 before it touches the code. B…
提供了具体的性能对比数据和错误率分析,结构清晰,并给出了可直接复制的配置指令,对开发者有较高的参考价值。
Have Claude Code 𝘁𝘂𝗿𝗻 𝘆𝗼𝘂𝗿 𝘄𝗵𝗼𝗹𝗲 𝗿𝗲𝗽𝗼 𝗶𝗻𝘁𝗼 𝗮 𝗴𝗿𝗮𝗽𝗵 before it touches the code. Before it changes a function, it can tell you what that function calls and what calls it.
让 Claude Code 在触碰代码之前,先将整个仓库转化为图谱。在它修改某个函数之前,它可以告诉你该函数调用了什么以及被谁调用。
This is our repo's graph: 6,169 nodes and 37,584 relationships after indexing. We tested it once, asking what two of our functions call and what calls them. The graph returned 7.8 KB. Reading the two files involved came to 228 KB, 𝟮𝟵𝘅 𝗺𝗼𝗿𝗲 𝘁𝗼 𝗿𝗲𝗮𝗱.
这是我们要仓库的图谱:索引后包含 6,169 个节点和 37,584 个关系。我们测试了一次,询问其中两个函数的调用关系和被调用关系。图谱返回了 7.8 KB。读取涉及的两个文件则达到了 228 KB,是图谱的𝟮𝟵𝘅 𝗺𝗼𝗿𝗲 𝘁𝗼 𝗿𝗲𝗮𝗱(多29倍)。
The graph gets things wrong too. This time it linked functions that share a name to unrelated code. The project's own tests put answer quality at 83%, against 92% for reading the files directly. We use it to find where things are and what a change touches. Before editing any code, we have Claude Code 𝗿𝗲𝗮𝗱 𝘁𝗵𝗲 𝗼𝗿𝗶𝗴𝗶𝗻𝗮𝗹 𝗳𝗶𝗹𝗲.
图谱也会出错。这次它将同名函数链接到了不相关的代码上。项目自身的测试显示,答案质量为 83%,而直接读取文件的质量为 92%。我们使用它来定位位置和影响范围。在任何代码编辑之前,我们会让 Claude Code 𝗿𝗲𝗮𝗱 𝘁𝗵𝗲 𝗼𝗿𝗶𝗴𝗶𝗻𝗮𝗹 𝗳𝗶𝗹𝗲(读取原始文件)。
MIT licensed, 47K stars, indexing and queries run locally, no API key needed.
MIT 许可,47K stars,索引和查询均在本地运行,无需 API 密钥。
If you want Claude Code to see what a change touches before it edits anything, send it this 👇 "Install the tool at https://github.com/DeusData/codebase-memory-mcp following its README. Show me the install script first and run it only after I approve. Once it's installed, index this project, turn on its built-in graph page and send me the URL. Then add this rule to the CLAUDE file: to find functions, trace calls or see what a change will affect, check the graph first; before editing any code, read the original file."
如果你希望 Claude Code 在编辑任何内容之前先查看变更的影响范围,请发送以下指令 👇 "按照其 README 在 https://github.com/DeusData/codebase-memory-mcp 安装该工具。先向我展示安装脚本,并在我批准后再运行。安装完成后,索引该项目,开启其内置的图谱页面并将 URL 发给我。然后将此规则添加到 CLAUDE 文件中:查找函数、追踪调用或查看变更影响时,先检查图谱;在编辑任何代码之前,先读取原始文件。"
更进一步:量化金融体系
看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力