首页 › Graphify + Claude Code 集成
Graphify + Claude Code 集成
Graphify 在 Claude Code 上提供最深层集成。一次安装会同时写入 CLAUDE.md 指令和 PreToolUse hook,让 Claude 在每次文件搜索前先读知识图谱。
一条命令安装
pip install graphifyy
graphify install
graphify claude install # 在你的项目目录执行
安装完成后会自动做两件事:
- 写入
CLAUDE.md:要求 Claude 回答架构问题前先看graphify-out/GRAPH_REPORT.md。 - 写入
PreToolUsehook:在每次Glob/Grep前提示先参考图谱结构。
其他助手如何常驻
Codex、OpenCode、OpenClaw、Factory Droid 目前没有 Claude 同款 hook,因此 Graphify 会把同等规则写入项目根目录的 AGENTS.md。
| 平台 | 命令 | 机制 |
|---|---|---|
| Claude Code | graphify claude install | CLAUDE.md + PreToolUse hook |
| Codex | graphify codex install | AGENTS.md |
| OpenCode | graphify opencode install | AGENTS.md |
| OpenClaw | graphify claw install | AGENTS.md |
| Factory Droid | graphify droid install | AGENTS.md |
常驻模式 vs 显式命令
常驻模式主要暴露 GRAPH_REPORT.md(god nodes、社区、异常连接)。需要路径级精确查询时,直接用 /graphify query、/graphify path、/graphify explain 读取 graph.json。
如何保持图谱新鲜
- Git hooks:
graphify hook install,在 commit/checkout 后自动重建。 - Watch 模式:
/graphify ./raw --watch后台监听文件变化。