Agent skill

Codegraph

by aiguicai in aiguicai/MCP-Gateway

Run CodeGraph CLI commands through npx for local codebase indexing, semantic search, context building, and impact analysis.

MITAuto-check passedAgent Workflows

Install Codegraph

skills CLI
$ npx skills add aiguicai/MCP-Gateway --skill codegraph -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install aiguicai/MCP-Gateway codegraph --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/aiguicai/MCP-Gateway.git skills-src && mkdir -p .claude/skills && cp -r skills-src/mcp-gateway/crates/gateway-http/builtin-skills/codegraph .claude/skills/codegraph && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
codegraph
GitHub stars
158
Token cost
~1.3k tokens
SKILL.md length
422 words
Files
1
Skills in repo
5
Repo updated
First seen
Licence
MIT

At a glance

Run CodeGraph CLI commands through npx for local codebase indexing, semantic search, context building, and impact analysis.

  • Works in 4 steps: Do NOT use shell_command to run… → Executing commands (skillToken required) → The gateway runs CodeGraph through npx.… → …
  • Agent Workflows work in your project
  • SKILL.md covers IMPORTANT: How to Use This Tool, Prerequisites, Allowed Commands and Typical Workflow, plus 1 more section
  • Calls npx

What it does

Codegraph is an agent skill from aiguicai/MCP-Gateway. Run CodeGraph CLI commands through npx for local codebase indexing, semantic search, context building, and impact analysis. First read the complete builtin://codegraph/SKILL.md to get skillToken; this SKILL.md read does not require skillToken. Calls without the correct skillToken will fail and must be retried.

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Agent Workflows. It works with Model Context Protocol and npm. The repository describes itself as: Unify multiple MCP Servers & Skills into a single gateway — with proxy forwarding, authentication, and a management API. Typical use: expose local stdio servers as remote MCP… The licence is MIT.

When your agent uses it

  • Agent Workflows work in your project

Example prompts

  • “/codegraph”

Requirements

  • Node.js

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Do NOT use shell_command to run CodeGraph commands. The gateway blocks
  2. Executing commands (skillToken required)
  3. The gateway runs CodeGraph through npx. You write codegraph ..., and
  4. This is NOT the CodeGraph MCP server integration. Do not run

What it can do on your machine

Read from SKILL.md and the folder at commit 9cfc330. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npx

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npx, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Codegraph loads about 1.3k tokens when it runs. Until then it costs about 80 tokens; SKILL.md has 422 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~80
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from aiguicai/MCP-Gateway at commit 9cfc330, republished under its MIT licence (© aiguicai). 422 words, ~1,259 tokens.

