code-review-graph CLAUDE.md

Project instructions in a CLAUDE.md file for working on code-review-graph with Claude Code. They describe the project, its local code knowledge graph, and how agents should query it efficiently.

In plain words
What is it for?
They help agents get an initial project overview, query code relationships, follow suggested next steps, and work with the project's Python, parser, graph, and SQLite components.
Why use it?
They provide shared project context and limit graph queries to focused requests, so an agent can understand the codebase with less unnecessary context.

Instructions file

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.

agentmods
npx agentmods add instructions/tirth8205/code-review-graph/claude-md
Clone the repo
git clone --depth 1 https://github.com/tirth8205/code-review-graph
Per session 2,664 This file is loaded in full into every session.
When invoked 2,664 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.02664 $0.02664
Opus 5 $0.01332 $0.01332
Sonnet 5 $0.00533 $0.00533
Haiku 4.5 $0.00266 $0.00266

Measured yesterday against content hash 6da421de9703, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

code-review-graph CLAUDE.md 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 yesterday.

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.

CLAUDE.md · 215 lines

How it starts

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

CLAUDE.md - Project Context for Claude Code

Project Overview

code-review-graph is a persistent, incrementally updated, local-first knowledge graph for token-efficient code review through MCP and the CLI. It parses codebases using Tree-sitter and targeted fallbacks, builds a structural graph in SQLite, and exposes compact context to AI coding tools including Claude Code, Codex, Cursor, Windsurf, Zed, Continue, OpenCode, Gemini CLI, Qwen, Kiro, Qoder, and GitHub Copilot.

Graph Tool Usage (Token-Efficient)

When using code-review-graph MCP tools, follow these rules:

  1. First call: get_minimal_context(task="<description>") — costs ~100 tokens, gives you the full picture.
  2. All subsequent calls: use detail_level="minimal" unless you need more.
  3. Prefer query_graph_tool with a specific target over broad list_* calls.
  4. The next_tool_suggestions field in every response tells you the optimal next step.
  5. Target: ≤5 tool calls per task, ≤800 total tokens of graph context.

Architecture

  • Core Package: code_review_graph/ (Python 3.10+)
    • parser.py — Tree-sitter multi-language AST parser plus targeted fallbacks for broad source-language and notebook support
    • custom_languages.py — Config-driven custom language support (.code-review-graph/languages.toml, see docs/CUSTOM_LANGUAGES.md)
    • graph.py — SQLite-backed graph store (nodes, edges, weighted-score impact analysis)
    • tools/ — 30 MCP tool implementations split by domain
    • main.py — FastMCP server entry point, registers 30 tools + 5 prompts
    • incremental.py — Git-based change detection, file watching
    • embeddings.py — Optional vector embeddings (local sentence-transformers, OpenAI-compatible endpoints, Google Gemini, MiniMax, Voyage AI)
    • visualization.py — D3.js interactive HTML graph generator
    • cli.py — CLI entry point (install/init, build, update, postprocess, embed, watch, status, visualize, serve/mcp, wiki, detect-changes, register, unregister, repos, eval, daemon)
    • flows.py — Execution flow detection and criticality scoring
    • communities.py — Community detection (Leiden algorithm or file-based grouping) and architecture overview
    • search.py — FTS5 hybrid search (keyword + vector)
    • changes.py — Risk-scored change impact analysis (detect-changes)
    • refactor.py — Rename preview, dead code detection, refactoring suggestions
    • hints.py — Review hint generation
    • prompts.py — 5 MCP prompt templates (review_changes, architecture_map, debug_issue, onboard_developer, pre_merge_check)
    • wiki.py — Markdown wiki generation from community structure
    • skills.py — Multi-platform install/config generation and shipped skill metadata
    • registry.py — Multi-repo registry helpers
    • migrations.py — Database schema migrations (v1-v9)
    • tsconfig_resolver.py — TypeScript path alias resolution

Read the full file on GitHub · 215 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. yesterday First seen · 215 lines · 2,664 tokens per session scan A 6da421de9703

Subscribe to this mod's changes

code-review-graph CLAUDE.md is an instructions file published in the GitHub repository tirth8205/code-review-graph (31,016 stars, last pushed 5d ago), licensed MIT. It adds 2,664 tokens to every session, about $0.0133 per session on Opus 5. 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.