Harness Notes

Transcripts

Updated 2026-11-25,

On this page

Where each harness keeps the record of past sessions, how to get back into one, and how to keep, export or remove them. Every record type and field inside a transcript is on the Transcript format page. Automatic notes carried between sessions are on the Memories page.

What is saved

QuestionOpenCodechecked at 2.3.0
Where sessions are saved

Sessions live in the SQLite database ~/.local/share/opencode/opencode.db (follows XDG_DATA_HOME). It is shared by every project, and each session row records its project and directory. opencode debug paths db prints the path, and OPENCODE_DB overrides it, with relative values resolving under the data directory.

Subagent and forked sessions

Subagent runs become child sessions in the same session_v2 table, with parent_id set to the calling session, and they report their results back to the parent. Forks are new sessions whose fork_session_id and fork_boundary point to the source session. opencode session list shows only top-level sessions.

Prompt history

TUI prompt recall is separate from transcripts and kept in ~/.local/state/opencode/prompt-history.jsonl (last 50 entries), with frecency.jsonl next to it. The web/desktop app keeps its own prompt history in app storage.

Getting back to a session

QuestionOpenCodechecked at 2.3.0
Resume or continue

Run opencode --continue (-c) for the last session or opencode --session <id> (-s), which creates the session if the ID does not exist. opencode run and opencode mini take the same flags plus --fork. In the TUI, /sessions (aliases /resume, /continue) picks a session and /fork branches the current one.

Find a past session

Use /sessions in the TUI, or opencode session list for top-level sessions in the current project, newest first. -n limits the count (default 100) and --format json gives machine output. To search, query the database read-only, for example sqlite3 "$(opencode debug paths db)".

Since 2.1, client.session.list can filter by archive state and paginate; leaving archived out lists both.

Export or share

Partly

opencode session export [id] prints the session as JSON (--sanitize redacts it), and opencode session import <file|url> restores it. In the TUI, /export saves a transcript and /copy copies the latest assistant reply (since 2.0.32); the command palette can copy the full transcript. Share links are not available in 2.x: /share reports sharing as unavailable.

Export and import moved from top-level opencode export/opencode import in 1.x to the opencode session subcommands.

Read sessions from code

Every client talks to a local background server whose V2 HTTP API includes session.list, session.get, session.message.list (GET /api/session/{sessionID}/message), session.log and experimental.session.export. Use it through the @opencode/client package or opencode api. opencode run --format json emits JSON events. The V1 server API and SDK are not compatible with 2.x.

Since 2.1, replay data is in native, summary tails in metadata.keepID and provider windows in native.messages; the session.compacted event is gone.

Keeping and removing

QuestionOpenCodechecked at 2.3.0
How long they are kept

Partly

Sessions are kept indefinitely, and opencode uninstall explicitly keeps session data. Delete a session and its child sessions with opencode session delete <sessionID> or the API's session.remove. Only spilled tool and shell output files are aged out, after 7 days.

Since 2.1, client.session.update with archived: true hides a session without deleting it; false restores it.

Don't save this session

Partly

There is no documented no-save switch. OPENCODE_DB=:memory: (accepted by opencode debug paths) keeps the database in memory, so nothing persists after the server stops. With the shared background service, it has to be set for a --standalone run or for the service itself.

Cloud sync and upload

Partly

The normal CLI uses its server-owned local database; remote clients can use another server. The inspected workerd host explicitly enables durable event persistence, whereas the local bus defaults it off. These host registrations do not prove that all OpenCode deployments keep transcripts solely on the local machine. Hosted retention, additional providers and plugin-defined external delivery need their own evidence.

Notes and sources

OpenCode, 25 sources
  • Partial refresh at v2.1.1: replay-data fields, compaction references and archive API verified; existing database-path and command evidence remains scoped to 2.0.29. No runtime/import probe.
  • 2.2.0 source adds opt-in experimental.media_blob storage for inline user/tool media, off without the setting. Normal history reads hydrate references; clients opt into media: references with x-opencode-capabilities: experimental-media-uri. Missing blob bytes become an unavailable-media text placeholder. Instruction entry state is separate from chronological instruction updates; previous transcript schema pins are not upgraded wholesale.
  • 2026-11-15 source refresh: v2.3.0 at a6b15d33daf6ab7d35569f6d711fdb630b9f04e7. Source inspection, not a harness runtime probe. Historical supplements keep their independent evidence and dates.
  • The historical 1.x and dev-json variants are separate formats; neither defines 2.3.0 rows. Older CLI/export instructions retain their independently dated evidence.
Where sessions are saved, 4
Subagent and forked sessions, 5
Prompt history, 2
Resume or continue, 4
Find a past session, 5
Export or share, 6
Read sessions from code, 6
How long they are kept, 7
Don't save this session, 2
Cloud sync and upload, 3