Skip to main content
Glama

Ripple

See what a change ripples into before you make it.

Coding agents read files; they don't see connections. Ripple turns a Python repository into a local Relate graph — functions, calls, tests, runtime coverage and git history in one embedded store — so an agent (or you) can ask, before touching a function:

  • What breaks if I change it? — every transitive caller, not just the ones grep finds

  • Which tests prove it still works? — tests that reach it through the call graph and tests that actually executed it

  • Who should review the change? — the authors of its current lines

  • What is dead, untested, or tangled? — dead code, untested code, import cycles

Everything runs locally: Relate is an embedded graph database (a library, no server, no account), and the agent is Claude Code talking to Ripple over MCP. No API keys required.

Built for the Relate by Neo4j Hackathon — theme Context, Connected.

Demo video (1.5 min): https://www.youtube.com/watch?v=DZOcLVNHOnk


Quick start (3 commands)

Requires Python ≥ 3.10 and git.

git clone https://github.com/andreivasilache/ripple.git && cd ripple
uv venv && uv pip install -e .        # or: python3 -m venv .venv && .venv/bin/pip install -e .
.venv/bin/ripple demo

ripple demo builds a small demo repository (shop, see below) into tmp/shop, indexes it into the Relate store store/ripple.rl, and answers the four questions. It works offline and takes about a second.

The store is also committed — store/ripple.rl is a single Relate file you can inspect without running anything (see Inspect the graph).

What you'll see

Q1. What breaks if I change round_money?
Impact of shop.money.round_money: 26 caller(s) up to depth 6
  in 12 module(s), 14 test(s) among them, deepest chain 4 hop(s)
  DEPTH   FUNCTION                                   MODULE
  1 (8)   shop.discounts.Discount.apply              shop.discounts
          shop.payments.PaymentProcessor._pay_card   shop.payments
          shop.pricing.calculate_total               shop.pricing
          ...

Q2. Which tests should I run after changing X?
Tests for shop.payments.PaymentProcessor._pay_card: 1 test(s)
  TEST                                             STATIC  DYNAMIC
  tests.test_orders.test_place_order_paid_by_card  -       yes      <- dynamic only: invisible to static analysis

Q3. Who should review a change to calculate_total?
  AUTHOR  EMAIL              LINES  SHARE  LAST CHANGE
  Alice   alice@example.com  7      58%    2025-06-10
  Bob     bob@example.com    5      42%    2026-01-14

Q4. What code is dead or untested?
Dead code: 2 function(s) nothing calls and no test runs
  shop.legacy.legacy_discount  shop.legacy  Dave  2025-04-17
  shop.legacy.legacy_price     shop.legacy  Dave  2025-03-04
Import cycles: 1
  shop.orders -> shop.payments -> shop.orders

Related MCP server: Novgraph

Use it from Claude Code (the agent)

The repo ships a .mcp.json that registers Ripple's MCP server (.venv/bin/ripple mcp).

  1. Run the quick start above (so .venv and store/ripple.rl exist).

  2. Open this folder in Claude Code and approve the ripple MCP server when asked (or check /mcp).

  3. Ask, for example:

    • "What breaks if I change round_money?"

    • "Which tests should I run after changing PaymentProcessor._pay_card?"

    • "Who should review a change to calculate_total?"

    • "Is there dead code in this repo, and who wrote it?"

The server's tools, all read-only:

Tool

Answers

find_symbol(name)

Resolve a short name (calculate_total) to full qualnames

impact(symbol, max_depth)

Transitive callers with their shortest distance

tests_for(symbol)

Tests to run, each marked static and/or dynamic

reviewers(symbol)

Authors of the function's current lines, with share and last change

dead_code() / untested()

Functions nothing calls and no test runs / no test reaches

import_cycles()

Module import cycles

graph_stats() / graph_schema()

Counts and the schema, so the agent can write its own Cypher

cypher(query, params)

Any read-only Cypher query over the graph

To use Ripple from another project, add the same server to that project's MCP config with an absolute path to this repo's .venv/bin/ripple and --store /path/to/store.rl (e.g. "args": ["--store", "/abs/path/store.rl", "mcp"]).


