Token导航 LogoToken导航

Agent Skill · 研究检索

code-graph(代码图)

code-graph 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

code-graph 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为调用外部服务;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 40,677。

总安装 1,261周安装 51GitHub Stars 588下载 396核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:code-graph(代码图)
来源仓库:https://github.com/alinaqi/claude-bootstrap
仓库路径:skills/code-graph
安装命令:
npx skills add https://github.com/alinaqi/claude-bootstrap --skill code-graph
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/alinaqi/claude-bootstrap --skill code-graph

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

Code Graph 提供亚毫秒级符号查找和依赖分析能力,替代传统 grep 文件读取方式。适用于需要快速定位函数、分析调用关系或评估变更影响范围的代码导航场景。优先使用图查询获取元数据,仅在必要时读取完整文件,显著提升大规模代码库效率。

安装命令:npx skills add https://github.com/alinaqi/claude-bootstrap --skill code-graph 使用前应确保 codebase-memory-mcp 服务已部署,查询结果置信度取决于索引完整性。

来源仓库内路径:skills/code-graph

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/alinaqi/claude-bootstrap --skill code-graph;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要调用外部服务,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

code-graph 怎么安装?

在终端执行 npx skills add https://github.com/alinaqi/claude-bootstrap --skill code-graph。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

code-graph 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

code-graph 需要什么权限?

权限级别是调用外部服务。该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

code-graph 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

code-graph 用的人多吗?

公开数据是累计安装 1,261 次,近一周安装 51 次,下载 396 次,GitHub 588 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

code-graph 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
code-graph

代码图 · 本页

1,261588调用外部服务未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Code Graph Skill

Purpose: Use the code graph (codebase-memory-mcp) for sub-millisecond symbol lookup, function search, dependency analysis, and blast radius detection. This replaces brute-force grep and file reading for code navigation.


Core Principle

Graph first, file second. Before reading files or grepping, query the code graph. Only read full files when you need to modify them or need context beyond what the graph provides.

Consider graph when planning. When planning any change — feature, refactor, bug fix — start by querying the graph to understand scope, dependencies, and blast radius. This applies to thinking and planning phases, not just implementation. Grep is still the right tool for searching string literals, log messages, config values, and content that lives outside code structure.

┌────────────────────────────────────────────────────────────────┐
│  GRAPH FIRST, FILE SECOND                                      │
│  ─────────────────────────────────────────────────────────────│
│  The code graph indexes your entire codebase as a persistent   │
│  knowledge graph. Claude queries it via MCP for instant         │
│  symbol lookup, dependency chains, and blast radius — instead   │
│  of reading hundreds of files.                                 │
│                                                                │
│  14 MCP tools │ 64 languages │ sub-ms queries │ zero deps      │
│  ~99% fewer tokens for navigation vs brute-force file reads    │
├────────────────────────────────────────────────────────────────┤
│  AUTO-UPDATED                                                  │
│  ─────────────────────────────────────────────────────────────│
│  File watcher keeps graph in sync. Post-commit hook ensures    │
│  freshness. No manual rebuild needed.                          │
└────────────────────────────────────────────────────────────────┘

When to Use Graph vs Direct Read

TaskUse Graph ToolUse Direct Read?
Find function/class definitionsearch_graphNo
Get function signature + docsget_code_snippetNo
Find all callers of a functiontrace_call_pathNo
Trace dependency chainquery_graphNo
Determine blast radius of changedetect_changesNo
Understand project architectureget_architectureNo
Search for code patternssearch_codeNo
Read full implementation to modifysearch_graph to locate, then Read fileYes
Understand business logic contextget_code_snippet for overview, then ReadYes

Rule: If a graph tool can answer the question, use it. Only open files when you need the full source to make edits.


Available MCP Tools

Indexing & Status

ToolPurposeWhen to Use
index_repositoryBuild/rebuild graph for a projectFirst setup, or after major restructure
index_statusCheck if graph is currentBefore querying, if unsure of freshness
list_projectsList all indexed projectsMulti-project navigation

