Review Map
A local VS Code extension for reviewing a feature that arrives as a stack of pull requests, often written by an AI agent and often spread across several repositories. It gives you:
- An overview: why the feature exists, the stack as a Mermaid diagram with your progress, requirements mapped to steps, and your open questions.
- Steps at the code: pull request → group → step. Clicking a step opens the diff at exactly the lines it is about.
- What is not covered: every change in the diff that no step points to.
- AI findings only after you have read: findings appear once you tick the step, or when you ask for them with "Show Findings".
- Progress that survives interruptions: ticks, where you were, and your questions are saved in
review-state.json.
The extension only reads git and files. It sends nothing over the network and never writes to GitHub, Azure DevOps or any other service.
Install
From the Marketplace: search for Review Map, or
code --install-extension yonasvalentinmougaardkristensen.review-map
From source:
npm install
npm run package
code --install-extension review-map-0.1.0.vsix
Review Map runs git in the review worktrees, so it only starts in a trusted workspace (Workspace Trust), and only in worktrees that are folders of that workspace.
Map text is written by an AI, so on the step page and the overview, images and raw HTML show as plain text (the Markdown preview's own parser finds them). Comment threads and tooltips show images as text too.
Upgrading from an early build installed as local.review-map: run code --uninstall-extension local.review-map first.
The feature folder
One folder per feature, for example ~/Documents/.reviews/<id>/:
| File |
Written by |
Contents |
review-map.json |
whoever prepares the review (usually an agent) |
the map, see the schema below |
feature.code-workspace |
the same |
folders: the feature folder plus each pull request's worktree |
review-state.json |
the extension |
current, checked, revealed, notes |
overview.md |
the extension |
the overview, rewritten on every load |
Open it with code <folder>/feature.code-workspace once review-map.json exists. The extension starts when a workspace root contains review-map.json, and the folder has to be trusted (Workspace Trust).
Each pull request has its own worktree, checked out at the pull request's head (git worktree add --detach <path> <head>). base is git merge-base <head> <target>.
Schema
type Side = 'head' | 'base'
type Anchor = { path: string; side: Side; start?: number; end?: number; contains?: string; label?: string }
type Disposition = 'comment' | 'fixed-later' | 'decided' | 'rejected' | 'question'
type Confidence = 'high' | 'medium' | 'low'
type Finding = {
text: string; disposition: Disposition // text: the one-line verdict
promise?: string; actual?: string; likelihood?: string; fix?: string; evidence?: string[]; confidence?: Confidence
draft?: string; threadUrl?: string; fixedBy?: string; at?: { path: string; line: number }
}
type Step = { id: string; question: string; explain: string; why?: string; diagram?: string; anchors: Anchor[]; findings: Finding[] }
type Group = { intent: string; steps: Step[] }
type Pr = {
id: number; repo: string; url: string; title: string; worktree: string; base: string; head: string
parent: number | null; requires: { pr: number; why: string }[]; does: string[]; laterRemoved: string[]; groups: Group[]
}
type ReviewMap = { version: 1; title: string; ticket: string; why: string[]; criteria: { id: string; text: string; steps: string[] }[]; prs: Pr[] }
prs are in stack order, bottom first.
worktree is an absolute path; base and head are commit hashes (7–40 hex characters).
- Paths are relative to the repository and may not contain
...
- An anchor without
start/end covers the whole file. With start, it needs end ≥ start and contains.
- Use
side: 'base' for code the pull request deletes.
- A finding's
at is a line on the head side; without it, the step's first anchor is used.
Rules for whoever writes the map
- Step ids are stable. When the map is rewritten for a new iteration, a step keeps its id. Otherwise its tick is lost.
- A step's title is a question, never the answer. "Who may call this endpoint?", not "Missing access check".
contains is copied verbatim from the anchor's side: the file at head, or at base when side is "base" (a piece of one line inside the range). If it does not match, the step shows as ⚠ stale.
- Group by intent, riskiest first. Not alphabetically, and not forced layer by layer.
parent is the pull request whose source branch is this pull request's target branch. Use requires only when the ticket or a commit says this pull request depends on another one.
- End with a step of whole-file anchors for tests, configuration and generated files, so "Not covered" only lists what is really missing.
criteria point to the steps that show each requirement. A requirement without steps shows as "not verified".
Working with a coding agent
Review Map is built so an agent in a terminal (for example Claude Code or Codex) prepares the review and steers it, while the explanation stays in VS Code.
The agent moves VS Code. It writes agent.json in the feature folder:
{ "step": "checklist-task", "terminal": "term_0d74f4a0-75d9-4641-9a0e-54700659d99e", "at": "1764513600" }
Review Map opens that step: the diff at its lines in the first column and the step page beside it. It moves only when the file's text changes, so repeated file events never undo your own moves; at (any changing value, such as the time) lets the agent open the same step again. A step id that is not in the map is ignored. terminal is optional and must be an Orca terminal handle (term_<uuid>).
The agent reads where you are. review-state.json holds the current step, your ticks, revealed findings and your questions.
Your questions reach the agent. Ask a Question saves your question on the step. When agent.json named an Orca terminal, it is also sent there with orca orchestration send, which wakes the agent. Without Orca, the agent reads it from review-state.json on its next turn.
Writing for the reader
The step page is read by someone who did not write the code, often while switching between tasks. Every rule below comes from research on explaining code (see docs/research/).
- Why first.
why is the customer's or product owner's reason, in 1–3 lines.
- Summarise, do not narrate.
explain says what the code does in a few sentences, never line by line.
- Number the code. Give every anchor a short
label; it appears as ①, ② on the lines and on the page. Reuse the same numbers in the diagram.
- Diagram only when it maps to code.
diagram is a ```mermaid or ```text block for calls or states you can point to in the diff, with at most 12 nodes. No decorative diagrams.
- One finding, one card.
text is the verdict in one line: what the customer experiences. promise is what the PR or ticket says; actual is what the code does, and may be followed by a timeline block.
- Likelihood as a number.
likelihood = an estimate, its trigger and its source, e.g. ~3 in 10 seller cases, when days < 60 (UAT query 30/11).
- Show the fix on the code.
fix is a ```diff block on the lines the step points to.
- Back every claim.
evidence lists file:line, test or query references; confidence is always stated.
- Cut everything the verdict does not need.
Example
{
"version": 1,
"title": "Refer a friend",
"ticket": "https://example.test/ticket/42",
"why": ["Customers can recommend us to friends straight from the app."],
"criteria": [{ "id": "AC1", "text": "The task appears on the checklist", "steps": ["checklist-task"] }],
"prs": [
{
"id": 101, "repo": "app", "url": "https://example.test/pr/101", "title": "Referral entry points",
"worktree": "/Users/me/review/app-101", "base": "1a2b3c4", "head": "5d6e7f8",
"parent": null, "requires": [], "does": ["Adds the Refer a friend task"], "laterRemoved": [],
"groups": [
{
"intent": "The checklist",
"steps": [
{
"id": "checklist-task", "question": "When is the task done?", "explain": "When the customer has referred someone on this device.",
"anchors": [{ "path": "src/checklist.ts", "side": "head", "start": 218, "end": 230, "contains": "hasReferredFriend" }],
"findings": []
}
]
}
]
}
]
}
Keyboard
ctrl+alt+] next step, ctrl+alt+[ previous step.