How it uses Relate

Mode: a single file. Ripple keeps its graph in one persistent Relate store, store/ripple.rl, opened with relate.connect("store/ripple.rl") (see store.py). The file is committed, so you can inspect the saved graph without running anything.

Why a single file: the graph is a build artifact of one repository, so one file is easy to commit, copy and hand to someone, and Relate runs inside the process: no server, no account. Writers (ripple index, ripple demo) open it read-write; every query command and the MCP server open it with read_only=True, so asking questions can never change the graph. Tests use Relate's in-memory mode for speed.

Relate does the real work: every question is a Cypher query over the graph (variable-length CALLS traversals with ANY SHORTEST, aggregation over BLAMED_TO, existence checks across EXERCISES), and agents can run their own read-only Cypher through the MCP cypher tool.

Why a graph

A call graph, a coverage report and git blame each answer part of the question. The interesting answers live in the connections between them:

  • Impact is transitive. Changing round_money affects calculate_total, which affects Cart.total, which affects place_order… That is a variable-length traversal, (caller)-[:CALLS]->{1,6}(target), not a lookup.

  • Static and dynamic analysis see different things. PaymentProcessor.charge dispatches with getattr(self, f"_pay_{method}"), so no static analyser sees the call to _pay_card. Coverage does. Ripple stores both as edges (CALLS and EXERCISES) and combines them: _pay_card gets its test, and isn't falsely reported as dead code.

  • Ownership is a path. Function → BLAMED_TO → Commit → AUTHORED_BY → Author, aggregated over the function's current lines.

Schema

graph LR
  Repo -->|CONTAINS| Module
  Module -->|DEFINES| Class
  Module -->|DEFINES| Function
  Module -->|IMPORTS| Module
  Class -->|HAS_METHOD| Function
  Class -->|INHERITS| Class
  Function -->|CALLS| Function
  Function -->|"EXERCISES (test → code)"| Function
  Function -->|BLAMED_TO| Commit
  Commit -->|AUTHORED_BY| Author
  Commit -->|CHANGED| Module

Label

Properties

Repo

name, head_sha, indexed_at

Module

name (shop.pricing), path, is_test, loc

Class

qualname, name, module, lineno, end_lineno

Function

qualname (shop.pricing.calculate_total), name, module, lineno, end_lineno, is_test, is_method

Commit

sha, date, message

Author

email, name

Relationship properties: CALLS {lineno}, EXERCISES {lines} (lines of the function the test executed), BLAMED_TO {lines} (lines of the function last changed in that commit).

How it's built

Python repo ──► parse (ast)      ── modules, classes, functions, imports, resolved calls ──┐
            ──► git log + blame  ── commits, authors, blame lines per function ──────────┼──► Relate store (.rl)
            ──► coverage.py      ── per-test dynamic contexts → test → function edges ───┘          │
                                                                          queries.py (Cypher) ◄──────┘
                                                                           │               │
                                                                      ripple CLI      MCP server

Module

Role

parse.py

Static call graph with the stdlib ast: resolves local names, (relative/aliased) imports, self./super()/Class.method, constructors → __init__, and simple local-variable types

history.py

git log and git blame --line-porcelain, aggregated per function

coverage_map.py

Runs the repo's pytest suite under coverage with dynamic_context = test_function

ingest.py

Batched UNWIND … MERGE into Relate in one transaction, with uniqueness constraints

queries.py

The questions as Cypher (ANY SHORTEST quantified paths keep traversals fast)

cli.py, mcp_server.py

Two front ends over the same queries


The demo repository: shop