Querying & Navigation

ToolPurposeWhen to Use
search_graphFind symbols by name (fuzzy)"Find auth-related functions"
search_codeText search across indexed codebase"Find TODO comments", pattern matching
get_code_snippetGet source code for a specific symbolNeed signature, docstring, implementation
get_graph_schemaUnderstand graph structure and relationshipsExploring what data is available
query_graphRun structured graph queriesComplex dependency/relationship queries

Analysis

ToolPurposeWhen to Use
trace_call_pathTrace caller/callee chains"Who calls sendEmail?", "What does init() trigger?"
detect_changesIdentify changed files and blast radiusBefore/after code changes, PR review
get_architectureHigh-level module/package structureOnboarding, understanding project layout

Management

ToolPurposeWhen to Use
delete_projectRemove a project from the graphCleanup, project restructure
manage_adrArchitecture decision recordsDocument architectural decisions
ingest_tracesImport runtime tracesPerformance analysis, dead code detection

Workflow: Before Any Code Change

0. PLAN       → get_architecture + search_graph to understand scope before planning
1. LOCATE     → search_graph to find the symbol
2. UNDERSTAND → get_code_snippet for context
3. BLAST      → detect_changes to assess impact
4. TRACE      → trace_call_path to find all affected callers
5. CHANGE     → Read file, make edit
6. VERIFY     → detect_changes again to confirm scope

Step 0 applies to planning, not just coding. When the user asks you to plan a feature, refactor, or fix — query the graph first to understand what exists, what depends on what, and what the scope looks like. This prevents plans based on wrong assumptions about the codebase.

Never skip step 3. Blast radius analysis prevents unexpected breakage from changes to shared code.


Graph Data & Freshness

The graph stays fresh automatically through 3 layers — no manual rebuild needed:

LayerTriggerWhat Happens
File watcherEvery file savecodebase-memory-mcp detects changes and re-indexes affected files in real-time
Auto-indexSession startauto_index: true ensures graph is current when Claude Code starts
Post-commit hookEvery git commitTouches .code-graph/.needs-update marker — file watcher picks it up (~10ms, non-blocking)

You do NOT need to manually re-index unless you do a major restructure (rename entire directories, switch branches with massive diffs). In that case: index_repository once, then the 3 layers keep it fresh.

  • Storage: .code-graph/ directory (auto-created, gitignored)
  • MCP config: .mcp.json at project root (committed, shared with team)

MCP Configuration

The code graph MCP server is configured in .mcp.json at project root:

{
  "mcpServers": {
    "codebase-memory": {
      "command": "codebase-memory-mcp",
      "args": []
    }
  }
}

Installation: ~/.claude/install-graph-tools.sh


Decision Framework

Need to find a symbol/function?
  → search_graph (sub-ms, structured result)
  → NOT: grep -r "functionName" (slow, unstructured)

Need to understand dependencies?
  → query_graph or trace_call_path (complete, traversable)
  → NOT: manually reading import statements

Need to assess change impact?
  → detect_changes (comprehensive, instant)
  → NOT: searching for usages manually across files

Need to understand architecture?
  → get_architecture (high-level overview)
  → NOT: reading every directory listing

Need to read/modify code?
  → search_graph to locate, then Read the specific file
  → NOT: reading entire directories hoping to find it

Anti-Patterns

Anti-PatternDo This Instead
Grepping for function namessearch_graph with the function name
Reading entire files to find a signatureget_code_snippet for the specific symbol
Manually tracing import chainstrace_call_path or query_graph
Making changes without checking impactdetect_changes before every edit to shared code
Reading all files in a directoryget_architecture for structure, search_graph for specifics
Ignoring graph staleness warningsCheck index_status, re-index if needed
Re-indexing on every queryTrust the file watcher; only manual re-index after major restructure

平台分布

Codex

31.59%
按下载量换算125

Claude

31.32%
按下载量换算124

Cursor

17.88%
按下载量换算71

Gemini CLI

9.66%
按下载量换算38

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

调用外部服务

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills