CodeGraph
/install codegraph
Code Graph
Analyze project structure via AST parsing instead of reading every file.
Quick Start
Build cache (first time or after changes)
python3 skills/code-graph/scripts/analyze.py \x3Cproject_dir>
Creates .code-graph.json in the project root. Takes seconds for most projects.
Query the cache
python3 skills/code-graph/scripts/analyze.py \x3Cproject_dir> --query \x3Ccommand> [args]
Available Queries
| Query | Description |
|---|---|
stats |
Project overview: file counts, lines, functions, classes |
functions |
List all functions with file + line number |
classes |
List all classes with bases, methods, file + line |
calls \x3Cfunc> |
What does func call? (outgoing edges) |
callers \x3Cfunc> |
Who calls func? (incoming edges) |
file \x3Cpath> |
Full summary of one file (functions, classes, imports, calls) |
imports |
Import graph: file → modules imported |
search \x3Cpattern> |
Find functions/classes matching pattern |
Workflow
- First encounter with a project: run the build to create cache
- Before reading files: query
statsthensearchto find what you need - Before modifying code: query
callersto check impact - After modifying code: rebuild cache with a fresh run (no
--query)
Cache Location
- Default:
\x3Cproject_dir>/.code-graph.json - Override:
--output \x3Cpath>
Rebuild
Re-run without --query to rebuild. The cache includes a fingerprint for staleness detection.
Exclude Directories
python3 skills/code-graph/scripts/analyze.py \x3Cproject_dir> --exclude vendor --exclude tmp
Default excludes: node_modules, .git, pycache, .venv, dist, build, .next, coverage
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install codegraph - After installation, invoke the skill by name or use
/codegraph - Provide required inputs per the skill's parameter spec and get structured output
What is CodeGraph?
Build and query AST summaries + call graphs for codebases. Use when exploring a project's structure, finding function definitions, tracing call chains, under... It is an AI Agent Skill for Claude Code / OpenClaw, with 41 downloads so far.
How do I install CodeGraph?
Run "/install codegraph" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is CodeGraph free?
Yes, CodeGraph is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does CodeGraph support?
CodeGraph is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created CodeGraph?
It is built and maintained by sg345662365-oss (@sg345662365-oss); the current version is v1.0.0.