AI Diff Tracker

unlisted

by Ho Cheuk Hai Jason

Track AI-generated content, detect user edits, and highlight diffs with git-backed snapshots.

Updated 26d ago
View on GitHub

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

  1. AI writes a note with ai: true in frontmatter → plugin snapshots the body as a git blob, stores the hash in ai_blob
  2. You edit the note → plugin detects the change (~2s debounce) → flips ai: true to ai: false
  3. "Show AI Diff" → opens a modal with inline highlighting:
    • red = AI text you deleted
    • green = text you added

Commands

CommandWhat it does
Show AI vs Current DiffOpens diff modal for the active note
Restore AI OriginalReplaces 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

SettingDefaultDescription
Debounce2000msDelay before checking modifications
Show status barOnShows AI status in the status bar
Hide internal fieldsOnHides ai_blob from metadata display

Installation

via BRAT

Github

Quick Guide

Manual

  1. Download main.js, manifest.json, and styles.css from the latest release
  2. Copy them to <vault>/.obsidian/plugins/ai-diff-tracker/
  3. 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.