← 返回 Skills 市场
openlark

Codegraph Tool

作者 OpenLark · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
37
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install codegraph-tool
功能描述
CodeGraph — Pre-indexed code knowledge graph tool. Provides semantic code intelligence for Claude Code, Cursor, Codex, Gemini, OpenCode, Hermes, Antigravity,...
使用说明 (SKILL.md)

CodeGraph Tool

Local-first code intelligence tool. tree-sitter parsing → SQLite (FTS5) storage → MCP exposes knowledge graph.

Use Cases

Use when users need to install CodeGraph, initialize code graph, index projects, understand code structure, trace call chains, evaluate change impact.

Installation

npx @colbymchenry/codegraph          # Recommended: one-click install + auto-configure Agent
curl -fsSL https://raw.githubusercontent.com/colbymchenry/codegraph/main/install.sh | sh  # No Node required
npm i -g @colbymchenry/codegraph     # npm

Non-interactive: codegraph install --yes [--target=claude,cursor] [--location=local]

Project Initialization

cd your-project
codegraph init -i    # Create .codegraph/ + build index
codegraph index      # Full index (or rebuild: --force)
codegraph sync       # Incremental sync (changed files only)
codegraph status     # Check status

MCP Tools (8)

Tool selection guide is automatically sent to Agent in MCP initialize response.

Intent Tool Key Parameters
Almost any question — architecture, flow, bug, investigation codegraph_explore query (natural language or symbol names)
Locate symbol by name codegraph_search query, kind, limit
Call chain codegraph_callers / codegraph_callees symbol, limit
Change impact codegraph_impact symbol, depth
Single symbol full source / overload disambiguation codegraph_node symbol, includeCode, file, line
File structure codegraph_files
Index health codegraph_status

Core Principles

  • codegraph_explore is the PRIMARY tool — call it first, usually the only call needed. Returns relevant symbol source code (grouped by file), with line numbers.
  • Answer directly, don't delegate to sub-Agent for file exploration — CodeGraph IS the pre-built index, grep/read loops are redundant work.
  • One explore > search + node chained calls.

Anti-patterns

❌ Don't use grep to verify codegraph results (AST is more accurate than grep)
❌ Don't chain search + node to understand an area (one explore does it)
❌ Don't loop node over multiple symbols (one explore returns all)
⚠️ Check staleness banner after edits — pending files need direct Read

Auto-sync

Three-layer protection: ① Native FS events + 2s debounce auto-sync ② Per-file staleness banner (pending files prefixed with ⚠️) ③ Auto-reconciliation on MCP reconnect.
Manual sync only needed in sandbox (CODEGRAPH_NO_DAEMON=1) or CI pre-flight.

CLI Queries

codegraph query \x3Csymbol> [--kind class] [--limit 10] [--json]
codegraph callers \x3Csymbol> [--limit 20] [--json]
codegraph callees \x3Csymbol> [--limit 20] [--json]
codegraph impact \x3Csymbol> [--depth 2] [--json]
codegraph context "\x3Ctask>" [--max-nodes 20]
codegraph affected \x3Cfiles...> [--stdin] [--depth 5] [--filter "e2e/*"] [--quiet]

Configuration

Zero-config — no config files. Auto-excludes node_modules/vendor/dist/build/target/.venv/Pods/.next + .gitignore entries + >1MB files. Exclude more: add to .gitignore; bring back: !vendor/.

Environment variables: CODEGRAPH_WATCH_DEBOUNCE_MS(2000) CODEGRAPH_NO_DAEMON CODEGRAPH_EXPLORE_LINENUMS(1) CODEGRAPH_ADAPTIVE_EXPLORE(1)

Supported Languages (21)

TS/JS/Python/Go/Rust/Java/C#/PHP/Ruby/C/C++/Swift/Kotlin/Scala/Dart/Svelte/Vue/Liquid/Pascal-Delphi/Lua/Luau

Framework Routes (14)

Django/Flask/FastAPI/Express/NestJS/Laravel/Drupal/Rails/Spring/Gin-chi-gorilla-mux/Axum-actix-Rocket/ASP.NET/Vapor/ReactRouter-SvelteKit — auto-recognize route files and generate route nodes.

Cross-language Bridging

Swift↔ObjC / RN legacy bridge / TurboModules / RN events / Expo Modules / Fabric-Paper views. Synthesized edges marked provenance:'heuristic'.

Uninstall

codegraph uninstall    # Remove MCP config
codegraph uninit       # Delete .codegraph/

References

安全使用建议
Prefer the npx or npm installation path instead of the curl-to-sh command. Initialize CodeGraph only in repositories you are comfortable indexing, review exclusions such as .gitignore, and avoid optional auto-allow settings unless you are comfortable with the agent querying the code index without repeated prompts.
能力标签
crypto
能力评估
Purpose & Capability
The documented purpose is local-first code intelligence using tree-sitter parsing, SQLite indexing, CLI queries, and MCP tools; the described capabilities match that purpose.
Instruction Scope
The skill encourages agents to prefer CodeGraph over grep/read loops and can return repository structure and source snippets, which is expected for a code-indexing tool but should be used only on repositories the user intends to expose.
Install Mechanism
Installation options include npx, npm global install, and a curl-to-sh command from GitHub; the remote shell installer is disclosed but riskier than the package-manager options.
Credentials
Creating a .codegraph index, excluding common generated directories, honoring .gitignore, and exposing code-intelligence queries are proportionate to the stated purpose.
Persistence & Privilege
Auto-sync/file watching and optional MCP auto-allow permissions are documented and purpose-aligned, but they reduce repeated user prompts and should be enabled deliberately.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install codegraph-tool
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /codegraph-tool 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of codegraph-tool — a local-first, pre-indexed code knowledge graph for advanced code intelligence. - Provides semantic code understanding with tree-sitter parsing and fast SQLite-based graph queries. - Supports 8 core MCP tools for code exploration, symbol search, call chains, change impact analysis, and more. - Offers zero-config setup with one-click installation and automatic exclusion of common files. - Covers 21 languages and auto-detects 14 major framework routing conventions. - Features real-time auto-sync, CLI commands, and robust cross-language bridging support. - Includes clear anti-patterns and best practices to maximize agent productivity.
元数据
Slug codegraph-tool
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Codegraph Tool 是什么?

CodeGraph — Pre-indexed code knowledge graph tool. Provides semantic code intelligence for Claude Code, Cursor, Codex, Gemini, OpenCode, Hermes, Antigravity,... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 37 次。

如何安装 Codegraph Tool?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install codegraph-tool」即可一键安装,无需额外配置。

Codegraph Tool 是免费的吗?

是的,Codegraph Tool 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Codegraph Tool 支持哪些平台?

Codegraph Tool 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Codegraph Tool?

由 OpenLark(@openlark)开发并维护,当前版本 v1.0.0。

💬 留言讨论