Review local changes before moving on. Quick Start · Features · Docs · Releases Code Diff TrackerCode Diff Tracker is a VS Code extension that records local workspace file changes. Supported text can be reviewed and safely kept or reverted; non-text resources have file-level visibility and, when their identity can be verified, an Acknowledge action. Review views include:
Review changes as they happen, then keep or safely revert them by block, file, or batch. Pending reviews can survive VS Code restarts, stale review actions are rejected, and Git-context changes are guarded before write operations continue. For version-specific changes, see the release notes. This repository is the
Screenshots
Features
Usage
When stopped, opening Side-by-Side Diff uses a read-only Review Snapshot. Already-open Live File diffs remain normal VS Code views of working files; reopen Native Review Snapshot from the changed file’s context menu to see the stopped capture. Clear Diffs resets the baseline to the current workspace while recording. When recording is stopped, it clears the saved baseline and Undo history and remains stopped, including after reload. It does not modify workspace files or dirty buffers. Recheck Observation Coverage is available in the Command Palette and Settings → Tools. For an active, ready configured scope, it reinstalls failed observation coverage and performs one bounded comparison against the original review baselines. Pending text/opaque reviews and unknown before-images are preserved. It refuses while recording is stopped, scope changes or recovery are pending, or editors have unsaved changes. Activity, unsupported coverage or resource limits may leave a visible coverage gap; retry after resolving the cause. Scope actions automatically perform their necessary reconciliation; Recheck remains available to retry unresolved observation failures against the original baselines. Unchanged files stop appearing as Unknown; unknown before-images still require a separate explicit Reset once coverage is verified. It does not accept changes, rebuild the baseline or modify workspace files. Monitoring Scope and File TypesOpen Settings → Tools → Manage Monitoring Scope, or run Code Diff Tracker: Manage Monitoring Scope. The old Edit Watch Ignores command opens this same manager. It shows the requested scope, effective scope, pending changes, preparation errors and current observation coverage. Status updates as recovery, baseline transactions, baseline scans and settings writes start or finish. It reports the actual blocking reason and available next step; interrupted durable baseline preparation requires Reload Window, not forcing a transaction lock clear. Unsaved scope drafts remain preserved during status updates.
Directory creation, imports and renames automatically receive bounded observation verification while recording. File/folder exclusions, Save and Apply, and Restore Effective Scope Configuration each continue through their necessary verification from one action, with one combined confirmation when needed. Cancellation preserves drafts and reviews. If settings are committed but verification cannot finish, the exclusion stays effective and the result reports partial completion; independent coverage problems are listed separately. Stopped sessions remain stopped. Text baselines store content in workspace-specific extension storage. Opaque resources, such as binary files, unsupported encodings and oversized text, retain existence and bounded identity evidence rather than new content copies. Acknowledge Read-only Change rechecks the reviewed identity and persists it as the new baseline. It does not modify the file, back up its bytes or create non-text Undo/Revert capability. An unreadable file or unknown before-image cannot be accepted as a verified opaque baseline merely to clear the list. Coverage diagnostics for directories are separate from file reviews. Recovery controls have distinct purposes:
How It WorksWhen recording starts, Code Diff Tracker:
Storage and Cleanup
Do not delete individual session JSON files, recovery intents or failure markers to free space or bypass a recovery warning. Preserve the workspace and extension storage before troubleshooting an interrupted save. Safety and Recovery BehaviorOptional Native ReviewChoose Native Review in Settings → Display → Default open mode, or set You can also run Open Native Review Snapshot for the active changed file, or Review Text Changes Natively for a multi-file view. Both sides are read-only, version-bound snapshots. VS Code 1.80 and hosts without Multi Diff use an explicit file picker and single-file Diff; more than 50 text changes also use this bounded fallback. This limit applies to one Multi Diff view, not the monitoring capacity. Right-click inside the snapshot's current side to Keep Reviewed File, Revert Reviewed File, or act on one exactly selected whole block. Partial selections, deleted-line blocks, stale snapshots, and ambiguous editor targets are refused. Use file-level review when a block cannot be mapped safely. Block Revert retains the existing unsaved-buffer behavior; save the real file when required, then open a fresh snapshot. The separate Review consistency and persistenceCode Diff Tracker rejects an action when the displayed review is stale, the baseline is incomplete, persistence has failed, or the target cannot be validated safely. Session state is written atomically and retains a last-known-good copy. If recovery data is corrupt or a session write is interrupted, automatic restoration is blocked instead of silently replacing the saved review state. Baseline growth and Keep operations must be persisted before review actions resume. Git context changes
Start while already recording is a no-op. Starting again from a stopped session builds a new baseline and asks before replacing pending review. Cancel leaves the review intact. Repository Archive and Rebuild requires recording and explicit confirmation. Clear Diffs retains its separate explicit confirmation; while stopped it clears saved review without scanning a new baseline. Fresh recording waits for the VS Code Git API to become ready before establishing the Git baseline. If a repository later changes branch, detached HEAD, worktree identity, or enters an unstable merge/rebase state, existing review data is preserved, while Revert and Undo actions for that repository pause. Returning to a compatible Git context automatically revalidates the live repository before resuming future review actions. Existing before-images, pending reviews and Undo records are retained; an in-flight action that observed the incompatible context is not revived. Archive and Rebuild Paused Git Baseline explicitly starts a new baseline, rather than unlocking the existing review. After switching between stable named branches in the same verified repository and worktree, text Keep can still update the selected review baselines. Both branches must have commits, and the review version, current content, unsaved-editor state, monitoring scope and saved-session checks must pass. Keep does not modify workspace files, the Git index or HEAD. It does not change the Git context originally recorded with the session or clear its pause. This applies to file, block, folder and batch text Keep. Batch confirmation shows the number of eligible text files; mixed batches do not relax the restrictions on non-text Acknowledge or unknown-baseline reset. If the Git context or reviewed content changes while Keep is pending, the operation is refused or rolled back. If saving is interrupted, reload to recover the saved review before starting a new baseline. Revert, Undo, folder/batch non-text Acknowledge and unknown-baseline reset retain their strict Git-context restrictions. The single-file Acknowledge Read-only Change action can accept a verified current identity across stable named branches under the same Git checks as text Keep. It advances only that file’s baseline, leaves other reviews and the repository pause unchanged, and removes only that file’s obsolete Undo entries. It does not save binary before-images or provide binary Revert. Different file content after returning to the original branch becomes pending again. Ordinary single-file Accept/Acknowledge runs directly; conflicts remain visible without accepting a newer version automatically. Acknowledge and explicit Unknown Reset preserve a complete pre-action session before publication. Interrupted saves recover the prior review rather than relying on an in-memory rollback; unchanged watcher notifications do not invalidate an approved file identity. Files larger than 64 MiB use reminders only: the extension does not read their full contents or compute content fingerprints. Reminders compare path, existence and size; same-size content edits and timestamp-only changes are intentionally ignored. Files already present when the baseline is established do not produce an initial reminder. Later additions, size changes and deletions do; renames can appear as deletion of the old path and addition of the new path. Acknowledging a large-file reminder marks that observed path/size state as seen. It does not verify or accept file contents, replace an earlier text baseline, remove earlier Undo evidence, or provide binary Revert. An earlier review remains preserved when a small file grows beyond the limit. If the file becomes small again, normal review resumes against any preserved before-image; missing original content remains Unknown. Use your own Git or software backups for recovery; the extension does not check that those backups exist. Ordinary commits on the same named branch do not invalidate the review context. Keep has these additional limits:
Use Code Diff Tracker: Restore Archived Git Review from the Command Palette to restore the latest review saved by Archive and Rebuild. Preview the repository, branch/HEAD, workspace root and saved baseline evidence, then confirm replacement of the current DiffTracker review state. Return to the archived branch yourself before restoring; the command never switches branches or changes Git history or workspace files. Restoration supports one workspace root and one repository, with matching root identities and monitoring scope. A missing/incompatible archive, unverified Git state, merge/rebase, dirty editor or pending scope/recovery operation blocks restoration. Any remaining Git pause is cleared only after the archived context is validated. Current disk content is reconciled against the archived before-images; unknown before-images stay unknown. Restoration preserves the archive's recording state. Active archives resume tracking; stopped archives receive one bounded reconciliation, including later-added files, and remain stopped. Temporary watchers verify the restore transaction and are released for a stopped session. A stopped current session can still restore an active archive. Start Recording creates a fresh baseline from current files; it does not resume an archived baseline. Only the latest archive is available: each Archive and Rebuild replaces Created and deleted filesCode Diff Tracker does not automatically delete a file when a Revert or Undo operation would remove a file that was absent from the baseline. VS Code does not expose a conditional, version-checked delete primitive, so automatic deletion could destroy newer work. Inspect and delete the file manually, then retry the operation if required. Batch Revert reports that item as a conflict and continues with other eligible files. When restoring a deleted file, Code Diff Tracker publishes fully written content without overwriting a destination that appeared concurrently. If the destination already exists or the filesystem cannot provide the required safe publication behavior, the action reports a conflict. Baseline and ignore provenanceA newly discovered path is classified as a new file only when Code Diff Tracker has sufficient baseline-scan provenance to prove that it was absent. Files exposed by changed ignore rules, or restored from older sessions without compatible scan provenance, remain pending with an unknown baseline until an explicit rebuild. Existing known baselines are preserved. Changes to folder-scoped or nested ignore semantics may invalidate older scan provenance even when the visible rule text is unchanged. Unsupported or unsafe filesWithin the effective monitoring scope, binary files, unsupported text encodings, UTF-8 BOM files and oversized resources are represented as read-only opaque changes when sufficient evidence is available. Unreadable resources and unknown before-images retain their uncertainty and reasons. They are not decoded and written speculatively. Paths outside the workspace and unsafe target identities remain excluded or safely refused. Pure line-ending-style changes are treated as no logical content change. New snapshots and recovery records preserve POSIX file permission bits, including executability. Older sessions without mode metadata cannot reconstruct original permissions. Missing parent directories created during recovery use private permissions ( Automation-only modeAutomation-only mode conservatively retains editor changes when their source cannot be proven. Saving a document does not silently accept those changes. Extensions can use the automation-session API described under Extension Settings to identify their own edits. InstallationMarketplaceSearch for Code Diff Tracker by publisher
From VSIX
Requirements
Extension Settings
Choose the opening mode in Settings → Display → Default open mode, through Select Default Open Mode, or in VS Code settings. The values are WebView display defaults are also available under Settings → Display: WebView default layout, WebView default: Wrap, and WebView default: Expand. Expand shows unchanged context, including lines outside the changed hunks. These settings initialize a new panel; an existing panel keeps its toolbar choices during updates, hiding/revealing, and file switches. Close the WebView tab and open it again to apply changed defaults. Toolbar clicks do not rewrite your settings. These defaults do not change the native VS Code diff editor. When The Recording settings group also exposes Only record reviewable text and Auto-open next pending file. Text eligibility uses the existing UTF-8, binary-content and size checks, including extensionless files. Enabling the text filter does not clear existing reviews or Undo. Dirty editors, read failures and coverage gaps remain unresolved. A previously skipped resource that becomes text requires Reset Unknown Baseline (Current Disk State); disabling the filter does not recreate missed history. A bounded, conservative membership record protects this rule across restart; it may also require a baseline reset for another untracked path. Stop continues to freeze the saved review. Use Stop Recording This File or Folder from Explorer or a pending file/folder context menu to exclude that exact path. If it has pending reviews, confirmation lists those reviews before any settings or review state changes; Cancel leaves the scope and review unchanged. Confirmation removes only the selected path’s active review, baselines and Undo entries, without modifying workspace files or rebuilding the workspace baseline. A path with no pending review needs no discard dialog. Resolve existing pending scope requests or legacy migration in Manage Monitoring Scope first, and close unsaved scope drafts. Concurrent scope/review changes require a fresh confirmation; failure restores the quick action’s own request where it is still current, never overwriting newer user settings. Workspace roots, ambiguous folder names and paths that cannot be represented exactly by the restricted exclusion grammar are refused without changing settings. Automatic navigation uses a stable path order and the configured default open mode. It wraps to remaining earlier files; when none remain, it leaves the current editor open. Failed, stale, cancelled or paused actions, remaining blocks, batch actions, and user focus changes do not navigate. When
Example integration from another VS Code extension:
Upgrade NotesWhen upgrading from older DiffTracker builds, saved review sessions remain associated with the extension ID that created them. Sessions from This build saves review sessions as Session V5, adding bounded stopped-review snapshots to the effective scope and durable gap evidence introduced in V4. Valid V1–V4 sessions remain readable; observation coverage is re-established after activation. Restored older sessions remain in scope-compatibility mode until explicit rule migration and scope preparation succeed. Cancelled or failed migration retains the existing review state. Version Text review sessions and ordered legacy rules have been verified when upgrading from released V5 is incompatible with builds that only read V4 or older formats; downgrade recovery is blocked rather than silently recapturing post-Stop edits or discarding saved review data. Older stopped sessions did not save pending current-content snapshots, so their baselines are preserved in an incomplete, paused state without guessing the missing review. Start or rebuild explicitly when ready. Explicit archived-review restoration retains its documented one-time current-filesystem reconciliation. Preserve the workspace and extension storage before changing versions. Do not delete recovery markers or saved state merely to bypass a compatibility warning. Known Issues
Release NotesRelease notes are maintained in CHANGELOG.md. ContributingSee the development guide for local setup, checks and packaging. LicenseMIT AcknowledgementsDiscuss, free AI, and get help at linux.do. |