Skip to content
groundedby
Waitlist

OpenCode

Where OpenCode stores your session history

OpenCode keeps every session in one SQLite database, opencode.db, under ~/.local/share/opencode. How to find it, list, export, share and delete sessions.

Updated October 29, 2026 // Markdown

Quick factsas of October 2026 (v1.19.5)
Made by
Anomaly (formerly SST)
History lives in
  • macOS / Linux~/.local/share/opencode/opencode.db
  • Windows%USERPROFILE%\.local\share\opencode\opencode.db
Format
SQLite (tables session, message, part)
Kept for
No automatic deletion
Resume
opencode --continue, opencode --session <id>
Cloud copy
Local unless you share a session

OpenCode, the open-source terminal agent now maintained at anomalyco/opencode, stores all sessions in one SQLite database.

Where the database is

opencode db path        # prints the active database

By default it is ~/.local/share/opencode/opencode.db on macOS and Linux, and the same path under %USERPROFILE% on Windows. OPENCODE_DB changes the file name. Before v1.2.0 (February 2026) sessions were JSON files under storage/; they are migrated automatically.

What is inside

Table What it holds
session Title, model, token counts, cost
message Messages in each session
part Message parts as JSON: text, tool calls, results

Resume, export and delete

opencode --continue              # the latest session
opencode --session <id>          # a specific one
opencode --session <id> --fork
opencode session list
opencode session delete <id>
opencode export <id> --sanitize  # export with sensitive values removed
opencode import <file>

Sharing

/share uploads a session to a public link at opncd.ai/s/<id>, and /unshare removes it. The share setting is manual by default; auto shares every session and disabled turns sharing off.

Not to be confused with

The older Go project named opencode was archived and continues as Charm's Crush.

The groundedby evaluator does not read OpenCode's database yet.

Questions

Where are OpenCode sessions stored?+

In a single SQLite database, opencode.db, under ~/.local/share/opencode on every system. Run opencode db path to print the exact location; OPENCODE_DB changes it.

How do I export an OpenCode session?+

opencode export <id> writes it out, and --sanitize removes sensitive values. opencode import brings one back in.

Are OpenCode sessions uploaded?+

Only if you share them. The share setting is manual by default; a shared session is uploaded to a public link at opncd.ai. Set share to disabled to rule it out.

Sources

  1. OpenCode docs, troubleshooting (storage locations)
  2. OpenCode docs, sharing

Waitlist

Your sessions, your call.

We are building an opt-in marketplace where developers license redacted sessions they pick, one by one. Join to hear first.

Your email and the side you picked. Nothing else. Privacy