Download SKILL.mdSave it as .claude/skills/codegraph/SKILL.md (or your agent's skills folder).
name
codegraph
description
Run CodeGraph CLI commands through npx for local codebase indexing, semantic search, context building, and impact analysis. First read the complete builtin://codegraph/SKILL.md to get skillToken; this SKILL.md read does not require skillToken. Calls without the correct skillToken will fail and must be retried.

CodeGraph

CodeGraph builds a local semantic graph of a codebase and exposes CLI commands for indexing, symbol search, task context, file structure, call relationships, impact analysis, and affected-test discovery.

Use this tool when a repository has or should have a .codegraph/ index and the task needs structural code intelligence: "where is this symbol", "how does this area work", "who calls this", "what might break if I change it", or "which tests are affected by these files".

IMPORTANT: How to Use This Tool

This is a dedicated built-in tool named codegraph. You MUST follow these rules:

  1. Do NOT use shell_command to run CodeGraph commands. The gateway blocks attempts to run codegraph or npx -y @colbymchenry/codegraph through shell_command when this tool is enabled. Always use this codegraph tool.

  2. Executing commands (skillToken required):

    • Every exec value MUST start with the codegraph prefix.
    • You MUST include the skillToken returned from reading this document.
    • Example: codegraph({"exec": "codegraph status", "cwd": "D:/project", "skillToken": "<token>"})
  3. The gateway runs CodeGraph through npx. You write codegraph ..., and the gateway executes npx -y @colbymchenry/codegraph ... directly without a shell wrapper.

  4. This is NOT the CodeGraph MCP server integration. Do not run codegraph serve --mcp. This built-in tool only supports selected CLI commands. Upstream MCP-only tools such as codegraph_trace, codegraph_explore, and codegraph_node are not available through this built-in tool.

Prerequisites

Node.js/npm must be installed so npx is available. The upstream npm package currently requires a supported Node runtime, and the first call may download or refresh the @colbymchenry/codegraph npm package cache.

Always set cwd to the project root or a directory inside the configured allowed directories. CodeGraph stores its local SQLite index under .codegraph/.

Show full SKILL.md (147 more words)Show less

Allowed Commands

Use these commands through the codegraph tool:

bash
codegraph --version
codegraph help [subcommand]
codegraph init [path] -i
codegraph index [path]
codegraph sync [path]
codegraph status [path]
codegraph query <search> [--kind <kind>] [--limit <n>] [--json]
codegraph files [path] [--format <format>] [--filter <glob>] [--max-depth <n>] [--json]
codegraph context <task> [--max-nodes <n>] [--max-code <n>] [--no-code] [--format markdown|json]
codegraph callers <symbol> [--limit <n>] [--json]
codegraph callees <symbol> [--limit <n>] [--json]
codegraph impact <symbol> [--depth <n>] [--json]
codegraph affected <files...> [--depth <n>] [--filter <glob>] [--json] [--quiet]

Blocked commands:

bash
codegraph serve --mcp
codegraph install
codegraph uninstall
codegraph uninit
codegraph unlock

Do not use the no-argument codegraph installer through this tool.

Typical Workflow

Check whether the project is initialized:

bash
codegraph({"exec": "codegraph status", "cwd": "D:/project", "skillToken": "<token>"})

Initialize and index a project when needed:

bash
codegraph({"exec": "codegraph init -i", "cwd": "D:/project", "skillToken": "<token>"})

Search for a symbol or inspect a broad area:

bash
codegraph({"exec": "codegraph query AuthService", "cwd": "D:/project", "skillToken": "<token>"})
codegraph({"exec": "codegraph context \"how authentication middleware works\" --max-nodes 30", "cwd": "D:/project", "skillToken": "<token>"})

Inspect call relationships:

bash
codegraph({"exec": "codegraph callers AuthService --json", "cwd": "D:/project", "skillToken": "<token>"})
codegraph({"exec": "codegraph callees AuthService --limit 30", "cwd": "D:/project", "skillToken": "<token>"})
codegraph({"exec": "codegraph impact AuthService --depth 2", "cwd": "D:/project", "skillToken": "<token>"})

Find affected tests or files:

bash
codegraph({"exec": "codegraph affected src/auth.ts", "cwd": "D:/project", "skillToken": "<token>"})

Notes

  • Prefer codegraph status before assuming the project is indexed.
  • Use codegraph sync after large file changes if the index looks stale.
  • Use codegraph context first for architecture or "how does this work" questions; use query for exact symbol lookup; use callers, callees, or impact for change planning.
  • Prefer --json when you need structured output for follow-up reasoning.
  • Do not use shell redirection, pipes, or affected --stdin with this tool. If you need affected tests, pass file paths as arguments. If you need to persist output, use multi_edit_file for files and read_file for inspection.

© aiguicai, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in mcp-gateway/crates/gateway-http/builtin-skills/codegraph of aiguicai/MCP-Gateway.

Open the folder on GitHubat commit 9cfc330

Compare with similar skills

Codegraph next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Codegraph compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Codegraph this skillaiguicai/MCP-Gateway158—~1.3kAutomated safety check: PassMIT
MCP Server BuildershareAI-lab/learn-claude-code78k5 repos~1.2kAutomated safety check: PassMIT
Orca Run Replayiflytek/skillhub5.2k4 repos~3kAutomated safety check: PassApache-2.0
Yahoo Finance2gadicc/yahoo-finance2801—~1.8kAutomated safety check: PassMIT
Workflow Schema Tuningbreaking-brake/cc-wf-studio5.4k—~1.3kAutomated safety check: PassCustom licence
Paseo Plugin Buildergetpaseo/paseo20k—~9.4kAutomated safety check: PassCustom licence

Similar skills

  • MCP Server Builder

    shareAI-lab/learn-claude-code

    Walks through building MCP servers in Python or TypeScript that expose tools, resources and prompts to Claude, with templates, registration and testing.

    78k GitHub starsUsed in 5 repos~1.2k tokens
    Agent WorkflowsAuto-check passed
  • Orca Run Replay

    iflytek/skillhub

    Answers questions about a past agent run from its recording, using causal graphs and replay, instead of reconstructing events from memory.

    5.2k GitHub starsUsed in 4 repos~3k tokens
    Agent WorkflowsAuto-check passed
  • Yahoo Finance2

    gadicc/yahoo-finance2

    A skill your agent uses when building with the yahoo-finance2 TypeScript/Deno/npm library, using its Yahoo Finance data modules, CLI, or MCP server, or contributing to the yahoo-finance2 repository…

    801 GitHub stars~1.8k tokensUpdated 4 days ago
    Agent WorkflowsAuto-check passed
  • Workflow Schema Tuning

    breaking-brake/cc-wf-studio

    Guides edits to cc-wf-studio's workflow schema so AI agents generate better workflows, treating schema text as prompt engineering rather than validation.

    5.4k GitHub stars~1.3k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed
  • Paseo Plugin Builder

    getpaseo/paseo

    Builds, installs and troubleshoots trusted local Paseo plugins, from lifecycle hooks and slash commands to screens, themes and timeline renderers.

    20k GitHub stars~9.4k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Create Harness

    ruvnet/metaharness

    Scaffold your own focused AI agent harness — pick host (Claude Code, Codex, pi.dev, Hermes), template, agents, skills, and ship a npm-publishable harness with its own npx CLI.

    690 GitHub stars~777 tokensUpdated today
    Agent WorkflowsAuto-check passed

More from aiguicai/MCP-Gateway

  • Chrome Cdp

    aiguicai/MCP-Gateway

    Browser automation and debugging through bundled Chrome DevTools Protocol.

    158 GitHub stars~2.1k tokensUpdated 4 mo ago
    Auto-check passed
  • Task Planning

    aiguicai/MCP-Gateway

    Use this bundled skill to create, update, and clear the in-memory todo state required before real bundled tool calls when task planning is enabled.

    158 GitHub stars~1.1k tokensUpdated 4 mo ago
    Auto-check passed
  • Chat Plus Adapter Debugger

    aiguicai/MCP-Gateway

    为 Chat Plus 新框架编写、修复、审查站点适配脚本。先读取完整 builtin://chat-plus-adapter-debugger/SKILL.md 获取 skillToken;这次读取 SKILL.md 不需要 skillToken。不要用正则或局部读取只抓 token。后续调用不带或带错 skillToken 会报错并必须重试,所以正式调试前先拿到正确 token。

    158 GitHub stars~3.8k tokensUpdated 4 mo ago
    Auto-check passed
  • Officecli

    aiguicai/MCP-Gateway

    Create, analyze, proofread, and modify Office documents (.docx, .xlsx, .pptx) using the officecli CLI tool.

    158 GitHub stars~7.1k tokensUpdated 4 mo ago
    Auto-check passed

Categories

Questions about Codegraph

What does Codegraph do?

Run CodeGraph CLI commands through npx for local codebase indexing, semantic search, context building, and impact analysis. Codegraph is an agent skill from aiguicai/MCP-Gateway. Run CodeGraph CLI commands through npx for local codebase indexing, semantic search, context building, and impact analysis.

When should I use Codegraph?

Codegraph fits situations like: agent Workflows work in your project.

How do I install Codegraph in Claude Code?

Run `npx skills add aiguicai/MCP-Gateway --skill codegraph -a claude-code`. Or copy the skill folder (mcp-gateway/crates/gateway-http/builtin-skills/codegraph in aiguicai/MCP-Gateway) into .claude/skills/codegraph in your project. Claude Code loads it when a task matches its description.

How do I install Codegraph in Codex?

Run `npx skills add aiguicai/MCP-Gateway --skill codegraph -a codex`. Or copy the skill folder (mcp-gateway/crates/gateway-http/builtin-skills/codegraph in aiguicai/MCP-Gateway) into .agents/skills/codegraph in your project. Codex loads it when a task matches its description.

Can I use Codegraph in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add aiguicai/MCP-Gateway --skill codegraph -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/codegraph, .gemini/skills/codegraph, .github/skills/codegraph and .opencode/skills/codegraph in your project.

What does Codegraph need to run?

Going by SKILL.md and its folder, Codegraph needs the command-line tools its instructions call (npx). Our summary lists: Node.js.

Does Codegraph access the network?

SKILL.md contains no URLs. Its commands use npx, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Codegraph safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Codegraph use?

Codegraph is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Codegraph use?

About 1.3k tokens (SKILL.md is roughly 5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Codegraph?

Skills that share tags, products or a category with Codegraph: MCP Server Builder (shareAI-lab/learn-claude-code, 78k stars), Orca Run Replay (iflytek/skillhub, 5.2k stars), Yahoo Finance2 (gadicc/yahoo-finance2, 801 stars) and Workflow Schema Tuning (breaking-brake/cc-wf-studio, 5.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Codegraph?

aiguicai (a GitHub organization) maintains it in aiguicai/MCP-Gateway, which has 158 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on May 27, 2026.

Source: aiguicai/MCP-Gateway on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.