History Manager
History Manager is a local-history extension for Visual Studio Code. It records file snapshots on save, skips
unchanged content, and keeps comparison and recovery actions in an Explorer tree.
Every revision lives below one history root, ~/.history by default, and the full source path is mirrored under it.
A snapshot therefore sits next to the mirrored directory of the file it belongs to, and nothing is written inside
the project itself.
Features
- Capture the original disk version before the first managed save.
- Capture the latest content after each save, with optional save coalescing.
- Skip a snapshot whose content matches the previous revision.
- Compare a revision with the current file, its previous revision, or another selected revision.
- Restore a revision after automatically backing up the current disk version.
- Browse the current file or all history for the open folders in the Explorer.
- Apply age and per-file count retention, including a sweep at startup.
- Support multi-root workspaces and files opened outside a workspace.
Storage Layout
The history root is the .history directory below history-manager.path. Each source directory is mirrored under
it, a drive letter becomes a single lowercase segment, and every revision keeps the original extension so the editor
still detects the language.
~/.history/
`-- c/
`-- JUNGHO/
`-- app/
|-- main_20260829120405.ts
`-- main_20260829131500.ts
C:\JUNGHO\app\main.ts therefore resolves to ~/.history/c/JUNGHO/app/, and the timestamp is local time down to
the second. When two different contents are saved within the same second, the name rolls forward to the next free
second instead of dropping the snapshot.
Safety Model
Restoration is blocked while the target document has unsaved changes. Before overwriting a file, History Manager
captures its current disk content as a backup revision, even when that file is excluded or capture is disabled.
Delete actions require modal confirmation and only operate on paths verified to be below the history root.
Delete All History never clears the whole root: it removes only the directories that mirror the open workspace
folders.
Commands
| Command |
Purpose |
History Manager: Show Current File History |
Switch the tree to the active or selected file. |
History Manager: Show All History |
Show revisions for every open folder. |
History Manager: Create Snapshot Now |
Capture the selected file immediately. |
History Manager: Refresh |
Reload the tree from disk. |
History Manager: Reveal History Storage |
Reveal the directory that holds the current revisions. |
History Manager: Delete All History |
Permanently remove history for the open folders. |
Revision and file-group actions are available from the History Manager tree context menu.
Settings
| Setting |
Default |
Description |
history-manager.enabled |
true |
Enables automatic and manual snapshots. |
history-manager.path |
~ |
Sets the base directory that holds the .history root. |
history-manager.saveDelay |
0 |
Coalesces repeated saves for this many seconds. |
history-manager.retentionDays |
30 |
Removes older revisions; 0 disables the age limit. |
history-manager.maxEntriesPerFile |
100 |
Limits revisions per file; 0 disables the count limit. |
history-manager.maxDisplay |
500 |
Limits revisions loaded into the tree. |
history-manager.exclude |
common generated paths |
Excludes matching files from capture. |
history-manager.path supports ~ and %ENVIRONMENT_VARIABLE%, and must resolve to an absolute directory. A value
that does not resolve falls back to the home directory. In an untrusted workspace the setting is ignored so a folder
cannot redirect where snapshots are written.
Development
bun install
bunx tsc --noEmit
bun test
bunx biome check .