跳到主要内容Skip to main content
← Tools

Aider Watch 模式Aider (Watch mode)

Aider-AI
编程 IDE 本地 开源 partial lifecycle: maintenance 核验Checked 2026-10-08

不是编辑器插件,是一种使用模式。

Aider 常驻 watch 你的文件,你在任意编辑器里加 AI 注释,它就响应。

Not an editor plugin but a usage mode — Aider stays resident and watches your files; add an AI comment in any editor and it responds.

适合与不适合When to use it, when not to

适合两类人,与本条目的 fit 维度一致。

  • 习惯在任意编辑器里工作,不愿切换到专门的 Agent 界面的人
  • 需要「加注释 → 自动响应」这种轻量交互的人

不适合要求严格审批的场景。

watch 模式默认会对某些操作询问,但仍会自动提交。

常驻进程下,它更容易产生未经确认的改动。

也不适合需要云端后台运行的场景,它依赖本机进程。

People who work in whatever editor they like and refuse to move to a dedicated agent interface. People who want lightweight interaction: add a comment, get a response.

Not a fit for scenarios requiring strict approval — the confirmation mechanism in watch mode was not verified this round, and a resident process makes unconfirmed changes more likely. Also not a fit for cloud background execution; it depends on a local process.

中文生态China availability 国产 / 国内可直接用 / 备案状态 · 快照domestic / direct access / CAC filing · snapshot 2026-10-20

