See and undo what changed in your vault outside the editor.
You point a coding agent — Claude Code, Codex, Aider, a script, a sync job — at the folder your vault lives in. It writes twelve files. Obsidian shows you the result and nothing else: no list of what changed, no diff, no way back except file by file from memory.
Agent Diff watches for writes that did not come from your editor, groups them into sessions, and shows each one as a diff you can revert with one click — including changes made while Obsidian was closed.
- Separates your edits from everything else. A write that lands within a couple of seconds of you typing in that file is yours. Anything else is external and gets recorded.
- Groups changes into sessions. Writes closer together than the session gap (90 seconds by default) are shown as one run, with a file count and a diff per file.
- Catches what happened while the app was closed. On startup it compares the vault against its own index, so an agent run in a terminal at 2am is waiting for you in the panel at 9am.
- Reverts. Per file or per session. A file the agent created is moved to the trash, one it deleted is written back, one it edited is restored to the version before the run.
- Stays on your machine. Agent Diff makes no network requests of any kind, has no account, and holds no credentials. Old versions live in the plugin's own folder and are pruned on a schedule you set.
Not yet in the community directory.
With BRAT (the usual way to run a plugin that is not in the directory): install
Obsidian42 - BRAT from Community plugins, run BRAT: Add a beta plugin for testing, and
paste https://github.com/theseusbuilds/agent-diff. The repository is laid out the way BRAT reads —
manifest.json in the root, and each release carries main.js, manifest.json and styles.css
as assets — but I have no Obsidian install here, so I have not watched BRAT do it. The manual
route below is the one I can check from where I am.
By hand: download main.js, manifest.json and
styles.css from the latest release,
put them in <your vault>/.obsidian/plugins/agent-diff/, and enable the plugin in
Settings → Community plugins.
Open the panel from the ribbon (the clock-arrow icon) or the command Agent Diff: Open external changes panel.
| setting | default | what it changes |
|---|---|---|
| Editor grace period | 2500 ms | A write this soon after you typed in that file counts as yours. Obsidian's own autosave lands about two seconds after you stop, so shorter values file your own saves as agent activity. |
| Session gap | 90 s | Changes further apart than this are separate sessions. |
| Keep history for | 14 days | Older changes, and the file versions only they referenced, are deleted. |
| Largest file to keep a copy of | 256 KB | Bigger files are recorded as changed, without a diff or a revert. |
| Tracked extensions | md, canvas, txt, code and config types | Only text can be diffed. |
| Ignored prefixes | .obsidian/, .git/, .trash/ |
Never tracked. |
One copy of the current text of every tracked file, plus one copy of each previous version still inside the retention window. A vault of 2,000 notes averaging 3 KB is about 6 MB at rest. Settings → Agent Diff → Stored history size measures it, and Agent Diff: Prune stored history now collects it.
- Attribution is a heuristic, not a signature. Nothing in a file says who wrote it. Agent Diff infers it from timing: within the grace period of your own keystroke in that file, a write is treated as yours. An agent that writes to the exact file you are typing in, in the same breath, will be attributed to you.
- It cannot name the agent. It reports that something outside the editor wrote to the vault, not which program did.
- It is not a backup. Retention is measured in days and blobs are collected. Use version control or Obsidian Sync for the real thing.
- Binary and oversized files are recorded, not stored. You will see that a change happened and will not be able to diff or revert it.
- Two Obsidian windows on one vault share one history store. They cooperate, but a change one window makes is external as far as the other is concerned.
npm test runs two suites with no network and no Obsidian:
tests/run.mjs— the diff engine (including 300 randomised diffs asserting the edit script rebuilds both sides exactly) and the blob store (deduplication, retention, garbage collection, reload, corrupt-state recovery, and a regression for a prune that could delete a blob written while it was running).tests/plugin.mjs— the plugin class itself, driven against a fake of the Obsidian API intests/obsidian-fake.mjs: baseline indexing, your-edit-versus-agent-edit classification, create/modify/delete/revert, the startup pass that finds changes made while the app was closed, and session grouping.
Not tested, and I will not imply otherwise: anything that needs the real app. Whether
Obsidian's modify event fires for every kind of external write on every platform, how the panel
looks and behaves, and mobile. Those are checked in the app before this leaves early access.
Source-available. See LICENSE — use and modify freely for yourself; redistribution and resale need permission.