Hatch
On this page

Hatch keeps older versions of every note on this device. You can compare a version with the note now, copy it, or restore it. It needs no account and no Git backup.

Using it

  • Open it from the note's "…" menu ("Version history") or the command "Version history".
  • The History panel lists the versions of the open note, newest first, with how long ago and how the size changed.
  • Click a version to see what changed since then. Removed lines are from that version. Added lines are in the note now.
  • "Restore this version" puts the old text back. The text you had is kept as a version first, and undo works too.
  • "Copy" copies that version as Markdown.
  • Notes you deleted in Hatch show under "Deleted notes". "Bring back this note" writes the last kept text to the same path, and puts the note's comments back (see docs/comments.md).
  • With Git backup set up, the same panel also lists the note's GitHub backups in a second group.

When a version is kept

  • The first time you edit a note on this device, the text from before the edit is kept.
  • After that, a save is kept when it differs from the newest version and that version is at least 5 minutes old.
  • A large change is kept right away: 2,048 characters or more, or more than 20% of the note when that is at least 200 characters.
  • The current text is always kept before a restore, before a change from outside Hatch is loaded into the open note, and before a note is deleted in Hatch.
  • Text that matches the newest version is never kept twice. Empty text is never kept.

Limits

  • 100 versions per note. The oldest go first.
  • Versions older than 60 days are dropped.
  • About 50 MB across all notes (counted in characters). Past that, the oldest versions go first, whichever note they belong to.
  • Versions follow a note when you rename it in Hatch.
  • Only notes (.md) have versions. Canvases, collections and attachments do not.
  • Versions stay on this device, in the browser's IndexedDB (hatch-history). They do not sync and are not in the vault. Clearing site data removes them. Use Git backup or sync for a copy somewhere else.
  • If the browser won't open IndexedDB (some private windows, storage turned off), versions are kept in memory instead. The panel then says "Versions are kept only until you close Hatch on this device".
  • Turning off the "Version history" plugin stops recording and hides the panel. Versions already kept stay.

Synced versions

When the vault syncs, the History panel also shows "Synced versions": every save that reached the Hatch server, from any device and anyone the vault is shared with, with who saved it.

  • Saves by one person within 5 minutes of each other are one version (for up to 30 minutes), unless a save changes a lot (the same size rule as above).
  • The server keeps the newest 100 versions of each file, for 30 days on the free plan and a year on paid plans (HATCH_HISTORY_DAYS). A deleted file's versions go when its days are up. History can take up to twice the owner's storage, and past that the oldest versions go first.
  • Everyone who can read the vault can read its history, including versions saved before they joined and versions of deleted files. Remove anything you don't want them to see before you share, and know it stays in the history for the plan's days.
  • Moving to a plan with fewer days drops the versions past them on the next save.
  • Restoring writes the old text as a new save, and going back to text a file held before is always its own version, so it syncs to everyone and shows in the history as yours. Viewers can compare and copy, not restore.
  • End-to-end encrypted vaults keep their history encrypted too. The server lists versions by a keyed id and only the devices with the passphrase can open them.
  • Code: sync_version and keepVersion in apps/server/src/sync.ts, the versions and version routes, SyncApi.versions and version in packages/sync (opened by encryptedApi for encrypted vaults), SharedVersions in packages/app/src/historyView.tsx.