clangd-graph-rag

clangd-graph-rag is a skill for Claude Code, Codex from 2015xli/clangd-graph-rag. It costs 0 tokens per session (834 once invoked), scanned A, original, Apache-2.0.

A semantic and structural search tool for C and C++ codebases backed by a graph database. It maps relationships such as function calls, class inheritance, macros, and type aliases.

In plain words
What is it for?
Use it to explore project architecture, trace caller and callee chains, inspect C++ inheritance and templates, follow aliases and macros, and search for code by meaning. It requires a prepared Neo4j graph and configured server.
Why use it?
It helps answer questions that ordinary text search can miss, such as where a function is called, how a class is inherited, or what a macro-generated symbol refers to.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to explore project architecture, trace caller and callee chains, inspect C++ inheritance and templates, follow aliases and macros, and search for code by meaning. It requires a prepared Neo4j graph and configured server.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/2015xli/clangd-graph-rag/clangd-graph-rag
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add 2015xli/clangd-graph-rag --skill clangd-graph-rag
Clone the repo
git clone --depth 1 https://github.com/2015xli/clangd-graph-rag

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for clangd-graph-rag

README.md
[![agentmods](https://agentmods.dev/badge/skills/2015xli/clangd-graph-rag/clangd-graph-rag/github.svg)](https://agentmods.dev/skills/2015xli/clangd-graph-rag/clangd-graph-rag)
Your own site
<a href="https://agentmods.dev/skills/2015xli/clangd-graph-rag/clangd-graph-rag"><img src="https://agentmods.dev/badge/skills/2015xli/clangd-graph-rag/clangd-graph-rag/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for clangd-graph-rag

Your own site · 80×15
<a href="https://agentmods.dev/skills/2015xli/clangd-graph-rag/clangd-graph-rag"><img src="https://agentmods.dev/badge/skills/2015xli/clangd-graph-rag/clangd-graph-rag.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 834 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00834
Opus 5 $0.00000 $0.00417
Sonnet 5 $0.00000 $0.00167
Haiku 4.5 $0.00000 $0.00083

Measured 11d ago against content hash bf0f031cb431, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

clangd-graph-rag scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

SKILL.md · 48 lines

How it starts

The opening of the file, as written. The whole thing — 48 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Skill: clangd-graph-rag

This skill enables deep semantic and structural analysis of C/C++ codebases using a pre-built Neo4j GraphRAG. It provides insights into call chains, class hierarchies, macro causality, and type aliases.

Activation

Activate this skill when the user asks questions about:

  • Project architecture, module responsibilities, or high-level workflows.
  • Call chains (caller/callee relationships) or method overriding.
  • C++ inheritance structures and template specializations.
  • "Magic symbols" generated by macros or complex typedef/using alias chains.
  • Semantic code search (e.g., "Find the logic for packet validation").

Setup Requirements

  • A Neo4j database populated by the clangd-graph-rag pipeline.
  • The graph_mcp_server.py must be configured as an MCP server.
  • Environment variables: NEO4J_URI, NEO4J_USER, NEO4J_PASSWORD.

Core Instructions

1. Orientation & Discovery

  • Always start by calling get_project_info and get_graph_schema.
  • get_project_info provides the path (absolute project root) and a high-level summary.
  • get_graph_schema explains the node labels (e.g., FUNCTION, CLASS_STRUCTURE, MACRO, TYPE_ALIAS) and relationships.
  • Paths: All path properties in the graph are relative to the project root.

2. Structural Querying (Cypher)

  • Use execute_cypher_query for precise structural analysis.
  • Semantic Labels: Prefer specific labels (FUNCTION, METHOD, CLASS_STRUCTURE, MACRO, TYPE_ALIAS) over the generic ENTITY label for efficiency.
  • Macros: Follow (s)-[:EXPANDED_FROM]->(m:MACRO) to explain symbols generated by the preprocessor. Check the original_name property on the symbol for the raw invocation text.
  • Types: Follow (ta:TYPE_ALIAS)-[:ALIAS_OF]->(t) to resolve alias chains (e.g., MyInt2 -> MyInt -> int).
  • Calls: Use SHORTEST path selectors (e.g., MATCH p = SHORTEST 5 (a:FUNCTION)-[:CALLS*]->(b:FUNCTION)) to prevent result set explosion.
  • Result Management: Always use LIMIT (e.g., LIMIT 10) on custom queries.

Read the full file on GitHub · 48 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 48 lines · 0 tokens per session scan A bf0f031cb431

Subscribe to this mod's changes

clangd-graph-rag is a skill published in the GitHub repository 2015xli/clangd-graph-rag (63 stars, last pushed 4mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 834 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.