UndoHaven · Pricing · Docs · Plugins · Log gate · Encryption · What we see · Log in · Account · 中文

A search for .jsonl finds nothing because the log is zstd

The stock profile stores sessions at $DSH_HOME/sessions. The layout is a directory for the working directory, then a directory per session id, then the log. Format v0 is session.jsonl. Later generations are session.vN.jsonl. Compression defaults to zstd, so the file you want is session.vN.jsonl.zstd. The logical format current in the catalog checked for 0.2.2-rc.3 is v4. A comment on discussion #13241 notes that find for *.jsonl returns nothing while session.v4.jsonl.zstd is present. The bytes are concatenated zstd frames, not plain text.

Fix it by hand

  1. Quit dsh so it is not holding the write lease. Search for session.v4.jsonl.zstd, or session.vN.jsonl.zstd, under ${DSH_HOME:-$HOME/.dsh}/sessions.
  2. Copy the session directory, including the generation file. session.lock is a POSIX lease file. On Windows the lock is a named semaphore, not that file. You can leave session.lock out of a backup.
  3. Do not decompress the log next to the original. A loose .jsonl beside the zstd file is a different failure, covered on the jsonl mismatch page.
  4. A truncated last frame can be dropped by a careful reader. Do not open the zstd file in an editor and save it.

If the only file in a new session directory is session.lock, the log was never published. Copying that directory does not recover a conversation that was not written.

Public discussion

Optional encrypted snapshot

Optional. UndoHaven is an unofficial third-party, compatible with dsh. Copy the directory by hand first, then use an encrypted snapshot if you want one.

npx undohaven init

  1. Install: copy this command.
  2. First snapshot: it stays encrypted on this machine.
  3. Roll back: undohaven restore --to SNAPSHOT_ID

Free covers 7 days of history and 1 device. Pricing

Related