Skip to content

Agent feedback loop

Get your review comments into a coding agent and review what it changes in response. Agents with MCP support drive the whole loop through zyndiff’s local MCP server. Any other agent that can run a shell command uses zyndiff --wait. Both need the zyndiff command on your PATH (see Installation).

Terminal window
zyndiff setup

zyndiff setup detects the coding agents you have installed: an agent counts when its binary is on PATH or its config directory exists. It then shows a checkbox list with detected agents listed first and pre-checked (↑↓ move, space select, a all, enter confirm).

It prints every command it will run and every file it will touch, asks Proceed? [y/N], then applies. Running it again is safe, and agents that are already set up report unchanged.

Restart the agent or start a new session afterwards.

agent id what setup does
Claude Code claude installs the zyndiff-review plugin (skill + MCP server)
Codex codex installs the zyndiff-review plugin (skill + MCP server)
Cursor cursor adds a zyndiff MCP server to ~/.cursor/mcp.json
Gemini CLI gemini adds it to ~/.gemini/settings.json
VS Code vscode adds it to the user mcp.json
Windsurf windsurf adds it to ~/.codeium/windsurf/mcp_config.json
OpenCode opencode adds it to ~/.config/opencode/opencode.json (or opencode.jsonc if that exists)
Zed zed adds it to Zed’s settings.json
GitHub Copilot CLI copilot adds it to ~/.copilot/mcp-config.json

For Cursor, Gemini CLI, VS Code, Windsurf, OpenCode, Zed and Copilot CLI, the entry runs zyndiff mcp serve by the absolute path of your installed binary, so an agent launched from a GUI finds it without your shell’s PATH. The Claude Code and Codex plugins run zyndiff from PATH. Every other setting in the file is kept. If a config file isn’t plain JSON (comments are common in Zed and VS Code), setup never rewrites it and prints the snippet to paste by hand instead.

To skip the prompts, pass --agents claude,codex to pick agents and --yes to skip the confirmation. Without a terminal and without --agents, setup exits 1 and prints the agents it detected and the valid ids. zyndiff setup --remove undoes it and pre-checks every agent zyndiff is currently set up in.

Terminal window
claude plugin marketplace add praneethilluru/zyndiff
claude plugin install zyndiff-review@zyndiff-local --scope user

Then start a new Claude Code session, or run /reload-plugins.

  1. Ask the agent for a review:

    Review my current changes with zyndiff.

    The agent calls start_review with the repository path and ref working (tracked and untracked changes). zyndiff opens the review in your browser. The agent’s MCP server only accepts a cwd inside its approved root, which is the directory the agent launched it from unless ZYNDIFF_ROOT says otherwise.

  2. Comment on the lines you want changed, then click Review in the top bar and Return Feedback. Return Feedback needs at least one unresolved comment or a summary.

  3. Go back to the agent and say continue. By default the review’s policy is required, so the zyndiff-review skill tells the agent to stop and wait for you after start_review.

  4. The agent calls get_review, applies each comment, replies to it with reply_to_comment, marks it with mark_comment_addressed, and calls request_rereview.

  5. Within a few seconds a notice appears at the top of the review, for example Agent activity: 2 replies, 2 addressed, rereview requested — “Removed the debug log and capped the backoff”. Click Refresh diff to load the agent’s changes.

  6. Files the agent touched since your feedback show a Changed since last review chip. Click Show only changes since last review on a file to see just the agent’s fix instead of the whole change again.

    A file header with the Changed since last review chip and the Show only changes since last review toggle switched on, showing a two-line interdiff

  7. Resolve the comments that are fixed, reply in a thread to the ones that aren’t, then Approve or return more feedback. Asking the agent for more after you approve reopens the same review.

Each Return Feedback records a round: zyndiff stores the blob hash of every file’s new-side content. A file counts as changed when its content no longer matches that hash, so the chip and the interdiff always compare against the code as it was the last time you sent feedback.

The review menu also shows the agent’s latest request_rereview summary as markdown under Agent update. For a long one, click the expand icon in the corner to read it in a wide dialog. Your draft summary carries over.

A comment has three states, and the agent can only reach one of them.

status who sets it what you see in the next prompt?
open you, by writing or reopening it a normal comment card yes
addressed the agent, with mark_comment_addressed an Addressed chip on the card yes
resolved you, with the Resolve button (Reopen undoes it) a Resolved chip and muted text no

Addressed means the agent says it made the change. It stays unresolved until you check the code and resolve it, so it still counts toward the unresolved badge, and Approve asks There are 2 unresolved comments. Approve anyway?. The agent can’t resolve, reopen or approve. An agent that tries to mark a resolved comment gets resolved comments must be reopened by the reviewer.

