Skip to content
Back to search

CodeGraph

CodeGraph builds a semantic graph of your codebase — functions, classes, imports, call chains — and exposes it through 42 MCP tools, 38 languages, a VS Code extension, and a persistent memory layer. AI agents get structured code understanding instead of grepping through files.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/codegraph-ai/CodeGraph with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/codegraph-ai/CodeGraph'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/codegraph-ai--codegraph/badge.svg)](/listings/codegraph-ai--codegraph)

HTML

<a href="/listings/codegraph-ai--codegraph"><img src="/api/listings/codegraph-ai--codegraph/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

MCP Server (Claude Code, Cursor, any MCP client)

Add to `~/.claude.json` (or your MCP client config):

{
  "mcpServers": {
    "codegraph": {
      "command": "/path/to/codegraph-server",
      "args": ["--mcp"]
    }
  }
}

The server indexes the current working directory automatically.

VS Code Extension

Install the VSIX:

code --install-extension codegraph-0.21.0.vsix

One VSIX serves every platform. The analysis engine is not bundled: on first activation the extension offers to download the engine built for your platform, verifies it against the published checksum, and installs it into `~/.codegraph/bin` - the same location the JetBrains plugin uses, so one download serves both. The download is offered rather than performed automatically, because it is a native binary that runs with your permissions. Decline it and run **CodeGraph: Download Analysis Engine** from the command palette whenever you are ready.

Once an engine is present, the extension starts it automatically and registers all tools as Language Model Tools for Copilot.

JetBrains IDEs

A plugin for IntelliJ IDEA, PyCharm, GoLand, Android Studio and the rest of the family drives the same engine over LSP: Code Vision, Symbols and Memories tool windows, a graph panel, and one-click MCP registration for the AI Assistant. It resolves or downloads the engine the same way the VS Code extension does, sharing `~/.codegraph/bin`.

→ **[jetbrains/README.md](jetbrains/README.md)** for surfaces, engine resolution order, and building from source.

Rules for AI agents

Pre-configured rule files that teach AI coding agents (Claude, Cursor, Windsurf, Codex, Cline) to use CodeGraph MCP tools before falling back to grep / multi-file reads. Maps natural-language intent to the right `codegraph_*` tool.

