@diffohq/diffo

中文文档
0.23.0发布于 2026/11/09Apache-2.0ES Module构建来源已验证近 30 天下载 2432

Local, live code review for the AI age — read what the agent wrote and send feedback straight back, or review a GitHub pull request with your agent beside you

原始使用文档
文档目录10 节
  1. Quick start
  2. Talk to the agent on the line
  3. Read it in layers
  4. Review a pull request
  5. Where it fits
  6. How it works
  7. Docs
  8. Open core
  9. Contributing
  10. License & trademark
Diffo: the human way to review agent-written code

Ask your agent for a review. You get the change in layers, in the order it should be read, and the agent on the other end of every comment: it answers on the line and fixes while you read. Hand it a pull request instead, and it reads beside you and sends your review to GitHub.

Quick start · The conversation · Layers · Pull requests · Docs · Contributing

CI npm License Docs

The Diffo loop. In the agent's terminal you type /diffo and the review opens beside it. You ask a question on line 14, and it flies to the agent; the agent fixes the code and answers, and the answer and the fix fly back, landing in the thread and in the diff you are reading.

The whole loop: type /diffo, ask on the line, and the answer and the fix come back into the diff you're reading.


Quick start

Requires Node >= 24 and git. Paste this into Claude Code, Cursor, Codex, or whichever agent you already use:

Run `npx skills add DiffoHQ/diffo --skill diffo -g` and open the diffo review

That's the whole install. From then on, one command in any session:

RunAnd the agent reviews
/diffowhat it just wrote, before anything is committed
/diffo maineverything since you branched off main
/diffo <PR link>a GitHub pull request, checked out in a worktree of its own; your review goes back to GitHub when you finish

Every time, the agent opens the review and hands you the URL. It all runs on your machine, and nothing needs to be committed or pushed first. A pull request needs the GitHub CLI signed in. Otherwise the only thing that leaves your machine is two small anonymous usage events per review, listed in full and off with diffo telemetry off.

New here? Your first review, end to end takes about five minutes.

Talk to the agent on the line

We write code with an LLM. We review it alone.

Writing became a conversation: you and the model in the same window, trading context until the thing is right. Reviewing never did. The code lands, the conversation ends, and you go read four hundred lines by yourself, in a viewer built for a world where whoever wrote it had already moved on.

Diffo keeps the conversation open through the review. The judgement stays yours. You just stop reading alone.

  • Ask on any line. The agent that wrote the code answers in the thread, with a diagram when the shape needs one. Mark a thread a Question and it explains; mark it a Change and it edits, so a question never turns into an unrequested refactor.
  • Fixes land in the diff you're reading. The diff updates under your cursor, and a hunk you had already read says changed since you read it, so the second pass stays honest.
  • A map, not a verdict. On a multi-file or subtle change the agent opens the review with one orienting comment on what the change does. It never pre-reviews: no verdicts, nothing is "fine". That judgement is the part it doesn't get to make.

Read it in layers

A diff arrives alphabetically, which is almost never the order to read it in. Ask, and the agent posts layers: the change as ordered steps, each with a title, a summary, and its files. You read one layer at a time, in the order the agent would explain it; ] steps to the next. Anything the agent touches after posting gathers in a Since your review layer, so nothing hides outside the plan.

Layers in Diffo. The header chip reads agent · suggests layers and the reviewer accepts. The request crosses to the agent's terminal, which outlines the 13-file change as four ordered steps and posts them with diffo layers. Four layers land in the rail; the first layer's card draws its diagram, its files are read and ticked, and ] steps to the second and third layers.

Thirteen files, alphabetical, become four steps to read in order.

Review a pull request

When a pull request lands on your desk, give your agent the link. It checks the PR out in a worktree of its own, so your checkout is never touched, and opens it as the same review: the description and the GitHub threads come with it, and the agent reads beside you as a copilot for code it did not write. Every comment has two tabs. Comment on PR goes to the author, as one review when you finish. Ask agent stays on your machine: the agent can run the tests and answer with evidence, and it never posts to GitHub.

A pull request in Diffo: you hand the PR link to your agent and it is checked out in a worktree of its own; a Private question on line 13 crosses to your agent, which runs the tests and answers in the thread; a PR comment waits as a draft until Submit review, and then the review crosses to GitHub, while the private thread stays on your machine.