出品属地Origin
国外出品foreign-made 国外主体(网信办公示名单未见对应备案主体)。foreign entity (no matching filing entity in the CAC registry).
国内使用Direct access
大陆可直连direct OK 官网 aider.chat 直连实测 200。aider.chat measured 200 direct.
备案状态CAC filing
未见于备案名单not in filing list:未见于网信办公示名单(2026-10-20 检索 13 批附件,https://www.cac.gov.cn/2024-04/02/c_1713729983803145.htm);该产品未面向大陆公众提供服务,备案不适用。not in the CAC public registry (13 batch attachments searched 2026-10-20, https://www.cac.gov.cn/2024-04/02/c_1713729983803145.htm); the product does not serve the mainland public, so filing does not apply.

备案信息以网信办《生成式人工智能服务已备案信息》公示名单为准(按批次滚动更新,本站只抄编号不解读);「大陆可直连」是本站从大陆网络直连实测的结果,不是厂商承诺。GitHub 类站点当日实测有波动,口径写在依据里。Filing status is quoted from the CAC public registry (updated batch by batch; this site copies the number and does not interpret it). "Direct access" is this site's own reachability measurement from a mainland network, not a vendor promise. GitHub-hosted sites fluctuated on the measurement day — the note says so.

固定坐标系Fixed coordinate system

8 个维度dimensions, 与同分区其他对象逐项可比each comparable item by item against others in the same section.

模型与开放条件Model & openness

与 CLI 形态同一套模型入口:支持云端与本地 LLM,可连接几乎任何模型。

README 当前推荐列表停留在上一代模型 (Claude 3.7 Sonnet / DeepSeek R1 / OpenAI o1 等)。

该 README 的状态与该项目的 release 状态一致。

这个项目 13 个月未发 release。

所以参考这份列表时要自行核对。

运行位置Where it runs

它不是编辑器插件,而是一种使用模式。

Aider 在后台 watch 你的文件。

你在任意 IDE 或文本编辑器里加 AI 注释,它就响应。

官方文档标题即为「Aider in your IDE」。

但实现上跑的是 Aider 自己的浏览器 UI。

这与 Cline / Codex 的「编辑器扩展」是不同的形态。

本地文件Local files

watch 模式监听 git 仓库内所有文件的变化并响应 AI 注释。

官方原文:"watch all files in your repo"

(出自官方 docs/usage/watch.html 的 --watch-files。)

范围受 .gitignore / .aiderignore 约束。

  • --aiderignore 指定忽略文件,默认 git 根目录的 .aiderignore
  • --subtree-only 只考虑当前子树

仓库须是 git 仓库。官方 docs/git.html 写:无 git 时会先问你是否新建。

核心的 Repo Map 能力与 CLI 形态完全相同——同一项目的同一机制, 官方文档见 docs/repomap.md。

它用「一份简洁的整个 git 仓库的地图」提供上下文。

这份地图含最重要的类与函数及其类型与调用签名。

每次改动请求都随附该 map。

它的第二个作用在 watch 模式下尤其有用: 帮助写新代码时复用代码库里已有的库、模块与抽象。

支持 100+ 编程语言。

map 的 token 预算由 --map-tokens 控制。

刷新频率由 --map-refresh 控制,取值为 auto/always/files/manual。

大仓库的实际耗时与 token 开销,官方未给数字,本站未实测。

关机后的任务Tasks after shutdown

需要 Aider 进程常驻才能响应注释——这与「后台云端任务」不是一回事。

进程关闭后 watch 即失效。

也不存在客户端关闭后继续运行的云端形态。

工具与扩展Tools & extensions

两大核心能力是文件编辑与 Git 自动提交,与 CLI 形态是同一机制。

可配置 lint / 测试命令自动运行。

官方文档见 docs/usage/lint-test.html。

  • --lint-cmd / --auto-lint:默认对编辑过的文件跑 lint
  • --test-cmd / --auto-test
  • /run:跑 shell 命令
  • /web:抓网页转 markdown
  • /paste:贴图

watch 模式下,可从编辑器直接拖文件到智能体面板,或把编辑器选区发送到对话。

在文件里加 # AI 注释,即可把该文件加入 chat。

无内置 MCP 支持——官方选项表与文档站导航都没有任何 MCP 条目 (已查 config/options.html 与 docs 目录)。

所以不能接 MCP server。

上下文与记忆Context & memory

Repo Map 提供全库结构视图,每次请求随附,见 local_files。

上下文超限用「摘要压缩」而非简单截断。

官方选项 --max-chat-history-tokens 的描述是:

官方原文:"Soft limit on tokens for chat history, after which summarization begins"

也就是说,超过软上限即开始摘要;摘要由 --weak-model 生成。

--map-tokens 控 repo map 的 token 预算。

每个模型的上下文窗口与费用,由 --model-metadata-file 提供。

会话内可用 /tokens 查看用量。

腾空间还有 /drop、/clear、/reset。

默认不跨启动恢复(--restore-chat-history 默认 False)。

chat 历史默认写 .aider.chat.history.md。

权限与限制Permissions & limits

默认自动提交。

官方 --auto-commits 默认 True:每次编辑都用合理的 commit message 提交。

--dirty-commits 默认 True:会先把已有的未提交改动也提交, 让你的改动与 AI 的改动分开。

撤销路径是 git 本身(/undo)。

存在确认环节。

官方提供 --yes-always(别名 --yes)。

官方原文:"Always say yes to every confirmation"

含义是:默认会对某些操作询问,加此开关才全自动。

--dry-run 可不改文件地预演。

提交时默认跳过 pre-commit hook(--git-commit-verify 默认 False,即用 --no-verify)。

无沙箱机制(官方选项表无任何沙箱项)。

watch 模式复用同一 coder。

官方 watch 页写它用 /undo 撤销、用 /tokens 管上下文。

所以上述自动提交与确认机制同样适用。

常驻进程 + 自动提交 + 需显式开关才不询问,三者叠加风险高。

适合什么任务Best for

适合两类人:

  • 习惯在任意编辑器里工作,不愿切换到专门的 Agent 界面的人
  • 需要「加注释 → 自动响应」这种轻量交互的人

头号误解Top misconception

  • 以为它是编辑器插件,实际是 Aider 常驻进程 + 浏览器 UIAssuming it is an editor plugin — it is a resident Aider process plus a browser UI
  • 把 watch 模式当成云端后台任务,它需要本机进程一直运行Treating watch mode as a cloud background job — it needs a local process running the whole time
  • 没意识到自动提交在 watch 模式下同样生效,常驻进程下风险更高Not realising auto-commit applies in watch mode too, which makes it riskier under a resident process

未知项清单Known unknowns

  • 大仓库 Repo Map 的实际耗时与 token 开销(官方未给数字,待实测)
  • --yes-always 默认会就哪些具体操作询问(官方未逐项列举)

证据来源Evidence sources

判断可回到以下一手源复核。本站核验日Every judgement can be rechecked against the primary sources below. Verified on 2026-10-08,内容更新日content updated on 2026-10-08。

类型Type名称Name链接Link
docsAider · Watch 模式官方文档(Aider in your IDE)https://aider.chat/docs/usage/watch.html
repoAider · 仓库https://github.com/Aider-AI/aider
changelogAider · Releases(最新 v0.86.0 @ 2025-08-09)https://github.com/Aider-AI/aider/releases
docsAider · 选项参考(--aiderignore/--auto-commits/--yes-always/--map-tokens/--max-chat-history-tokens)https://aider.chat/docs/config/options.html
docsAider · Git 集成(自动提交、dirty 提交、/undo、默认跳过 pre-commit hook)https://aider.chat/docs/git.html
docsAider · Linting and testing(--lint-cmd/--test-cmd/--auto-lint/--auto-test)https://aider.chat/docs/usage/lint-test.html
docsAider · Scripting(--yes/--auto-commits/--dry-run 官方帮助文本)https://aider.chat/docs/scripting.html

实测记录Measured runs

本站尚未完成实测。测试协议见 tasks/_protocol.md。

实测建议:这个工具的实测重点应是 「常驻进程 + 自动提交」的风险是否可控。

建议在一个测试仓库里跑,观察产生了多少次未经确认的提交。

它在 IDE 形态里的位置

IDE 形态到目前为止有四种,本条目是第四种:

形态代表实质
独立编辑器Zed自带完整编辑器
原生桌面应用Cline Desktop不依附编辑器
编辑器扩展Codex IDE、Copilot、Cline 扩展装进已有编辑器
常驻 watch 模式Aider在编辑器外运行,监听文件变化

Aider 的特殊之处:它不进入编辑器,而是监听你在任意编辑器里的改动。

官方文档的措辞

官方文档的标题是「Aider in your IDE」。

英文原文:

`` Aider can watch your files and respond to AI comments you add in your favorite IDE or text editor. ``

注意最后半句:or text editor。

连纯文本编辑器都行,因为它监听的是文件变化,不是编辑器 API。

但界面仍是 Aider 自己的浏览器 UI,不是在编辑器内联显示。

与 CLI 形态的关系

CLIWatch 模式(本条目)
交互终端对话加 AI 注释
界面终端Aider 的浏览器 UI
进程随会话结束需常驻
Repo Map有有(同一能力)
自动提交有有(同一机制)
维护状态maintenancemaintenance(同一项目)

同一个项目,两种用法,不是两套实现。

关键风险:常驻 + 自动提交

本条目需要特别注意的组合有三个因素。

因素状态
进程常驻需要一直运行才能响应
自动提交AI 改动直接进 git 历史(--auto-commits 默认 True)
每次询问有确认开关 --yes-always(默认关)
默认会对某些操作询问

三者叠加,风险高于手动启动的 CLI 用法。

这三者是:常驻进程、默认自动提交、需显式 --dry-run 或关自动提交才可预演。

建议:第一次用 watch 模式时,在小仓库里试,并先确认 git 状态干净。

采集限制

Aider 的文档站在本次采集环境 curl 可达。

watch 模式的官方描述已确认。

A6.2(2026-10-08)本轮补齐:

  • watch 模式的文件范围与忽略规则
  • 自动提交与 --yes-always 确认机制
  • lint / 测试命令
  • 上下文摘要压缩(--max-chat-history-tokens)
  • 官方文档与选项表均无 MCP 条目这一结论

以上均已从官方源核实并写进 axes。

仍待实测:大仓库 Repo Map 的实际耗时与 token 开销(官方未给数字)。

相关条目Related entries

本页由This page is generated from the ai-agent-guide 数据层生成(CC BY 4.0)。data layer (CC BY 4.0). 方法论与坐标系定义见仓库内 METHODOLOGY.md。