docs: document context diff command in README, getting-started, and history docs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Luca Oelfke 2026-02-11 14:44:21 +01:00
parent 563ea7accb
commit d39b0e621d
3 changed files with 36 additions and 0 deletions

View file

@ -27,6 +27,7 @@ When working with AI assistants on your Obsidian vault, you constantly re-explai
- **Prompt templates** with placeholders and conditionals for reusable workflows
- **Additional context sources** from freetext, external files, or shell commands
- **Frontmatter presets** to configure context per-note via `ai-context` YAML
- **Context diff** to copy only new and modified files since the last export
- **Context snapshots** for saving and replaying context recipes
- **Granular section selection** to include only the headings you need
- **Context history** with diff, search, and one-click restore

View file

@ -77,6 +77,7 @@ The context is now in your clipboard. Paste it into Claude, ChatGPT, or any AI a
| **Copy context (select sections)** | Choose specific headings |
| **Copy context from frontmatter preset** | Use note's ai-context config |
| **Copy smart context** | Auto-detect related notes via links, tags, and properties |
| **Copy context diff** | Copy only files changed since last export |
| **Export context (multi-target)** | One-click export using the active export profile |
| **Generate context files** | Open the generator |
| **View context history** | Browse past contexts |

View file

@ -29,6 +29,40 @@ Ctrl+P > "Promptfire: View context history"
Browse, search, compare, and restore any previous context.
## Context Diff
In iterative LLM workflows you don't want to paste the full vault context every time — only the files that changed. The context diff command compares per-file content hashes against the most recent export and copies only the delta.
### Usage
```
Ctrl+P > "Promptfire: Copy context diff (changes since last export)"
```
### How It Works
1. Every normal export stores a content hash per file in the history entry
2. The diff command finds the most recent history entry with hashes (the "baseline")
3. Current files are hashed and compared against the baseline
4. Only new and modified files are copied, tagged with `[NEW]` or `[MODIFIED]` in the file header
5. The diff entry stores all current hashes, so it becomes the next baseline — enabling chained iterative diffs
Sources (freetext, file, shell) are always included fully since they're external.
### Requirements
- History must be enabled (Settings > History > Enabled)
- At least one prior export with file hashes must exist (any normal copy after the update)
### Edge Cases
| Scenario | Behavior |
|----------|----------|
| No baseline exists | Notice: "Run a normal context copy first" |
| No changes detected | Notice: "No changes since last export" |
| File renamed | Shows as new file + removed file |
| File deleted | Listed in removed count in the notice |
## Snapshots
Snapshots save a context "recipe" — the exact combination of notes, settings, and template — so you can replay it later.