Metadata-Version: 2.5
Name: changemap
Version: 1.0.1
Summary: A clickable map of what a pull request changed: one offline HTML page, made by a script, no model.
Project-URL: Homepage, https://github.com/ankitkpandey1/changemap
Project-URL: Repository, https://github.com/ankitkpandey1/changemap
Project-URL: Issues, https://github.com/ankitkpandey1/changemap/issues
Project-URL: Changelog, https://github.com/ankitkpandey1/changemap/blob/main/CHANGELOG.md
Author: ankitkpandey1
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: agent skill,ai code review,ai generated code,architecture map,call graph,call graph diff,claude code,code review,code visualization,codex,cursor,diff,github copilot,offline,pr visualization,pull request,pull request review,static analysis,tree-sitter
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Topic :: Software Development :: Version Control :: Git
Classifier: Topic :: Utilities
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: tree-sitter-c>=0.24
Requires-Dist: tree-sitter-cpp>=0.23.4
Requires-Dist: tree-sitter-html>=0.23.2
Requires-Dist: tree-sitter-java>=0.23.5
Requires-Dist: tree-sitter-javascript>=0.25
Requires-Dist: tree-sitter-rust>=0.24.2
Requires-Dist: tree-sitter-typescript>=0.23.2
Requires-Dist: tree-sitter>=0.25
Provides-Extra: dev
Requires-Dist: mypy>=1.13; extra == 'dev'
Requires-Dist: pytest-xdist>=3; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: ruff>=0.8; extra == 'dev'
Description-Content-Type: text/markdown

# changemap: review large AI-generated pull requests as one clickable map

