← Back to Skills Marketplace
sg345662365-oss

CodeGraph

by sg345662365-oss · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
41
Downloads
0
Stars
2
Active Installs
1
Versions
Install in OpenClaw
/install codegraph
Description
Build and query AST summaries + call graphs for codebases. Use when exploring a project's structure, finding function definitions, tracing call chains, under...
README (SKILL.md)

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

  1. First encounter with a project: run the build to create cache
  2. Before reading files: query stats then search to find what you need
  3. Before modifying code: query callers to check impact
  4. 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

Usage Guidance
Install only if you are comfortable with the skill creating a local .code-graph.json cache that summarizes file names, function/class names, imports, calls, line numbers, and the project path. Use --exclude or --output when scanning sensitive repositories.
Capability Assessment
Purpose & Capability
The stated purpose is to build AST summaries, import lists, and call graphs for codebases; the script implements that behavior for Python, JavaScript/TypeScript, and Ruby without unrelated capabilities.
Instruction Scope
Runtime instructions are explicit and user-directed: run the analyzer on a chosen project directory, optionally query the cache, choose an output path, or exclude directories.
Install Mechanism
The artifact consists of SKILL.md and a single Python script, with no package installs, dependency declarations, background setup, or hidden install-time behavior.
Credentials
The script recursively reads source files under the provided project directory and writes .code-graph.json by default; this is proportionate for a code indexing skill but can capture private project structure.
Persistence & Privilege
Persistence is limited to a disclosed local JSON cache in the target project or a user-specified output path; there is no privilege escalation, network access, credential handling, or background process.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install codegraph
  3. After installation, invoke the skill by name or use /codegraph
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release of code-graph. - Analyze Python and JavaScript/TypeScript projects by parsing ASTs and generating structural caches. - Quickly query functions, classes, imports, and call graphs without re-parsing files. - Provides project stats, function/class listings, call/caller lookups, import graphs, file summaries, and flexible search. - Supports fast cache rebuild and directory exclusion for efficient analysis. - Cache is stored in the project root and staleness is auto-detected.
Metadata
Slug codegraph
Version 1.0.0
License MIT-0
All-time Installs 2
Active Installs 2
Total Versions 1
Frequently Asked Questions

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.

💬 Comments