examples/shop_history/ holds a tiny e-commerce package and its git history as plain files (a nested .git can't be committed). ripple.sample.build_sample_repo() replays it into a real git repo with fixed authors and dates, so the HEAD SHA — and every answer — is identical on every machine.

It was built on purpose so each question has an interesting answer: a central round_money helper, a getattr dispatch only coverage can see, a function half-rewritten by a second author, legacy code by an author who left, a function called only from the CLI that no test reaches, and an orders ↔ payments import cycle.

The exact expected answers are in EXPECTED.md (blame and coverage numbers machine-verified), and tests/test_demo_questions.py checks the whole pipeline against them — including all 74 static call edges and 148 coverage edges.


Index your own repository

.venv/bin/ripple --store tmp/myrepo.rl index /path/to/your/repo
.venv/bin/ripple --store tmp/myrepo.rl impact some_function
  • Coverage runs your test suite with python -m coverage run -m pytest. By default it uses Ripple's interpreter; point it at your project's environment with --python /path/to/your/.venv/bin/python (that environment needs pytest and coverage), or skip it with --no-coverage (static analysis and history still work).

  • Module names are relative to the path you index. For a src/ layout, index the src directory so imports like mypackage.x resolve.

  • --no-history skips git.

  • index replaces the store's content. A Relate .rl file allows one writer and no reader while it's being written, so MCP tool calls during indexing fail until it finishes.

Inspect the graph

See it: ripple viz --open writes one self-contained HTML page (no server, works offline) and opens it. Click a function to light up everything that depends on it, with its tests and reviewers in the side panel; filter node and relationship types, search, drag and zoom.

Every command takes --store PATH (default store/ripple.rl, or $RIPPLE_STORE) and --json.

.venv/bin/ripple stats
.venv/bin/ripple query "MATCH (f:Function)<-[:CALLS]-(c) RETURN f.qualname AS fn, count(c) AS callers ORDER BY callers DESC LIMIT 5"
.venv/bin/ripple query "MATCH (t:Function)-[:EXERCISES]->(f:Function) WHERE NOT EXISTS { MATCH (t)-[:CALLS]->{1,6}(f) } RETURN t.qualname AS test, f.qualname AS reached_only_at_runtime"

Or straight from Python with Relate's own API:

import relate

with relate.connect("store/ripple.rl", read_only=True) as conn:
    for row in conn.execute(
        "MATCH (f:Function {qualname: $q})-[b:BLAMED_TO]->(:Commit)-[:AUTHORED_BY]->(a:Author) "
        "RETURN a.name AS author, sum(b.lines) AS lines ORDER BY lines DESC",
        {"q": "shop.pricing.calculate_total"},
    ):
        print(row["author"], row["lines"])

If you have the Relate CLI installed, relate query -d store/ripple.rl opens an interactive shell on the same file.

Development

.venv/bin/pytest          # ~130 tests, ~15 s

Limitations

  • Python only. Static call resolution is deliberately conservative: calls through parameters, attributes of unknown objects, and getattr produce no static edge (coverage fills some of that gap when tests exercise the code).

  • Coverage requires the target's test suite to run with pytest.

  • Blame uses HEAD; uncommitted edits can shift line ranges until you commit and re-index.

License

MIT

Available Tools

10 tools
cypherA
Read-onlyIdempotent

Run a read-only Cypher 25 query against the graph (write clauses are rejected; at most 200 rows). Call graph_schema first to see labels, properties and relationship types. Pass every $param used in the query in params. Returns {count, rows: [{column: value}]}; nodes come back as property dicts.

Inputs: query (required), params.

dead_codeA
Read-onlyIdempotent

Non-test functions that nothing calls and no test executes (dunders and main excluded), with who last touched them. Candidates for deletion. Returns {count, functions: [{qualname, module, last_author, last_date}]}.

Inputs: no named parameters.

find_symbolA
Read-onlyIdempotent

Look up functions by name. Accepts a full qualname ('shop.pricing.calculate_total') or a suffix ('calculate_total', 'pricing.calculate_total', 'PaymentProcessor.charge'). Returns {query, matches: [{qualname, module, lineno, is_test}]}.

Inputs: name (required).

graph_schemaA
Read-onlyIdempotent

The Ripple graph schema (labels, properties, relationship types, naming conventions) with example Cypher. Read it before writing a query for the cypher tool.

Inputs: no named parameters. Returns: result

graph_statsA
Read-onlyIdempotent

Size of the graph: node counts per label and relationship counts per type, plus the store path. Returns {store, nodes: {label: n}, relationships: {type: n}}.

Inputs: no named parameters.

impactA
Read-onlyIdempotent

What breaks if symbol changes: every function that calls it directly or transitively (up to max_depth hops), with its shortest distance. Use before editing a function. Returns {symbol, max_depth, count, callers: [{qualname, module, depth, is_test}]} sorted by depth.

Inputs: symbol (required), max_depth.

import_cyclesA
Read-onlyIdempotent

Module import cycles in the repo. Each cycle is a list of module names starting at its alphabetically smallest member. Returns {count, cycles: [[module, ...]]}.

Inputs: no named parameters.

reviewersA
Read-onlyIdempotent

Who should review a change to symbol: the authors of its current lines (git blame at HEAD). Returns {symbol, reviewers: [{author, email, lines, share, last_date}]} sorted by lines desc; share is the fraction (0..1) of the function's lines, last_date the author's latest commit on it.

Inputs: symbol (required).

tests_forA
Read-onlyIdempotent

Which tests to run after changing symbol. static = the test reaches it through calls; dynamic = coverage shows the test executed it. Tests that are dynamic-only are invisible to static analysis (e.g. getattr dispatch) — run them too. Returns {symbol, count, tests: [{test, module, static, dynamic}], dynamic_only: [test]}.

Inputs: symbol (required).

untestedA
Read-onlyIdempotent

Non-test functions that no test reaches, neither through calls nor in coverage. Returns {count, functions: [{qualname, module}]}.

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 10 tools

    Disambiguation4/5

    Each tool answers a clearly different question (find a symbol, find callers, find tests, find reviewers, find dead code), so misselection is unlikely for the core analysis tools. The main soft spot is dead_code vs untested, which both surface 'nothing touches this' functions and differ only by the call-vs-coverage nuance, and graph_stats vs graph_schema are adjacent enough to require reading the descriptions.

    Naming Consistency3/5

    All names are lowercase snake_case and readable, but the grammatical patterns are mixed: verb_noun (find_symbol, import_cycles, graph_stats), noun (reviewers, cypher), verb (impact), and noun_prep (tests_for). A user cannot predict from a name whether a tool is an action or a resource, though nothing is truly ambiguous.

    Tool Count5/5

    Ten tools is well within the sweet spot, and each one corresponds to a distinct code-analysis question an agent would actually ask. The two generic escape hatches (cypher, graph_schema) are justified rather than filler.

    Completeness4/5

    The surface covers the practical pre-edit workflow: locate a symbol, see what breaks, pick tests, pick reviewers, plus repo hygiene via dead code, untested code, and import cycles. Gaps are minor: impact only reports callers, so there is no direct 'what does this call' (downstream) query, and there is no way to index/refresh or inspect a symbol's source; the cypher tool can work around most of these.

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables coding agents to query a local-first code intelligence graph of Python repositories—covering functions, classes, modules, and their relationships—via MCP, supporting subgraph retrieval, caller lookup, and impact analysis without re-reading the codebase.
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      Lets coding agents query a hosted knowledge graph of a git repository over MCP or the shell to retrieve recorded commit intent, co-change coupling, ranked blast radius, and computed architecture. Answers are drawn from the graph rather than file reads, reporting measured per-answer token savings.
      9
      Apache 2.0
    • A
      license
      B
      quality
      B
      maintenance
      Indexes a Python/JS/TS repository into a local SQLite knowledge graph so agents can trace callers, callees, imports, subclasses and covering tests, measure impact radius, rank diff risk, and summarize architecture without grepping files. Exposes these queries as MCP tools alongside an equivalent CLI, with no daemon, embeddings, or network access.
      10
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables AI coding agents to query a locally indexed structural code graph — source entities, callers/callees, Git relationships and recorded mistakes — so they retrieve focused, token-bounded context instead of reading entire files. It runs over local SQLite and can be served through a CLI, agent hooks, an MCP executable and an authenticated local dashboard.
      24 npm
      MIT