Repository navigation
Description
The workflow
Save a snapshot of a thread’s full history outside bb.db, in a searchable file format such as JSONL. Users could keep the snapshot for reference, grep it, or bring it back into an agent’s context later.
One use case is deleting old threads to reduce database size while keeping a copy of their transcripts. This applies to both manual cleanup and automatic retention.
What happens today
Feedback on #4476 reports a 2.1 GB database, with 910 MB of event data belonging to 813 archived threads. The user has held off deleting those threads because they want to preserve their transcripts.
The comment also identifies a limitation for plugins trying to export at deletion time: thread.deleted fires after soft deletion, and handlers are not awaited before permanent deletion. A plugin cannot reliably export the events before they disappear. This timing concern has not been independently reproduced for this issue.
What you would expect
A way to explicitly snapshot a thread’s full history to storage outside the database:
- A documented, searchable file format such as JSONL.
- A destination that can survive deletion of the original thread and its storage folder.
- Access through the UI, CLI, and SDK.
- Clear success or failure feedback so users know whether they have a saved copy.
Integration with manual deletion or automatic retention would be useful, but the snapshot capability and how cleanup uses it are open design questions. This request does not require every deletion to produce a snapshot or require snapshots to restore threads in BB.
Context and alternatives
Related: #3598 — undelete. This request focuses on keeping a portable copy of thread history outside the database; restoring deleted threads in BB is a separate concern.
Continuously mirroring every thread’s events is a possible workaround for the reported deletion-hook limitation, but requires exporting all history ahead of any deletion.
Searched open and closed issues for transcript export and thread snapshots; no matching request was found.
AGENT GENERATED
Activity
bb-slop-cop commentedon Oct 2, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotApplied the missing classifications:
threadsThis adds a portable history-saving capability rather than establishing an existing bug. Medium priority reflects a meaningful cleanup workflow with a workaround; High effort reflects unresolved storage/format decisions and UI, CLI, and SDK integration. No existing classifications were changed.
No reproduction report or pull request: the final Type is Feature, so bug reproduction and automatic fixes are out of scope.
patleeman commentedon Oct 5, 2026
Thanks for writing this up, it captures it well. To answer what I'd want in a snapshot:
Goal: back up my sessions as plain JSONL on disk so they survive thread deletion, and so agents can fall back to grepping older history when they need context. That second part is a big reason for this: old transcripts are useful context, and grep over flat files is something every agent already does well.
Contents
grep -lplus a quickhead -1enough to know what a file is.Location
~/.bb/snapshots/<project>/<thread-id>.jsonl, so deleting the thread or its storage folder never touches it. Being able to point it at a synced folder (Dropbox, etc.) would be nice.grep/rgwork directly; compression as an option.When
bb thread snapshot <id>and a bulk mode (e.g. all archived threads) so I can back up my ~800 archived threads once and then delete them.Restore isn't needed for me. A readable, greppable copy is enough. Nice-to-have: an index or a
bb thread search --snapshotsflag so agents can find old threads without knowing the path.brsbl commentedon Oct 20, 2026
Workaround in use until this ships: an hourly script automation reads
bb.dbread-only and writes<archive>/<YYYY-MM>/<thread>.jsonl.xzfor each newly archived thread (line 1 is the thread row, the rest are its events in sequence order), plus anindex.jsonl. A first-classbb thread export, or archive-to-cold-storage, would make this unnecessary and let archiving actually shrink the database.