Over MCP, get_review returns the Review Record: status, your summary, and every comment with its file, side, line range, tag, status and reply thread. When comments contain suggested changes, it adds a suggestions list so the agent can apply them without parsing comment text. This is the suggestions part of a real response, with the review object left out:

{
"suggestions": [
{
"commentId": "c3",
"path": "src/retry.ts",
"side": "new",
"startLine": 8,
"endLine": 8,
"original": [
" await sleep(100 * 2 ** attempt);"
],
"suggested": [
" await sleep(Math.min(100 * 2 ** attempt, 1000));"
]
}
]
}

An empty suggested array means delete the original lines. When some suggestion can’t be listed, suggestionsError explains why.

zyndiff --wait, the feedback preview (P) and Copy Markdown in the review menu get the compiled markdown prompt instead. This one comes from a review with a summary, a question that has a reply thread, a nit that suggests deleting a line, and an issue that suggests a replacement:

## Code Review — working tree — 2026-10-29
---
## Reviewer summary
Retry logic looks right. Two small fixes before merge.
---
### src/retry.ts — Line 2
```
1 | export async function withRetry<T>(fn: () => Promise<T>): Promise<T> {
> 2 | + const maxAttempts = 5;
3 | for (let attempt = 0; attempt < maxAttempts; attempt++) {
4 | try {
```
**[question]** Make this a parameter with a default so callers can tune it.
- agent: I'll make it an optional second argument with default 5.
- reviewer: Good, keep the default.
---
### src/retry.ts — Line 7
```
5 | return await fn();
6 | } catch (err) {
> 7 | + console.log("retrying", err);
8 | await sleep(100 * 2 ** attempt);
9 | }
```
**[nit]** Debug logging left in.
Suggested change to src/retry.ts, line 7:
ORIGINAL
```
console.log("retrying", err);
```
SUGGESTED (delete these lines)
```
```
---
### src/retry.ts — Line 8
```
6 | } catch (err) {
7 | console.log("retrying", err);
> 8 | + await sleep(100 * 2 ** attempt);
9 | }
10 | }
```
**[issue]** Cap the backoff so attempt 5 doesn't sleep for 1.6s.
Suggested change to src/retry.ts, line 8:
ORIGINAL
```
await sleep(100 * 2 ** attempt);
```
SUGGESTED
```
await sleep(Math.min(100 * 2 ** attempt, 1000));
```
---
## Summary: 3 comment(s) across 1 file(s)

Lines marked > are the ones you commented on, with two lines of context either side. Removed lines get an Old line header instead of Line. File-level comments get a File-level header and no code block. Resolved comments and comments whose lines left the diff are not in the prompt.

Any agent that can run a shell command can ask for a review. zyndiff --wait opens the review in your browser, blocks until you send feedback, approve or cancel, then prints the compiled prompt on stdout and exits.

Terminal window
zyndiff --wait > feedback.md

Status lines go to stderr, so stdout carries only the prompt:

[zyndiff] v0.32.1 — reviewing working tree (1 file changed)
http://127.0.0.1:47123/?review=8e27d1e1-43ea-419f-8235-1378e5e6606b (ctrl+c to stop)
[zyndiff] waiting for feedback on review 8e27d1e1-43ea-419f-8235-1378e5e6606b (ctrl+c to stop)
[zyndiff] review sent back with feedback

Pass a ref the same way you would without --wait, for example zyndiff --wait main or zyndiff --wait staged. Add --no-open to skip launching the browser and open the printed URL yourself.

If the agent runs the command itself, its shell tool has to allow a command that blocks for as long as you take to review. A tool that kills commands after a timeout ends the wait early. The review record survives, so you can still finish it with zyndiff --review-id <id>.

Exit 0 with a prompt on stdout means feedback, exit 0 with empty stdout means approved, and exit 2 means cancelled. Closing the last tab without sending anything exits 3 and leaves the review open. Every code is in the CLI reference.

Terminal window
zyndiff --wait --json > review.json

stdout is then the same structure get_review returns. Read review.status to tell feedback_ready, approved and cancelled apart.

--wait is one round. It can’t receive replies, addressed marks or a rereview request, so the changes-since-last-review view only works over MCP. Each new zyndiff --wait starts a fresh review.

zyndiff hook stop opens a review of the working tree when an agent finishes a turn. It’s experimental: no integration ships it, and zyndiff setup doesn’t wire it. What it does and prints is in the CLI reference.

After zyndiff update, idle MCP servers are stopped so agents relaunch them on the new version. In Claude Code, reconnect with /mcp or start a new session. zyndiff mcp restart does the same stop by hand and refuses while a review session is live.

The server can also be run directly, which is what the agent config does:

Terminal window
zyndiff mcp serve

Every tool and its parameters are in MCP tools.