code-review-graph GEMINI.md

A set of instructions for reviewing code with a knowledge graph, which maps relationships such as callers, dependencies, and tests. It tells the agent to use the graph to narrow the work, then confirm findings in the source code.

In plain words
What is it for?
Exploring unfamiliar code, checking the impact of changes, finding related tests, reviewing edits, and answering architecture questions.
Why use it?
It reduces the need to scan an entire codebase and helps identify which parts may be affected by a change.

Instructions file for Gemini CLI

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/gemini-md
Clone the repo
git clone --depth 1 https://github.com/tirth8205/code-review-graph

Made for: Gemini CLI.

Per session 538 This file is loaded in full into every session.
When invoked 538 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod 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.00538 $0.00538
Opus 5 $0.00269 $0.00269
Sonnet 5 $0.00108 $0.00108
Haiku 4.5 $0.00054 $0.00054

Measured 2d ago against content hash ee743412a256, 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 GEMINI.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 2d 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.

Origin

This is a copy

100% identical to code-review-graph copilot-instructions.md — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

GEMINI.md · 46 lines

How it starts

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

MCP Tools: code-review-graph

This project has a knowledge graph. Start with the code-review-graph MCP tools to narrow scope, then read the source. The graph is cheaper than scanning files and gives you structural context (callers, dependents, test coverage) that file search cannot.

When to use graph tools FIRST

  • Exploring code: semantic_search_nodes_tool or query_graph_tool instead of Grep
  • Understanding impact: get_impact_radius_tool instead of manually tracing imports
  • Code review: detect_changes_tool + get_review_context_tool instead of reading entire files
  • Finding relationships: query_graph_tool with callers_of/callees_of/imports_of/tests_for
  • Architecture questions: get_architecture_overview_tool + list_communities_tool

Verify in the source

  • Narrow scope with the graph, then read the source. Do not change code from graph output alone.
  • For any non-trivial change, read the implementation and the relevant tests before concluding.
  • Verify the exact source when touching behavior, database logic, migrations, retries, fallbacks, recovery, or compatibility code.
  • When the graph and the source disagree, the source wins. The graph may be stale or may not model that relationship.
  • An empty graph result can mean "not indexed" or "not statically visible", not "does not exist".

Key Tools

Tool Use when
detect_changes_tool Reviewing code changes — gives risk-scored analysis
get_review_context_tool Need source snippets for review — token-efficient
get_impact_radius_tool Understanding blast radius of a change
get_affected_flows_tool Finding which execution paths are impacted
query_graph_tool Tracing callers, callees, imports, tests, dependencies
semantic_search_nodes_tool Finding functions/classes by name or keyword
get_architecture_overview_tool Understanding high-level codebase structure
refactor_tool Planning renames, finding dead code

Read the full file on GitHub · 46 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. 2d ago First seen · 46 lines · 538 tokens per session scan A ee743412a256

Subscribe to this mod's changes

code-review-graph GEMINI.md is an instructions file published in the GitHub repository tirth8205/code-review-graph (31,071 stars, last pushed 6d ago), licensed MIT. It adds 538 tokens to every session, about $0.0027 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to code-review-graph copilot-instructions.md, differing in 0 lines, and is treated as a copy.