CLI Reference
contxt diff
Show what changed in your project memory since the last session — new entries, updated entries, and ones that have gone stale.
Usage
$contxt diff
Example output
Context diff — my-app (since 2h ago) + [decision] Switch to Edge runtime for API routes + [pattern] Optimistic UI update pattern ~ [decision] Use Prisma for ORM (v3 → v4) ~ [pattern] API Error Handler (v2 → v3) ? [decision] Use Redux for state (stale · 45d ago) ? [document] Onboarding guide (stale · 38d ago) 2 new · 2 updated · 2 stale
Flags
| Flag | Default | Description |
|---|---|---|
| --since <timestamp> | last session end | ISO 8601 timestamp to compare against. Overrides auto-detection from session history. |
| --days <n> | 30 | Number of days before which an entry is considered stale |
| --json | false | Output diff as JSON with newEntries, updatedEntries, staleEntries arrays |
How the baseline is determined
By default, contxt diff looks up the most recent session with an endedAt timestamp and uses that as the “since” point. If no session end is found, it falls back to 30 days ago.
The three categories are:
- New — entries created after the baseline timestamp
- Updated — entries created before the baseline but modified after (version > 1)
- Stale — active entries not updated in the last 30 days (configurable via
--days)
# Diff since a specific point in time$contxt diff --since 2024-01-15T09:00:00Z# Machine-readable output for CI$contxt diff --json | jq .newEntries
MCP tool
The same diff is available via the contxt_diff MCP tool. Your AI automatically calls it when asked “what changed since my last session?” or when project health is mentioned in the CLAUDE.md / Gemini instructions.
The web dashboard at /dashboard/diff shows the same information across all your synced projects.