code-review-graph: Instructions file for Claude Code

CLAUDE.md

code-review-graph CLAUDE.md is an instructions file for Claude Code from tirth8205/code-review-graph. It costs 3,522 tokens per session, scanned A, original, MIT.

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 for Claude Code

Written for Claude Code: PreToolUse hook event. Also seen: mentions CLAUDE.md; names the TodoWrite tool; mentions Claude Code.

This is tirth8205/code-review-graph's own configuration. It tells Claude Code how to work on code-review-graph itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything code-review-graph configures →

About the project

code-review-graph is a local-first code intelligence graph that builds a persistent structural map of a codebase and supplies relevant context to AI coding tools through MCP and a CLI. It is used for code review and large-repository workflows, with catalogue add-ons providing integrations and instructions for operating it.

tirth8205/code-review-graph · 32,411 stars · on GitHub · code-review-graph.com

Reuse

Borrowing it

Nothing to install: this file belongs to tirth8205/code-review-graph. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/tirth8205/code-review-graph/staging/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/tirth8205/code-review-graph

Made for: Claude Code.

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/tirth8205/code-review-graph/claude-md/github.svg)](https://agentmods.dev/instructions/tirth8205/code-review-graph/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/tirth8205/code-review-graph/claude-md"><img src="https://agentmods.dev/badge/instructions/tirth8205/code-review-graph/claude-md/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 code-review-graph CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/tirth8205/code-review-graph/claude-md"><img src="https://agentmods.dev/badge/instructions/tirth8205/code-review-graph/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 3,522 This file is loaded in full into every session.
When invoked 3,522 The same file — it is already loaded in full.
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.03522 $0.03522
Opus 5.5 $0.01409 $0.01409
Sonnet 5.5 $0.00704 $0.00704
Haiku 4.5 $0.00352 $0.00352

Measured 1mo ago against content hash 10e26d89c17b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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.

CLAUDE.md · 217 lines

How it starts

The opening of the file, as written. The whole thing — 217 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 local-first knowledge graph for code review. It parses a repository with Tree-sitter (plus targeted fallbacks), stores nodes and edges in SQLite, updates the graph incrementally from Git changes, and serves compact context over MCP and the CLI to AI coding tools. Supported platforms are the entries in PLATFORMS in skills.py: Claude Code, Codex, Cursor, Windsurf, Zed, Continue, OpenCode, Antigravity, Gemini CLI, Qwen Code, Kiro, Qoder, GitHub Copilot, GitHub Copilot CLI, Hermes Agent and CodeBuddy Code.

Graph Tool Usage (Token-Efficient)

When using code-review-graph MCP tools:

  1. Call get_minimal_context_tool(task="<description>") first. It costs about 100 tokens and gives the overview.
  2. Use detail_level="minimal" on every later call unless that is not enough.
  3. Prefer query_graph_tool with a specific target over broad list_* calls.
  4. Follow the next_tool_suggestions field in each response.
  5. Target: at most 5 tool calls and 800 tokens of graph context per task.

All registered tool names end in _tool. The 30 tools are defined in main.py.

Architecture

Core package code_review_graph/ (Python 3.10+):

  • main.py: FastMCP server entry point. Registers 30 tools and 5 prompts.
  • tools/: tool implementations by domain: build.py, query.py, review.py, context.py, flows_tools.py, community_tools.py, refactor_tools.py, docs.py, registry_tools.py, analysis_tools.py; shared helpers in _common.py.
  • prompts.py: 5 MCP prompts (review_changes, architecture_map, debug_issue, onboard_developer, pre_merge_check).
  • cli.py: the code-review-graph command. daemon.py and daemon_cli.py: the crg-daemon multi-repo watch daemon.
  • parser.py: Tree-sitter multi-language parser with fallbacks for notebooks and other formats. custom_languages.py: languages defined in .code-review-graph/languages.toml (see docs/CUSTOM_LANGUAGES.md).
  • graph.py: SQLite graph store (nodes, edges, impact analysis). migrations.py: schema migrations; the current schema version is 13 and must equal SUPPORTED_SCHEMA_VERSION in the VS Code extension (CI checks this).
  • incremental.py: full build, Git/SVN change detection, incremental update, stale-file reconciliation, watch mode. postprocessing.py: shared post-build pipeline (signatures, flows, communities, FTS).
  • Post-build resolvers: python_resolver.py, jedi_resolver.py (optional enrichment extra), spring_resolver.py, event_resolver.py, temporal_resolver.py, config_keys.py, scoped_resolver.py (PHP, Rust, C#), rescript_resolver.py, hcl_resolver.py, tsconfig_resolver.py (tsconfig and jsconfig path aliases).
  • flows.py: execution flows and criticality. communities.py: Leiden via igraph (optional) or file-based grouping, plus the architecture overview. analysis.py: hub and bridge nodes, knowledge gaps, surprise scoring, suggested questions.
  • search.py: FTS5 keyword search combined with optional vector search. embeddings.py: providers for local sentence-transformers, OpenAI-compatible endpoints, Google Gemini, MiniMax and Voyage AI.
  • changes.py: risk-scored change analysis. refactor.py: rename preview, dead code, suggestions. hints.py: next_tool_suggestions. uncertainty.py: confidence notes on empty results. context_savings.py: estimated context-savings metadata.
  • visualization.py: D3.js HTML graph (D3 is bundled in assets/). exports.py: JSON, GraphML, Neo4j Cypher, Obsidian, SVG. wiki.py: Markdown wiki. graph_diff.py: snapshot diffing. memory.py: stored Q&A feedback.
  • skills.py: install (platform MCP configs, hooks, skills, instruction blocks). _legacy_instructions.py: instruction blocks shipped by earlier releases. jsonc.py: comment-preserving JSONC tokenising and splices, shared by install and uninstall so neither flattens a commented config. uninstall.py: reverses install. enrich.py: PreToolUse hook enrichment. forget.py: drops files from the graph. registry.py: multi-repo registry. http_origin_guard.py: Host/Origin checks for serve --http. token_benchmark.py and eval/: benchmarks. constants.py: shared constants.
  • docs/LLM-OPTIMIZED-REFERENCE.md: the reference served by get_docs_section_tool.

Read the full file on GitHub · 217 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. 1mo ago Changed · +8 lines · +152 tokens per session 10e26d89c17b
  2. 1mo ago Changed · +100 tokens per session f6bd110fe923
  3. 1mo ago Changed · +1 lines · +105 tokens per session 6b4db8fa5ad5
  4. 1mo ago Changed · -7 lines · +501 tokens per session 24c832545a29
  5. 1mo ago 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 (32,411 stars, last pushed 11d ago), licensed MIT. It adds 3,522 tokens to every session, about $0.0141 per session on Opus 5.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.

Related

Other instructions, from other repositories

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 9,715 tokens

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,786 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,262 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,680 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 2,731 tokens

deno copilot-instructions.md

Copilot instructions for denoland/deno, covering deno development guide for github copilot, network access, high level overview, key directories and key files to understand first.

denoland/deno · 3,077 tokens