Skip to content

Version history

Prompts are code, and code needs history. Saving an agent, skill, workflow, dashboard, widget, or atlas definition records a version under <home>/history/<kind>/<name>/, so “it worked yesterday” is a question with an answer.

Version history for a document

Versions for one document, newest first, with a diff against the live file.

Three properties, in priority order:

  • Only the live file is ever read. Prompts and the executor never see the history directory; it is a folder nothing else looks at, which is why it can be generous about keeping copies without changing behaviour.
  • A burst of saves is one version. A new version is recorded only when the newest existing one is older than a few minutes, so an editing session collapses to “the state before the burst” plus a periodic snapshot — not one version per keystroke-triggered save.
  • History survives deletion. Deleting the live document does not delete its history, which makes restore-after-delete possible.

Retention is capped per document, so a long-lived agent doesn’t accumulate history without bound.

Kinds agent, skill, workflow, dashboard, widget, atlas
Path <home>/history/<kind>/<name>/<epoch-ms>.<ext>.md for everything but workflows, which are .json
What is recorded The outgoing content: the live file as it was before the save that triggered it
Coalescing window 5 minutes — a save whose newest version is younger than that records nothing
Retention 50 versions per document; the oldest are pruned on write
Skipped when The content is byte-identical to the newest version

Because versions are named by millisecond timestamp, the directory sorts chronologically and ls is a perfectly good history browser:

Terminal window
ls ~/LatchAI/history/agent/code-reviewer/
# 1753380114882.md 1753466520431.md 1753552903117.md

They are ordinary files. Diff two of them with diff, or diff one against the live document, and nothing in LatchAI minds:

Terminal window
diff ~/LatchAI/history/agent/code-reviewer/1753466520431.md ~/LatchAI/agents/code-reviewer.md
  • Workflows — the ⏱ History button in the workflow toolbar.
  • Agents, skills, and widget types — the history button in their Settings editors.

Dashboards and atlas definitions are recorded on every save too, but have no browser yet — their versions are on disk under history/dashboard/ and history/atlas/, restorable through POST /api/history/<kind>/<name>/<id>/restore.

LatchAI has three histories and they do not overlap. It’s worth knowing which one you want:

Layer Covers Where
Version history Documents you author — agents, skills, workflows, dashboards, widgets, atlases <home>/history/
Checkpoints Workspace files changed by a run or a chat turn <home>/runs/checkpoints.git
Your own git The repositories you mounted Your repos

A bad prompt edit is version history. A run that wrote the wrong file is a checkpoint. A commit you regret is git.

The history browser lists versions newest first with their size and age, previews the one you select, and restores it. Restoring writes the old content back to the live file — which, being a save, records a version of its own.

That last part is the point: restore is itself undoable. The snapshot taken on restore ignores the coalescing window, precisely so a restore can never be the save that got collapsed away. A workflow is validated against the schema before its live file is touched, so restoring a version that predates a schema change fails cleanly instead of writing a file the executor can’t load.

The whole flow is also an API, which is what a “roll every agent back to Tuesday” script would use:

Terminal window
curl -s localhost:7777/api/history/agent/code-reviewer
# {"versions":[{"id":"1753552903117","ts":1753552903117,"bytes":4210}, …]}
curl -s localhost:7777/api/history/agent/code-reviewer/1753552903117 # {"content":"---\nname: …"}
curl -XPOST localhost:7777/api/history/agent/code-reviewer/1753552903117/restore

A brand-new document shows “No versions yet.” That is correct, not a bug. A version is the state a save replaced, so creating a document records nothing — there was no previous live file. The first version appears on your second save. The same logic explains a suspiciously thin history after a fast editing session: only the first save in a burst records anything — the state before the burst — and everything within five minutes of it is deliberately collapsed away.