[![CI](https://github.com/ankitkpandey1/changemap/actions/workflows/ci.yml/badge.svg)](https://github.com/ankitkpandey1/changemap/actions/workflows/ci.yml)
[![PyPI](https://img.shields.io/pypi/v/changemap)](https://pypi.org/project/changemap/)
[![Python](https://img.shields.io/pypi/pyversions/changemap)](https://pypi.org/project/changemap/)
[![Licence](https://img.shields.io/pypi/l/changemap)](https://github.com/ankitkpandey1/changemap/blob/main/LICENSE)

**Code review for AI-written code.** `changemap` turns a pull request of 1,000 to 15,000
lines into one offline HTML page: a call-graph diff you can click through.

- **See the whole change first.** The page opens on the parts of the change: groups of changed
  functions that belong together, how big each is, and which part calls which.
- **Walk one part.** Step through it in the order it runs. The map shows where each step calls
  next, and the calls in the code are links to the next step.
- **Read the code.** Per-function diffs with Before, Now and What changed, or the whole part top
  to bottom.
- **Works with your agent.** `--outline` gives an agent the change as plain text. `--flows` draws
  the parts the agent named. It ships as an agent skill for Claude Code, Cursor, GitHub Copilot,
  Codex and any agent that reads [Agent Skills](https://agentskills.io).
- **Private and free to run.** A script makes the page. Your code is sent nowhere, no model is
  used, no tokens are spent, and it gives no verdict.
- **No clone needed.** Give it a pull request address.

![The page opens on the parts of a change, opens one part, steps through it along the heavy next arrows, follows a call in the code to its step, and reads the whole part top to bottom](https://raw.githubusercontent.com/ankitkpandey1/changemap/main/docs/demo.gif)

## Install

macOS and Linux:

    curl -LsSf https://raw.githubusercontent.com/ankitkpandey1/changemap/main/install.sh | sh

Any system, including Windows: `uv tool install changemap`, `pipx install changemap` or
`pip install changemap`. To run it without installing: `uvx changemap`.

Needs Python 3.10 or newer and `git`. The GitHub command-line tool `gh` is optional: it is used
for `changemap pr NUMBER` when present (without it changemap reads the pull request from
`origin`), for filing feedback, and it makes the web-address mode a little more reliable. No
Node, Java, compiler or Graphviz needed. `changemap doctor` checks git, Python, the language
packages, `gh` and the cache folder.

## Quick start

**Works on a repository you have not cloned.** Give it the address of a pull request:

    changemap https://github.com/OWNER/REPO/pull/123 --open

It fetches only the two commits and the source files it reads, from the git server, into a
small throwaway folder in your cache (deleted after 30 days unused). It works with a pull
request or compare link on GitHub, a merge request on GitLab, and pull requests on Gitea,
Forgejo, Codeberg, Azure DevOps and Bitbucket Cloud. As `changemap --remote URL BASE HEAD` it
reads two commits on any git server. Private repositories work through your own git login.

Or, in a git repository, on the branch you want to understand:

    changemap --open

That compares your branch with where it left the default branch, writes `changemap.html`,
prints the path and opens it. Other ways in:

    changemap BASE HEAD          # two commits or refs
    changemap pr 123             # a pull request, from inside a clone (uses gh; without it, reads origin)
    changemap --remote URL BASE HEAD   # two commits on any git server, no clone
    changemap --watch --open     # the working tree, redrawn as files change

Want to see a page before you install anything? Download
[`examples/litestar-fullstack-react.html`](https://github.com/ankitkpandey1/changemap/blob/main/examples/litestar-fullstack-react.html)
and open it. It was made from a public pull request,
[litestar-fullstack #237](https://github.com/litestar-org/litestar-fullstack/pull/237)
(MIT licence). It needs no server.

## Why

An AI agent can write a 10,000-line pull request in an afternoon. Nobody reads it line by line,
and a flat diff sorted by file name does not tell you what the change did to the system.

You want to know four things. What is the approach? What does it touch? How does a route or job
run now, compared with before? Where could it break? `changemap` answers them from the code of
the two commits, so you decide how deep to go: the picture in two minutes, more in ten, the
exact lines only where you choose.

## What you see

<picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/ankitkpandey1/changemap/main/docs/screenshot-dark.png">
  <img alt="changemap on a real pull request: one part opened at step 1, with heavy arrows to the five functions it calls next and the code beside it, each call linked to its step" src="https://raw.githubusercontent.com/ankitkpandey1/changemap/main/docs/screenshot.png">
</picture>

- **Parts first.** When the change has parts, the page opens on them and the flows through
  them. "By folder" switches to the code's own layout.
- **Reading order.** Each function shows the calls it makes next, in the order they run, with
  full names; calls in the code are links, and a flow is marked in the code it runs through.
  "Read this part top to bottom" walks a part in order.
- **A map you open in place.** Boxes are packages. Click one and it opens into its modules,
  a module into its functions and the calls between them. Neighbours keep their places.
- **Before, Now and What changed.** One layout for all three, so you see what appears and
  what goes. New is green, deleted red, changed amber. Each colour also has its word.
- **A diff for one function.** Click a function: its lines changed, with line numbers, plus
  tabs for Before, Now and the whole file. Click an arrow: the calls behind it.
- **How it runs.** Routes, background tasks, event listeners and commands are listed as ordered
  steps, before and now, side by side. Choose one and its path is numbered on the map.
- **Noise folded away.** Tests are left out. Functions where only comments changed are drawn
  grey and counted.
- **Flags.** Flag any box, arrow or flow and write a note. Copy the notes or download them as
  Markdown to give to the author or to an AI agent. They stay in your browser.
- **Side by side.** A function's diff shows in one column or side by side. Code that moved
  inside a function is tagged "moved to line N".
- **Keys.** `/` searches, `Esc` returns to the whole picture, `j` and `k` go to the next or
  previous changed function, `?` lists every key. Back and Forward work. Light and dark theme.

The flags export looks like this:

    # Review notes: <title>

    ## 1. <what you flagged>

    Where: `module · function`

    Your note.

## Plan before code

Ask your agent to plan first. `changemap --plan plan.json --open` draws the plan on today's
code before any code is written. Planned boxes are dashed, and the page says on screen that a
dashed line is a model's claim, not something computed.

![The plan view: a plan drawn on today's code, with accept, reject and ask on each item](https://raw.githubusercontent.com/ankitkpandey1/changemap/main/docs/plan.png)

- Accept, reject or ask a question on any box, function or arrow, with a note.
- Turn on "Edit the plan" to rename, add, delete or link boxes. Undo and Redo work.
- Press "Copy for the AI". The answers and your edits go back to the agent, which plans again.
- When the code exists, compare the plan with what was built:

      changemap --plan plan.json BASE HEAD

  Each planned item shows as built, not found in the code, and the code shows what was built
  but never planned. For a pull request on a server, give its address instead of BASE HEAD.

The plan file format is in [`SPEC.md`](https://github.com/ankitkpandey1/changemap/blob/main/SPEC.md)
section 9. This repository's own plan is
[`plan/plan.json`](https://github.com/ankitkpandey1/changemap/blob/main/plan/plan.json).

## Watch an agent work

    changemap --watch --open

serves the working tree against its branch point on `127.0.0.1` and opens the page. As files
change (uncommitted and untracked files included), the page redraws itself and marks what just
changed. Pass a commit to compare against it: `changemap --watch BASE`. `--port N` picks the
port. Stop it with Ctrl-C.

![The watch view: the page shows Live, a file just changed, and the function that changed](https://raw.githubusercontent.com/ankitkpandey1/changemap/main/docs/watch.png)

## Languages

One map for a repository that mixes languages. Python is read with the standard library; the
others with [tree-sitter](https://tree-sitter.github.io/) grammars that install as ordinary
wheels.

| Language | Files | Reads | Entry points it finds |
|---|---|---|---|
| Python | `.py` | functions, methods, imports (star imports too), constants, types from annotations and `x = Class()` | HTTP route decorators with a path (FastAPI, Flask, Litestar style), `task` and `shared_task`, `listener("name")` event handlers, `emit` calls |
| TypeScript, JavaScript | `.ts .tsx .mts .cts .js .jsx .mjs .cjs` | functions, arrow functions, classes and constructors, React components, ES and CommonJS imports, `export *`, `this` calls | Express, Fastify, Hono and Koa style routes (handlers in other files too), NestJS decorators (routes, `@OnEvent`, `@Cron`), Next.js `app/**/route.ts` and `pages/api` files, event handlers, `cron.schedule`, `new Worker` |
| Java | `.java` | classes, interfaces, enums, records, overloads, fields, constructors, parent classes and interfaces, classes of the same package | Spring and JAX-RS routes, `@EventListener`, Kafka, Rabbit and JMS listeners, `@Scheduled`, `@Async`, `main` |
| Rust | `.rs` | functions, `impl` and trait methods, inline modules, `use` paths and glob imports, `mod x;` | `.route(...)` registrations (handler in another file too), route attributes such as `#[get("/x")]`, `#[tauri::command]`, `main` |
| C, C++ | `.c .h .cc .cpp .cxx .hpp .hh .hxx .ipp .inl` | functions, classes, constructors and destructors, headers paired with sources, `#include` | `main`, `Get`/`Post` style route registrations, callbacks given to `signal`, `atexit` and threads |
| HTML templates | `.html .htm .jinja .jinja2 .njk` | pages, `{% block %}` and macros, `<template>`, inline `<script>` functions | forms, links, `hx-*` attributes and `fetch` calls that point at a route |

Tests, generated and vendored code are left out. Details and limits for each language are in
[`docs/languages.md`](https://github.com/ankitkpandey1/changemap/blob/main/docs/languages.md).
Files in other languages are ignored.

## How honest the map is

A tool that draws a call graph has to say what it could not see. Every call falls in one of
three groups, and the page shows all three totals:

- **Followed.** The reader traced the name to one definition.
- **Matched by name.** Only the method name matched. These arrows are drawn in a different
  line style and marked.
- **Not followed.** Calls through values it cannot type, library calls that may run your code,
  and the like. They are counted and, per function, listed.

On the public example above: 848 calls followed, 9 matched by name, 1 not followed. They count
the calls inside the functions the page draws; calls into libraries are not counted. The same
three numbers are in the data file (`reader`). A missing arrow is not proof that no call exists. Read
[`docs/how-it-works.md`](https://github.com/ankitkpandey1/changemap/blob/main/docs/how-it-works.md)
for how the map is computed and where it is blind.

## Use it from an agent

Paste this into Claude Code, Cursor, Copilot, Codex or any coding agent:

> Install the `changemap` tool with `uv tool install changemap` (if `uv` is missing, use
> `pipx install changemap`). Check it with `changemap doctor`. Then install its skill: copy
> the folder `skills/changemap` from https://github.com/ankitkpandey1/changemap into your
> skills directory (in Claude Code: `/plugin marketplace add ankitkpandey1/changemap`, then
> `/plugin install changemap@changemap`). Then read the skill and use it when I ask what a
> pull request does. To remove everything later: `uv tool uninstall changemap` and delete the
> skill folder.

- **Claude Code.** `/plugin marketplace add ankitkpandey1/changemap`, then
  `/plugin install changemap@changemap`. The plugin adds the skill; install the command first.
- **Any other agent that reads Agent Skills.** Copy `skills/changemap` into its skills
  directory.
- **The data file.** `changemap --json data.json` writes what the page is drawn from. An agent
  can answer "what changed" and "what runs now" from it without reading the diff, which saves
  its tokens. The shape is in
  [`skills/changemap/references/data-file.md`](https://github.com/ankitkpandey1/changemap/blob/main/skills/changemap/references/data-file.md).
- **The outline and the flows file.** `changemap --outline -` prints a short outline (at most
  about 60 KB, no code) of the change as flows an agent can read. The agent can name the parts
  in a flows file; `changemap --flows FILE` checks it against the code and draws it first (marked as
  written by the agent). See
  [`flows-file.md`](https://github.com/ankitkpandey1/changemap/blob/main/skills/changemap/references/flows-file.md).

The skill never gives a verdict. It writes a model summary only when you ask, from the data
file, and labels it as written by a model.

## How it compares

- [CG-Diff](https://arxiv.org/abs/2609.32057) (research paper, 2026): organises pull request
  review around call-graph subgraphs and tests it in a web interface. changemap is a tool you
  can run, with a page and flows.
- calldiff (an npm package): a call-tree diff between git refs, built on tree-sitter, with
  terminal, JSON, YAML or Markdown output. It writes no page.
- [CodeBoarding](https://github.com/CodeBoarding/CodeBoarding): architecture diagrams of a
  whole project, with a model naming and describing the parts. It also has a pull request
  review that groups changes by component. changemap maps one change and uses no model.
- [Diffcore](https://github.com/jamesaphoenix/diff-core): groups changed files into flows,
  with an optional model step, and shows them in a desktop app or editor extension. changemap
  draws before and now on a call map, in one offline page.
- [Greptile](https://www.greptile.com): a model-based review service whose reviews can include
  generated diagrams. It runs in the cloud or on your own servers. changemap runs on your
  machine and uses no model.
- [difftastic](https://difftastic.wilfred.me.uk) and
  [SemanticDiff](https://semanticdiff.com): structural diffs of code. They show lines and
  syntax; changemap shows how the parts connect. Use them together.

## FAQ

**Does my code leave my machine?** No. The command has no telemetry and sends your code
nowhere. On a local repository it makes no network request at all. It talks to the network only
when you ask: `changemap URL` and `--remote` fetch from the git server you name (and, for a
pull request link, ask that site's web API once or twice for the title and the base, through
`gh` if it is installed), `changemap pr` fetches from `origin` (through `gh` if installed), and
feedback uses `gh`. The page makes no network request. Flags live in your
browser's local storage.

**Does it use an LLM?** No. Words on the page are short sentences computed from the code. Run
twice on the same two commits with the same changemap version, it wrote the same page and the
same data file, byte for byte (checked with and without the cache).

**Will it tell me the pull request is good or safe?** No. It shows. It gives no verdict, finds
no bugs and makes no style comments. It says plainly what it could not follow.

**Does it work on a big repository?** It reads both commits straight from git objects and never
checks anything out. Every source file in the two commits is read, so the map can follow calls
into code the change did not touch. Each distinct file is parsed once and cached by its content
under your user cache folder, so a second run on nearby commits parses only what changed.
`--no-cache` turns that off. A file that cannot be read (too large, minified, generated or
broken) is skipped, counted, and the page says so.

**My language is not in the table.** Its files are ignored and the map shows the rest. A
language is one adapter file: see
[`CONTRIBUTING.md`](https://github.com/ankitkpandey1/changemap/blob/main/CONTRIBUTING.md).

**Does it change my repository?** No. It reads commits and writes one HTML file (and, if you
ask, one JSON file).

**How do I remove it?** `uv tool uninstall changemap` (or `pipx uninstall changemap`), and
delete the skill folder or run `claude plugin uninstall changemap@changemap`.

## Options

    changemap [BASE HEAD] [--out FILE] [--open] [--json FILE] [--outline FILE] [--flows FILE]
              [--repo DIR] [--remote URL] [--plan FILE] [--no-cache] [--watch] [--port N] [--version]
    changemap pr NUMBER       # uses gh; without it, reads origin
    changemap URL             # a pull request or compare link, or a merge request, with no clone
    changemap --remote URL BASE HEAD
    changemap --plan FILE [BASE HEAD | URL]
    changemap --watch [BASE]
    changemap doctor          # checks git, Python, the language packages, gh and the cache folder
    changemap feedback        # drafts an issue about changemap itself

`changemap --help` lists every option. Exit codes: 0 the page was written, 1 `doctor` found a
problem, 2 a plain error (the message says what to do) or a command typed wrong.

## Feedback

Problems with the tool (a wrong or missing arrow, a confusing screen, a crash, an idea) go to
[GitHub issues](https://github.com/ankitkpandey1/changemap/issues/new/choose).
`changemap feedback` drafts one. An agent drafts the issue, searches for duplicates, adds
`changemap doctor` output, leaves out your code, paths, names and URLs, shows you the whole
text, and files it only after you say yes. Security problems never go in a public issue: see
[`SECURITY.md`](https://github.com/ankitkpandey1/changemap/blob/main/SECURITY.md).

## Contributing

Read [`CONTRIBUTING.md`](https://github.com/ankitkpandey1/changemap/blob/main/CONTRIBUTING.md).
What the tool must do is in
[`REQUIREMENTS.md`](https://github.com/ankitkpandey1/changemap/blob/main/REQUIREMENTS.md) and
how it is built in
[`SPEC.md`](https://github.com/ankitkpandey1/changemap/blob/main/SPEC.md). Agents working on
this repository read
[`AGENTS.md`](https://github.com/ankitkpandey1/changemap/blob/main/AGENTS.md).

## Licence

Apache-2.0. See [`LICENSE`](https://github.com/ankitkpandey1/changemap/blob/main/LICENSE).
