CLAUDE.md
993 Bytes
CLAUDE.md
探索代码先查 codegraph
这个仓库有一个轻量代码图索引:tools/codegraph/README.md。
在需要「这个函数/组件在哪定义」「这个文件依赖了谁、被谁依赖」「谁调用了这个函数」这类探索性问题时, 先用它查,而不是直接大范围 Grep 或用 Explore agent:
python tools/codegraph/query_codegraph.py stats
python tools/codegraph/query_codegraph.py file <path>
python tools/codegraph/query_codegraph.py symbol <name>
python tools/codegraph/query_codegraph.py search <keyword>
python tools/codegraph/query_codegraph.py callers <name>
python tools/codegraph/query_codegraph.py importers <path>
查不到或结果存疑(TS 是正则近似解析,Python 调用关系按函数名字符串匹配,见 README「已知局限」)时,
再退回 Grep/Read/Explore 做精确确认。改动较大量代码后重建索引:
python tools/codegraph/build_codegraph.py。