AI Diff Tracker
unlistedby Ho Cheuk Hai Jason
Track AI-generated content, detect user edits, and highlight diffs with git-backed snapshots.
AI Diff Tracker
Obsidian plugin that tracks AI-generated content, detects user edits, and highlights word-level diffs — backed by git blobs.
The problem: You use an AI agent (Hermes, OpenClaw, Claude, etc.) to draft notes in your vault. Later you edit them — fixing inaccuracies, adding your own knowledge, personalizing. But weeks later, you can't remember which parts came from the AI (potentially hallucinated) and which parts you wrote yourself (trusted).
The solution: This plugin snapshots every AI-generated note. When you edit it, it auto-flags the note as modified. At any time, run "Show AI Diff" to see exactly which words are AI vs yours — red strikethrough for deleted AI text, green for your additions.
Requirements
- Git/Git plugin (best with auto commit, so the blob can be captured before you type)
AI agent prompt
For the plugin to work, your AI agent must include ai: true in the frontmatter when generating notes. Add this to your agent's system prompt or vault rules (AGENTS.md):
When you create or rewrite a note in this vault:
- Add `ai: true` to the frontmatter if the body was AI-generated
- Place it as the last field before the closing `---`
- Do NOT include `ai_blob` — the AI Diff Tracker plugin adds that automatically
Example:
---
...
ai: true
---
"Place it as the last field before the closing
---", can be ignored, it is just to make things looks better
How it works
- AI writes a note with
ai: truein frontmatter → plugin snapshots the body as a git blob, stores the hash inai_blob - You edit the note → plugin detects the change (~2s debounce) → flips
ai: truetoai: false - "Show AI Diff" → opens a modal with inline highlighting:
- red = AI text you deleted
- green = text you added
Commands
| Command | What it does |
|---|---|
| Show AI vs Current Diff | Opens diff modal for the active note |
| Restore AI Original | Replaces body with the git-stored AI original |
Frontmatter fields
ai: true # AI-generated, untouched (Obsidian renders as checked checkbox)
ai: false # User has edited (unchecked checkbox)
ai_blob: "abc123..." # Git blob hash (hidden from metadata display via CSS)
The ai_blob field is invisible in reading/live-preview mode.
Lifecycle
ai: true (no blob) → plugin snapshots → ai: true + ai_blob
you edit → plugin detects → ai: false (blob preserved)
AI regenerates → ai: true again → plugin re-snapshots
ai: true is authoritative — the plugin snapshots whenever it sees it.
Settings
| Setting | Default | Description |
|---|---|---|
| Debounce | 2000ms | Delay before checking modifications |
| Show status bar | On | Shows AI status in the status bar |
| Hide internal fields | On | Hides ai_blob from metadata display |
Installation
via BRAT
Manual
- Download
main.js,manifest.json, andstyles.cssfrom the latest release - Copy them to
<vault>/.obsidian/plugins/ai-diff-tracker/ - Enable the plugin in Settings → Community plugins
Build from source
git clone https://github.com/jasonho1308/obsidian-ai-diff-tracker.git
cd obsidian-ai-diff-tracker
npm install
npm run build
cp main.js manifest.json styles.css <vault>/.obsidian/plugins/ai-diff-tracker/
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.