vibivibi

Guides · OpenCode

How to back up, move and share OpenCode sessions

OpenCode stores its sessions in a SQLite database rather than in files, so there is nothing to copy around and nothing that survives a reinstall unless the whole database does.

OpenCode can export a session as JSON and import one back. vibi uses exactly that: it asks OpenCode for the export, backs it up encrypted, and on another machine hands it to OpenCode's import, so the session continues there with the same id.

Where OpenCode keeps sessions

OpenCode's SQLite database
sessions, messages and parts; vibi lists them with opencode db --format json and reads one with opencode export <id>, so OpenCode must be installed on both machines
~/.vibi/downloads/opencode-<session-id>.json
where a pulled export is written before opencode import <file> loads it into the database
  • Archived sessions are not listed; vibi shows the unarchived ones, newest first.
  • The export is OpenCode's own format with every message and part, so nothing is lost in the round trip.
  • Importing the same session twice is harmless: OpenCode keeps the id and does not duplicate it.

How sessions get lost

  • A reinstall or a new machine: the database stays behind.
  • Clearing OpenCode's data directory.
  • No way to give a teammate the conversation except screenshots.

Back up OpenCode sessions

vibi is a single executable for macOS, Linux and Windows; nothing else to install, no root.

curl -fsSL https://vibivibi.com/install.sh | sh
  1. Install vibi and enroll the machine once.
  2. In the project directory, run the picker; OpenCode sessions whose directory is that project are listed.
    vibi push
  3. Choose Sync. vibi runs opencode export for the session, encrypts the result locally and uploads it; later pushes add versions.

Restore on another machine

  1. Enroll the other machine (OpenCode installed there too) and pick the session.
    vibi pull
  2. vibi writes the export under ~/.vibi/downloads/ and runs opencode import on it; the session appears in OpenCode with its original id.
    opencode --session <session-id>
  3. To keep a copy as a file instead, write it to a path of your choice.
    vibi pull <id> --out ./session.json

Share a session with a teammate

  • In the picker choose Send and type their email. The session is encrypted for their key on your machine; they see it in their inbox and pull it with their own password.
  • If the address has no vibivibi account yet, vibi makes a provisional key for them, shows you a one-time passphrase before anything is uploaded, and emails them an invitation. They sign up, enroll a machine, and type the passphrase once.
  • Sending again after more work adds a version; recipients keep the one they were sent.

What is encrypted

The session content, its title, working directory and model name are encrypted on your machine with a key only you and your recipients hold (X25519, HKDF-SHA256, AES-256-GCM; the private key is wrapped with your encryption password). vibivibi stores the ciphertext, its size, a fingerprint of the key, the agent kind and the optional plain-text name you give a session. The client is open source, so this can be checked: github.com/subconscious-systems/vibi-cli.

Questions

Where does OpenCode store sessions?
In a SQLite database under its data directory, not as separate files. vibi never touches the database directly: it goes through opencode db, opencode export and opencode import.
Can I resume an OpenCode session on another machine?
Yes. Back it up with vibi push, pull it on the other machine with vibi pull (OpenCode must be installed there), then run opencode --session <session-id>. The import keeps the original id, so the session continues where it stopped.
What is in the backup?
OpenCode's own export of the session: the session record (title, directory, model, times) and every message with its parts, tool calls included. It is encrypted before upload like everything else.

Other agents: Claude Code · Codex CLI · Pi. Start with the free plan: 200 MB of encrypted sessions, two machines, unlimited sends.

How to back up, move and share OpenCode sessions · vibivibi