Install
openclaw skills install @wei840222/codegraphAnalyze any source-code project through its pre-built local code graph: index it, then answer graph-first codebase questions — symbol source + call paths, callers/callees, change impact, affected tests, file inventory. Use when asked how a codebase works, who calls a symbol, what a change would break, or which tests cover a change.
openclaw skills install @wei840222/codegraphAnswer codebase questions from a pre-built local code graph instead of a grep+read crawl. CodeGraph parses a project with tree-sitter, stores symbols/edges/files in SQLite with FTS5, and returns the verbatim source an agent needs in one call.
Start with explore: when it finds the relevant symbols, it returns their verbatim, line-numbered source plus call paths — a completed Read, not a search result.
explore output as the read source itself: it is byte-for-byte the on-disk file, identical to a Read call. Using it directly is the point of the tool.codegraph explore 'mutateElement renderScene' surfaces the call path among them, riding dynamic-dispatch hops grep cannot follow.⚠️ Some files referenced below were edited since the last index sync banner, Read only the listed files; everything unlisted is fresh.CodeGraph is per-project and index-driven. The graph lives in <repo>/.codegraph/.
codegraph status.codegraph init exists, run it only when authorized.codegraph init in the project root builds .codegraph/ and the graph in one step. It respects .gitignore and default-excluded dirs (node_modules, dist, vendor, ...); files over 1 MB are skipped.init, index, sync, uninit, and unlock modify .codegraph/ or remove its lock. Do not run them without explicit authorization. uninit is destructive; never use it merely to recover from a query failure. If the graph is missing, stale, locked, or unhealthy and authorization is absent, fall back to built-in Read/Grep and state the limit.
codegraph --version
If codegraph is absent and installing it is authorized, follow the install section in references/cli-reference.md (standalone bundle or npm; Node >=20 <25; new shell needed after bundle install).
Done when: a version string prints.
codegraph status <repo>
status takes a positional path, not --path (only explore/query/node/files/callers/callees/impact/affected use -p/--path). Running it inside the repo also works.
Done when: you know whether the project is indexed and the backend is healthy.
🔴 STOP: If the index is absent, request authorization before codegraph init <repo>, then re-run status. Without authorization, fall back to built-in tools and state the limit.
Done when: codegraph status reports the graph initialized with sane counts — or you have a fallback in hand.
codegraph explore --path <repo> '<question or symbol bag>'
Ask the whole question first. A bag of symbol names works better for flows than broad natural language.
Done when: you have the relevant source and call paths for the question — or an explicit unindexed/empty signal telling you to fall back or narrow.
explore missesTreat an empty result, mostly unrelated symbols, or a result that omits the requested path/symbol as a miss. Do not repeat the same broad natural-language query.
codegraph query --path <repo> --kind function <symbol>. Record its filePath, startLine, and endLine.codegraph node --path <repo> --file <filePath> --offset <startLine> --limit <lineCount>, where lineCount = endLine - startLine + 1.callers, callees, or impact for the selected symbol.Only when explore left ground uncovered: query for symbol lookup (kind/path/name fields), node to read one symbol or file, callers/callees for one-hop relationships, impact for change radius, affected for a complete test-file backstop, files for tree inventory. Prefer --json for scriptable output.
For focused test selection, begin with callers and symbol-level impact; use affected last to catch omissions. affected is file-level and unranked, so do not choose a focused test run from it alone.
Done when: every symbol, call path, and affected test the question needs is accounted for.
Answer directly from what codegraph returned, citing path anchors. Results come from a full AST parse — the graph outranks recall.
Done when: every material claim in the answer traces to returned source with a path anchor.
Full flag table, query syntax, env vars, ignore rules, language support, install, and performance caveats: references/cli-reference.md.
explore result as evidence for the question.affected; it reports affected files, not individual tests.