Checkpoints & rewind
Before an agent writes to disk, Lectern snapshots your workspace. If you don't like what a run did, rewind to the snapshot and try a different prompt — the edits are undone, files the agent added are removed, and your own git history is never touched.
How it works
A checkpoint is taken automatically at the start of any run that applies changes (a normal apply run or a Conductor run). It records the exact state of the workspace before the turn, so that turn becomes a point you can return to.
Snapshots live in a private, per-workspace git store under ~/.lectern/checkpoints/ whose work tree is your project folder. It is completely separate from your project's own .git — a different git directory, its own identity, your global git config disabled. That means checkpoints work even on folders that aren't git repositories, and can never change your real history, index, branches, or hooks.
Rewinding
From the CLI, list the points you can return to and rewind to one:
In the desktop app, every run leaves a Checkpoint marker in the chat. Click Restore, confirm, and the workspace snaps back to that snapshot; the file tree refreshes and the original prompt drops into the composer so you can adjust it and run again.
Rewinding is itself reversible. Before it restores, Lectern snapshots the current state as a redo point — solectern rewind <redo-id> (printed after every rewind) puts you right back.
What's captured
A snapshot mirrors your working tree, minus noise and secrets:
| Included | Excluded |
|---|---|
| Source, config, docs — your working files | Build output (node_modules, target, dist, …) |
| Anything your project would normally track | Your project's own .git and the .lectern brain store |
| Binary files (restored byte-for-byte) | Secrets — .env and .env.* are never snapshotted |
Your workspace's .gitignore is honored automatically, and the excludes above are always applied on top — so a checkpoint stays small and never captures a plaintext copy of your credentials.
Isolation & safety
- Your project's own git repository is never touched — its HEAD, index, and git status are unchanged across a checkpoint and a rewind.
- Secrets are left alone: because .env files aren't snapshotted, a rewind never rolls back (or stores a copy of) your credentials.
- The default home workspace isn't checkpointed — snapshots are for project folders you open.
- Everything stays on your machine; the shadow store is local, alongside your brain.