→ **[codegraph-ai/codegraph-rules-for-agents](https://github.com/codegraph-ai/codegraph-rules-for-agents)**

Setup is `cp <agent>/codegraph.md ~/<agent>/` (one line per agent — see the rules repo's README).

GitHub Action — PR review in CI

Drop a workflow into your repo to get an automatic code-graph analysis comment on every PR — blast radius, test gaps, stale docs, suggested reviewers. Runs **graph-only** (no embeddings, no ONNX model), so it's fast and needs no API keys — just the built-in `GITHUB_TOKEN`.

Copy [`.github/workflows/codegraph-pr.yml`](.github/workflows/codegraph-pr.yml) into your repo. The core invocation is a single command:

codegraph-server --graph-only \
  --run-tool codegraph_pr_context \
  --tool-args '{"baseBranch":"main","format":"markdown"}'

This prints a ready-to-post markdown comment. The `--graph-only` flag skips embedding generation (10-50× faster indexing); `--run-tool` runs one tool and exits without the MCP stdio handshake — ideal for scripting.

---

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 491 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. # CodeGraph
  2. **Cross-language code intelligence for AI agents and developers.**
  3. [![License](https://img.shields.io/badge/License-Apache%202.0-green.svg)](LICENSE)
  4. CodeGraph builds a semantic graph of your codebase — functions, classes, imports, call chains — and exposes it through **42 MCP tools**, a **VS Code extension**, a **JetBrains IDE plugin**, and a **persistent memory layer**. Parses **38 languages** via tree-sitter. AI agents get structured code understanding instead of grepping through files.
  5. ## Quick Start
  6. ### MCP Server (Claude Code, Cursor, any MCP client)
  7. Add to `~/.claude.json` (or your MCP client config):
  8. ```json
  9. {
  10. "mcpServers": {
  11. "codegraph": {
  12. "command": "/path/to/codegraph-server",
  13. "args": ["--mcp"]
  14. }
  15. }
  16. }
  17. ```
  18. The server indexes the current working directory automatically.
  19. ### VS Code Extension
  20. Install the VSIX:
  21. ```bash
  22. code --install-extension codegraph-0.21.2.vsix
  23. ```
  24. One VSIX serves every platform.
  25. The analysis engine is not bundled: on first activation the extension downloads the engine built for your platform, verifies it against the published checksum, and installs it into `~/.codegraph/bin` - the same location the JetBrains plugin uses, so one download serves both.
  26. If the download fails, run **CodeGraph: Download Analysis Engine** from the command palette to try again.
  27. Once an engine is present, the extension starts it automatically and registers all tools as Language Model Tools for Copilot.
  28. ### JetBrains IDEs
  29. A plugin for IntelliJ IDEA, PyCharm, GoLand, Android Studio and the rest of the
  30. family drives the same engine over LSP: Code Vision, Symbols and Memories tool
  31. windows, a graph panel, and one-click MCP registration for the AI Assistant.
  32. It resolves or downloads the engine the same way the VS Code extension does,
  33. sharing `~/.codegraph/bin`.
  34. → **[jetbrains/README.md](jetbrains/README.md)** for surfaces, engine
  35. resolution order, and building from source.
  36. ### Rules for AI agents
  37. Pre-configured rule files that teach AI coding agents (Claude, Cursor,
  38. Windsurf, Codex, Cline) to use CodeGraph MCP tools before falling back
  39. to grep / multi-file reads. Maps natural-language intent to the right
  40. `codegraph_*` tool.
  41. → **[codegraph-ai/codegraph-rules-for-agents](https://github.com/codegraph-ai/codegraph-rules-for-agents)**
  42. Setup is `cp <agent>/codegraph.md ~/<agent>/` (one line per agent — see
  43. the rules repo's README).
  44. ### GitHub Action — PR review in CI
  45. Drop a workflow into your repo to get an automatic code-graph analysis
  46. comment on every PR — blast radius, test gaps, stale docs, suggested
  47. reviewers. Runs **graph-only** (no embeddings, no ONNX model), so it's
  48. fast and needs no API keys — just the built-in `GITHUB_TOKEN`.
  49. Copy [`.github/workflows/codegraph-pr.yml`](.github/workflows/codegraph-pr.yml)
  50. into your repo. The core invocation is a single command:
  51. ```bash
  52. codegraph-server --graph-only \
  53. --run-tool codegraph_pr_context \
  54. --tool-args '{"baseBranch":"main","format":"markdown"}'
  55. ```
  56. This prints a ready-to-post markdown comment. The `--graph-only` flag
  57. skips embedding generation (10-50× faster indexing); `--run-tool` runs
  58. one tool and exits without the MCP stdio handshake — ideal for scripting.
  59. ---
  60. ## Upgrading to 0.21
  61. Each project re-embeds once, in the background, the first time 0.21 opens it.
  62. Stored vectors now record the model and settings that built them, and an index from 0.20.1 or earlier records none.
  63. Keyword search keeps working while it runs.
  64. Restart any `--watch` daemon after upgrading.
  65. A daemon left running keeps writing vectors that 0.21 will not load, and sessions attached to it run without semantic search until it restarts.
  66. Identifiers whose words run together, like `getUserById`, are now also embedded in word-split form.
  67. This mostly helps natural-language search in camelCase languages such as TypeScript, Java and C#.
  68. Pass `--split-identifiers=false` to keep the old behaviour.
  69. `--full-body-embedding=false` now takes effect; in 0.20.1 the flag was always on.
  70. ---
  71. ## Configuration
  72. ### MCP Server flags
  73. | Flag | Default | Description |
  74. |------|---------|-------------|
  75. | `--workspace <path>` | current dir | Directories to index (repeatable for multi-project) |
  76. | `--exclude <dir>` | — | Directories to skip (repeatable) |
  77. | `--embedding-model <model>` | `bge-small` | `bge-small` (384d, fast), `jina-code-v2` (768d, 6× slower), `granite-97m` (384d, 32K ctx, ~3× slower), or `static` (model2vec, 256d — ~100× faster indexing, no ONNX; needs a local model dir, see below) |
  78. | `--full-body-embedding` | `true` | Embed full function body (~50 lines) for better semantic search and duplicate detection. Takes a value: `--full-body-embedding=false` turns it off |
  79. | `--split-identifiers` | `true` | Also embed the word-split form of identifiers whose words are run together, so `getUserById` embeds as "get user by id" too. Names already separated by `_` or `-` are left alone, since they tokenise into the same words; a leading or trailing delimiter separates nothing, so `_handleClick` is split like `handleClick`. Takes a value: `--split-identifiers=false` embeds raw names, as releases up to 0.20.1 did |
  80. | `--max-files <n>` | 5000 | Maximum files to index (in LSP mode, a positive `codegraph.maxFiles` setting wins) |
  81. | `--max-threads <n>` | half the CPUs | Most threads the engine computes on: the embedding model's pool, the pool tokenizing for it, and the async runtime. Also read from `CODEGRAPH_MAX_THREADS`. Lower it to keep the machine responsive while a large workspace embeds |
  82. | `--profile <name>` | `all` | Filter the exposed MCP tool surface to a named subset (see below) |
  83. | `--graph-only` | off | Skip embedding generation — build the graph and serve structural tools only. No ONNX model load, 10-50× faster indexing. Semantic search and memory tools unavailable. For CI / one-shot graph queries. Not applied in LSP mode. |
  84. | `--run-tool <name>` | — | One-shot mode: index, run a single tool, print its result, exit. No MCP handshake. Pair with `--tool-args '<json>'`. |
  85. `--split-identifiers` and `--full-body-embedding` both change the text every symbol is embedded from, and vectors built from different text cannot be ranked against each other.
  86. A project's stored vectors are therefore stamped with the settings that built them - `--embedding-model` included, since models differ in dimension - and are ignored by any process configured differently.
  87. Changing any of the three re-embeds in the background rather than requiring a manual reindex.
  88. Run `--watch` with the same flags as the sessions that read the project, so both sides share one set instead of re-embedding over each other.
  89. For what this means when upgrading from 0.20.1 or earlier, see [Upgrading to 0.21](#upgrading-to-021).
  90. #### `--embedding-model static` — model2vec fast indexing
  91. Static (model2vec) embeddings replace the ONNX transformer with a token→vector
  92. lookup table: indexing is **~100× faster** (this repo's 5,873 symbols embed in
  93. ~1 s vs ~3.4 min with BGE) and there's **no ONNX runtime or 1.5 GB RAM gate**.
  94. Retrieval stays **hybrid (BM25 + semantic)**, so end-to-end quality is **~90% of BGE**.
  95. The model is not bundled with any client — it needs a local model directory
  96. (`config.json` + `tokenizer.json` + `model.safetensors`) at
  97. `~/.codegraph/static_models/jina-code-static-256`, or wherever
  98. `CODEGRAPH_STATIC_MODEL` points:
  99. - Installing `@astudioplus/codegraph-mcp` from npm downloads it into that
  100. default location for you (best-effort; set `CODEGRAPH_SKIP_MODEL_FETCH=1` to
  101. skip, and the install never fails over it).
  102. - Otherwise fetch the prebuilt one with `scripts/fetch-static-model.sh`, or
  103. distill your own from any sentence-transformer (Apache-2.0 Jina-Code by
  104. default) in ~30 s on CPU: `python scripts/distill_static_model.py`.
  105. - A model in the default location needs no IDE setting: both IDE clients leave
  106. `CODEGRAPH_STATIC_MODEL` unset and let the engine resolve it. To use a model
  107. kept somewhere else, set `codegraph.staticModelPath` in VS Code, or
  108. *Settings → Tools → CodeGraph → Embeddings → Static model directory* in
  109. JetBrains; each client then passes that path as `CODEGRAPH_STATIC_MODEL`.
  110. #### `CODEGRAPH_SKIP_MEMORY_CHECK` — force the embedding model past the RAM gate
  111. Before loading the ONNX model, the server checks available memory and, if under
  112. ~1.5 GB, skips the model to avoid an OOM-kill (running graph-only instead).
  113. Set `CODEGRAPH_SKIP_MEMORY_CHECK=1` (also accepts `true`/`yes`) to bypass that
  114. check and always load the model.
  115. Use it if embeddings are disabled even though the machine has plenty of free
  116. RAM.
  117. A reading of `0 MB available` is treated as a detection failure and the model
  118. loads anyway (macOS parks reclaimable memory in inactive/speculative pages that
  119. some memory readers do not count as free), so this override is mainly for other
  120. cases where the reported figure is low but wrong.
  121. It works in both MCP and one-shot `--run-tool` modes.
  122. #### `--profile` — narrow the MCP tool surface
  123. The full 42-tool surface is convenient but inflates the agent's prompt-context cost. A profile exposes only the slice you need (also settable via the `CODEGRAPH_TOOL_PROFILE` env var):
  124. | Profile | Tools | Use when |
  125. |---------|-------|----------|
  126. | `all` *(default)* | every tool (community + pro) | normal sessions |
  127. | `core` | 8 — search + symbol info + AI context | chatty agent sessions where you only need lookups |
  128. | `graph` | 17 — callers/callees/deps/impact/traverse/PR context | refactoring + structural analysis |
  129. | `memory` | 14 — `codegraph_memory_*` plus the docs tools | note-taking / knowledge-base workflows |
  130. | `security` | pro security tools only (empty on community) | pro security audits |
  131. ### VS Code settings
  132. The `codegraph.*` settings are documented once, next to the extension that
  133. reads them:
  134. → **[vscode/README.md — Configuration](vscode/README.md#configuration)**
  135. Full-body embeddings are enabled by default. Function body text is captured at parse time with zero I/O overhead.
  136. Built-in exclusions (always skipped) cover ~47 directories across three categories:
  137. - **Build / cache**: `node_modules`, `target`, `dist`, `build`, `out`, `.git`, `__pycache__`, `vendor`, `.venv`, `venv`, `.tox`, `.pytest_cache`, `.mypy_cache`, `.ruff_cache`, `.next`, `.nuxt`, `.svelte-kit`, `.parcel-cache`, `.npm`, `.yarn`, `.pnpm-store`, `.cache`, `.cargo`, `.bundle`, `.gradle`, `DerivedData`, `Pods`, `xcuserdata`, `cmake-build-*`
  138. - **IDE / IaC state**: `.idea`, `.vscode-test`, `.fleet`, `.terraform`, `.terragrunt-cache`, `.serverless`
  139. - **Sensitive credential dirs**: `.aws`, `.ssh`, `.gnupg`, `.kube`, `.docker`
  140. Plus glob patterns for binary archives, native libraries, OS metadata, and **secret file extensions** (`*.pem`, `*.key`, `*.p12`, `*.pfx`, `*.crt`, `*.gpg`, `*.kdbx`, SSH key conventions like `id_rsa`, etc.) — defense in depth against accidentally embedding credentials.
  141. Indexing produced zero files, or something else looks wrong? See
  142. **[docs/troubleshooting.md](docs/troubleshooting.md)**.
  143. ---
  144. ## Tools
  145. 42 community tools, plus 27 more (17 of them security analyzers) in CodeGraph Pro.
  146. ### Code Analysis (11)
  147. | Tool | What it does |
  148. |------|-------------|
  149. | `get_ai_context` | **Primary context tool.** Intent-aware (explain/modify/debug/test) with token budgeting. Returns source, related symbols, imports, siblings, debug hints. |
  150. | `get_edit_context` | Everything needed before editing: source + callers + tests + memories + git history |
  151. | `get_curated_context` | Cross-codebase context for a natural language query ("how does auth work?") |
  152. | `analyze_impact` | Blast radius prediction — what breaks if you modify, delete, or rename |
  153. | `analyze_complexity` | Cyclomatic complexity with breakdown (branches, loops, nesting, exceptions, early returns) |
  154. | `find_circular_deps` | Detect circular import/dependency chains across files |
  155. | `find_hot_paths` | Most-called functions ranked by transitive caller count |
  156. | `find_dead_imports` | Find unused imports — modules imported but never referenced |
  157. | `get_module_summary` | High-level summary of a directory: file count, functions, language breakdown, top complex functions |
  158. | `search_by_pattern` | Regex search across function bodies, signatures, names, and docstrings |
  159. | `search_by_error` | Find functions that throw, catch, or handle specific error types |
  160. ### Code Navigation (13)
  161. | Tool | What it does |
  162. |------|-------------|
  163. | `symbol_search` | Find symbols by name or natural language (hybrid BM25 + semantic search) |
  164. | `get_callers` / `get_callees` | Who calls this? What does it call? (with transitive depth) |
  165. | `get_detailed_symbol` | Full symbol info: source, callers, callees, complexity |
  166. | `get_symbol_info` | Quick metadata: signature, visibility, kind |
  167. | `get_dependency_graph` | File/module import relationships with depth control |
  168. | `get_call_graph` | Function call chains (callers and callees) |
  169. | `find_by_imports` | Find files importing a module |
  170. | `find_by_signature` | Search by param count, return type, modifiers |
  171. | `find_entry_points` | Main functions, HTTP handlers, CLI commands, event handlers |
  172. | `find_implementors` | Find all functions registered as ops struct callbacks |
  173. | `find_related_tests` | Tests that exercise a given function |
  174. | `traverse_graph` | Custom graph traversal with edge/node type filters |
  175. ### Indexing (3)
  176. | Tool | What it does |
  177. |------|-------------|
  178. | `reindex_workspace` | Full or incremental workspace reindex |
  179. | `index_files` | Add/update specific files without full reindex |
  180. | `index_directory` | Add directory to graph alongside existing data |
  181. ### Memory (7)
  182. Persistent AI context across sessions — debugging insights, architectural decisions, known issues.
  183. | Tool | What it does |
  184. |------|-------------|
  185. | `memory_store` / `memory_get` / `memory_search` | Store, retrieve, search memories (BM25 + semantic) |
  186. | `memory_context` | Get memories relevant to a file/function |
  187. | `memory_list` / `memory_invalidate` / `memory_stats` | Browse, retire, monitor |
  188. Pairs well with [Tempera](https://github.com/anvanster/tempera) — an episodic memory system that captures transferable debugging strategies and solutions across projects. CodeGraph's memory tools store project-scoped notes; Tempera captures cross-project BKMs (best-known methods) that improve over time.
  189. ### PR / Change Analysis (1)
  190. | Tool | What it does |
  191. |------|-------------|
  192. | `pr_context` | **One-call PR review.** Runs git diff against base branch, finds changed functions in the graph, reports: blast radius (callers), test coverage + gaps, affected modules, diff-aware change classification (signature vs body), stale-doc warnings, complexity, commit-message hint, suggested reviewers from git blame. |
  193. ### Documentation (7)
  194. Persistent project documentation — index design docs, search them semantically, verify code matches the design, generate architecture docs from the code graph.
  195. | Tool | What it does |
  196. |------|-------------|
  197. | `index_markdown` | Index a local `.md` file (ARCHITECTURE.md, API_DESIGN.md, etc.) into the persistent docs store. Heading-tree chunking with leaf-node embeddings. |
  198. | `search_docs` | Semantic search over indexed docs — returns matching sections with heading-path breadcrumbs |
  199. | `list_doc_sources` | List all indexed source files |
  200. | `remove_doc_source` | Remove all indexed chunks from a source file |
  201. | `verify_design` | Cross-reference doc claims vs code graph. `direction=forward` (doc→code), `reverse` (code→doc), or `both` |
  202. | `design_gaps` | Find identifiers described in docs that don't exist in code yet — build TODO lists from specs |
  203. | `generate_architecture_doc` | Auto-generate a structured ARCHITECTURE.md from the live code graph (modules, hot paths, complexity, circular deps) |
  204. All tool names are prefixed with `codegraph_` (e.g. `codegraph_get_ai_context`). Tools that target a specific symbol accept `uri` + `line` or `nodeId` from `symbol_search` results.
  205. ---
  206. ### Usage examples
  207. **Index a design doc and search it:**
  208. ```
  209. codegraph_index_markdown(path: "/projects/myapp/docs/ARCHITECTURE.md")
  210. codegraph_search_docs(query: "how does the auth module handle JWT refresh?")
  211. ```
  212. **Check if the code matches the design:**
  213. ```
  214. codegraph_verify_design(source: "/projects/myapp/docs/ARCHITECTURE.md", direction: "forward")
  215. // → "132/132 identifiers verified, 0 gaps"
  216. ```
  217. **Find what's described in docs but not yet implemented:**
  218. ```
  219. codegraph_design_gaps(source: "/projects/myapp/docs/API_DESIGN.md")
  220. // → "4 of 12 identifiers not found in code: PaymentService, RefundHandler, ..."
  221. ```
  222. **Generate architecture docs from the code graph:**
  223. ```
  224. codegraph_generate_architecture_doc(scope: "src/", topN: 5)
  225. // → Markdown with modules, complexity hotspots, hot paths, circular deps
  226. ```
  227. **Save a debugging insight for future sessions:**
  228. ```
  229. codegraph_memory_store(kind: "debug_context", title: "Nginx body size limit",
  230. content: "The /upload endpoint fails on payloads > 1MB...",
  231. problem: "API returns 500 on large uploads",
  232. solution: "Increase nginx client_max_body_size to 10M",
  233. agentSource: "claude")
  234. ```
  235. **Get AI context with graph compression stats + design doc augmentation:**
  236. ```
  237. codegraph_get_ai_context(uri: "file:///projects/myapp/src/auth.rs", line: 42, intent: "modify")
  238. // → Code context + graphStats: {entitiesInGraph: 13555, entitiesTraversed: 47, entitiesKept: 8}
  239. // → design_context section from indexed docs mentioning "auth"
  240. ```
  241. **Review a PR — blast radius, test gaps, stale docs, reviewers in one call:**
  242. ```
  243. codegraph_pr_context(baseBranch: "main")
  244. // → "PR changes 4 files (+263/-77, 12 functions). 37 direct callers, 8 tests, 3 untested. Risk: medium."
  245. // → test_gaps: [refresh_token, revoke_session] — functions with 0 test callers
  246. // → stale_docs: ["auth.rs described in ARCHITECTURE.md > Authentication — doc may need updating"]
  247. // → suggested_reviewers: [{author: "anvanster", lines_owned: 3200}]
  248. // → commit_hint: "feat(mcp): <describe the change>"
  249. ```
  250. **Narrow the tool surface for chatty sessions:**
  251. ```bash
  252. codegraph-server --mcp --profile=core # Only 8 tools: search + symbol info + AI context
  253. ```
  254. ---
  255. ### CodeGraph Pro
  256. Additional tools available in [CodeGraph Pro](https://codegraph.astudioplus.com/pro):
  257. | Tool | What it does |
  258. |------|-------------|
  259. | `scan_security` | Security vulnerability scan: 40+ dangerous function patterns, source-to-sink taint tracing, auth coverage for HTTP endpoints (7 languages/frameworks), architectural layer violations, weak crypto, hardcoded secrets |
  260. | `analyze_coupling` | Module coupling metrics and instability scores |
  261. | `find_unused_code` | Dead code detection with confidence scoring |
  262. | `find_duplicates` | Detect duplicate/near-duplicate functions |
  263. | `find_similar` / `cluster_symbols` / `compare_symbols` | Embedding-based code similarity |
  264. | `cross_project_search` | Search across all indexed projects |
  265. | `mine_git_history` / `mine_git_history_for_file` / `search_git_history` | Git history mining and semantic search |
  266. | `security_control_flow` | Map every execution path through a function — "can this return without hitting the auth check?" |
  267. | `security_trace_data_flow` | Follow a variable from birth to death — "does user input reach this SQL query?" |
  268. | `security_generate_sbom` | CycloneDX SBOM from 8 lockfile formats |
  269. | `security_audit_deps` | OSV vulnerability check on dependencies |
  270. | `security_check_unchecked_returns` / `_resource_leaks` / `_misconfig` / `_input_validation` / `_error_exposure` | 5 heuristic analyzers covering ~80% of CWE Top 25 |
  271. | `security_scan_iac` | Docker / Kubernetes / Terraform misconfiguration scan |
  272. | `security_check_licenses` | Lockfile license policy enforcement (copyleft detection) |
  273. | `security_check_secrets_entropy` | Shannon-entropy hardcoded-secret detection |
  274. | `security_detect_injection` | Focused SQL/XSS/cmd/path/deser/template injection detection (20 patterns) |
  275. | `security_check_search_path` | Untrusted search-path / DLL-hijacking detection (CWE-426/CWE-427) |
  276. | `security_check_crypto` | Cryptographic misuse: weak ciphers/hashes/PRNG/keys, static IVs, timing-leak comparisons (CWE-208/326-330/338/916, 35 patterns) |
  277. | `security_export_sarif` | Aggregate findings as SARIF 2.1.0 (GitHub Code Scanning, GitLab SAST) |
  278. **Cross-cutting features (all `security_check_*` tools):**
  279. - `include_tests` / `treat_as_production` — first-class skip for tests/samples/vendored
  280. - `check_compile_gates` — C/C++ findings inside `#ifdef X` are marked DEFENSIVE_GATED_OFF when X isn't defined by CMake/Cargo/Makefile
  281. - 25-marker suppression honoring (`# nosec`, `// NOLINT`, `// codeql[ignore]`, `# rubocop:disable`, etc.) at line and function level
  282. - Telemetry blocks per scan: `path_filter` (examined/matched/skipped) + `compile_gate` (gated_off count)
  283. ---
  284. ## Languages
  285. 38 languages parsed via tree-sitter — functions, classes, imports, call graph, complexity metrics, dependency graphs, symbol search, and impact analysis:
  286. | Category | Languages |
  287. |---|---|
  288. | **Systems** | C, C++, Rust, Zig, Objective-C |
  289. | **JVM** | Java, Kotlin, Scala, Groovy, Clojure |
  290. | **Web/Scripting** | TypeScript/JS, Python, Ruby, PHP, Perl, Lua, Elixir, Elm |
  291. | **Web/Style** | CSS |
  292. | **Mobile** | Swift, Dart |
  293. | **Functional** | Haskell, OCaml, Julia, Erlang, Elm, Clojure |
  294. | **Enterprise** | C#, COBOL, Fortran, Go |
  295. | **Blockchain** | Solidity |
  296. | **Shell/Config** | Bash, Dockerfile, HCL/Terraform, TOML, YAML |
  297. | **Hardware** | Verilog/SystemVerilog, Tcl |
  298. | **Data Science** | R, Julia |
  299. HTTP handler detection: Python (FastAPI/Flask/Django), TypeScript (NestJS), Java (Spring/JAX-RS), Go (stdlib/Gin/Echo/Fiber), C# (ASP.NET), Ruby (Rails), PHP (Laravel/Symfony).
  300. > **Community vs full builds:** COBOL, Fortran, Perl, Dart, Zig, and R are
  301. > compiled only with `--features extra-languages`. The default community binary
  302. > omits them — they had zero usage in telemetry and their tree-sitter grammars
  303. > add ~25 MB (COBOL's parse tables alone are 30 MB). The other 32 languages are
  304. > always available.
  305. ---
  306. ## Architecture
  307. ```
  308. MCP Client (Claude, Cursor, ...) VS Code Extension JetBrains Plugin
  309. | | |
  310. MCP (stdio) LSP Protocol LSP Protocol
  311. | | |
  312. └───────────┐ ┌──────┴──────────────────┘
  313. ▼ ▼
  314. ┌─────────────────────────────┐
  315. │ codegraph-server │
  316. ├─────────────────────────────┤
  317. │ 38 tree-sitter parsers │
  318. │ Semantic graph engine │
  319. │ AI query engine (BM25) │
  320. │ Memory layer (RocksDB) │
  321. │ Docs store (RocksDB+HNSW) │
  322. │ Full-body embeddings (BGE) │
  323. │ HNSW vector index │
  324. └─────────────────────────────┘
  325. ```
  326. A single Rust binary serves both MCP and LSP protocols.
  327. - **Indexing**: ~60 files/sec. Incremental re-indexing on file changes via FNV-1a content hashing.
  328. - **Persistence**: Graph and embeddings persist to `~/.codegraph/graph.db` (RocksDB). Instant startup on restart — no re-parsing, no re-embedding.
  329. - **Queries**: Sub-100ms. Cross-file import and call resolution at index time.
  330. - **Embeddings**: Full-body (function bodies captured at parse time, zero disk I/O). Vectors stored in RocksDB alongside the graph. Auto-downloads model on first run.
  331. ---
  332. ## Supported platforms
  333. The engine is a native binary, downloaded for your platform on first run.
  334. | Platform | Architectures |
  335. |---|---|
  336. | macOS | Apple Silicon (arm64) and Intel (x64) |
  337. | Linux | x64 and arm64 |
  338. | Windows | x64 (Windows on ARM runs the x64 build under emulation) |
  339. **Linux requires glibc 2.30 or newer *and* a libstdc++ from GCC 11 or newer
  340. (`GLIBCXX_3.4.29`).** The second requirement is the binding one, and it is not
  341. implied by the first — the engine embeds ONNX Runtime, which is built with
  342. GCC 11.
  343. | Runs | Does not run |
  344. |---|---|
  345. | SLES 15 SP4 | Ubuntu 20.04 |
  346. | Ubuntu 22.04 and newer | Debian 11 |
  347. | Debian 12 and newer | RHEL / CentOS 8 |
  348. | RHEL 9 and newer | Amazon Linux 2 |
  349. | Amazon Linux 2023 | |
  350. Both Linux architectures have identical requirements. If the engine exits
  351. immediately with a message like
  352. ```
  353. version `GLIBCXX_3.4.29' not found (required by codegraph-server)
  354. ```
  355. the distribution's C++ runtime is older than the engine needs; installing a
  356. newer `libstdc++` (for example RHEL 8's `gcc-toolset-11`) resolves it without
  357. upgrading the distribution.
  358. ---
  359. ## Building from Source
  360. ```bash
  361. git clone https://github.com/codegraph-ai/codegraph
  362. cd codegraph
  363. cargo build --release -p codegraph-server # Rust server
  364. cd vscode && npm install && npm run esbuild # VS Code extension
  365. npx @vscode/vsce package # VSIX
  366. ```
  367. Requires rustup (it installs the Rust version pinned in `rust-toolchain.toml`), Node.js 18+, VS Code 1.90+.
  368. ---
  369. ## Support the project
  370. CodeGraph is free, open-source, and maintained by a solo developer.
  371. If it saves you time, consider [sponsoring on GitHub](https://github.com/sponsors/anvanster) — it helps keep the project alive and growing.
  372. ---
  373. ## License
  374. Apache-2.0

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.