Two destinations: a Private question goes to your agent and never leaves your machine; a PR comment waits as a draft and goes to GitHub when you submit.

Where it fits

Diffo isn't an AI reviewer. It doesn't grade your diff or leave generated nitpicks: you read, and the agent is there to answer, explain, and fix.

DiffoAI reviewer botPlain pull request review
Who reads the codeyoua modelyou
Who answers your questionsthe agent, in the thread, nownobodythe author, when they get to it
Whenwhile the agent writes, or when the PR landsafter you pushafter you push
What comes outfixes in the diff, or a review on GitHuba list of commentsa review on GitHub

How it works

Diffo's architecture: your agent writes the code and opens the review; a local Diffo server watches the changeset and serves it to your browser; your comments and Finish review return to the agent through diffo poll, and its answers and fixes land back in the review live.

One process on your machine, bound to loopback: no account, no cloud, and no model API. The one thing it reports is anonymous usage data, two events per review, never code or paths, off with one command. Diffo spawns no agents of its own; the one you're already talking to stays attached through the diffo CLI, so your comments land in the session that holds the context. The viewer itself is a real diff viewer, unified and split, keyboard-first, with GitHub's conventions. The CLI, the flags, and everything under the hood are in the docs.

Docs

Your first reviewThe whole loop end to end, about five minutes
Getting startedInstall, and where each agent gets wired
The review loopReading, commenting, and what the agent receives
LayersThe agent's reading plan: ordered steps, one at a time
Reviewing a pull requestA GitHub PR in a worktree, your agent beside you, your review back on GitHub
How it worksThe components and the server lifecycle
The agent sideThe agent protocol: every command, every payload
ArchitectureDiff pipeline, delivery queue, SQLite state
CLI and Keyboard shortcutsReference
FAQThe short answers

Open core

Everything in this repository is the core, and the core stays Apache-2.0: local review, the agent loop, pull request review, the CLI, the Agent Skill. It works offline, for one reviewer, forever, for free. A hosted team tier is planned, and none of it will take an existing core feature behind a paywall: anything that runs on your machine for one reviewer is core.

Contributing

Diffo is pre-1.0: this repo is reviewed with it daily, and the edges are still moving. pnpm check runs the five gates CI runs. One hard rule: skills/diffo/SKILL.md is generated from src/skill.ts; edit the source and run pnpm build:skill. CONTRIBUTING.md has the rest, with a Code of Conduct, the CHANGELOG, and the CLA a bot asks first-time contributors to sign, in one reply.

Found a security problem? Please don't open a public issue. The Security Policy says where to send it and what's in scope.

Contributors

License & trademark

Diffo is open source under the Apache License 2.0, the whole of it, today. A Diffo Enterprise License exists but currently covers no files at all; it is written down so the open-core boundary is settled before it is needed, and it carries the commitment that nothing Apache-2.0 in a released version moves out of it later.

The Diffo name and logo are trademarks of Diffo: the license covers the code, not the name. Forks are welcome; ship them under your own name.

版本与发布记录

@diffohq/diffo 共发布 32 个版本,首次发布于 2026/08/25;过去 12 个月发布了 32 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.23.0latest2026/11/093 天前
0.22.02026/11/085 天前
0.21.02026/11/076 天前
0.20.02026/11/039 天前
0.19.02026/11/0310 天前
0.18.22026/10/2915 天前

关于 @diffohq/diffo 的常见问题

@diffohq/diffo 是什么?

Local, live code review for the AI age — read what the agent wrote and send feedback straight back, or review a GitHub pull request with your agent beside you

如何安装 @diffohq/diffo?

在项目目录运行 npm install @diffohq/diffo,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 diffo,可以用 npx diffo 直接运行。

@diffohq/diffo 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/diffohq__diffo 是否存在。

@diffohq/diffo 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@diffohq/diffo 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=24。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@diffohq/diffo 可以商用吗?

@diffohq/diffo 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@diffohq/diffo 的下载量有多少?

根据 npm 官方下载统计,@diffohq/diffo 在 2026/10/12 – 2026/11/10 这 30 天内被下载 2,432 次,日均约 81 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@diffohq/diffo 还在维护吗?

最新版本 0.23.0 发布于 2026/11/09(3 天前);至今共发布 32 个版本,其中过去 12 个月发布了 32 个;首次发布于 2026/08/25。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。