OpenProgram Docs

Importing other agents' sessions

Transcript .jsonl, read only Parse ExternalSession Sanitize host context, secrets Compare with ledger Write nodes ids from agent + source id + turn Ledger entry session, turns, last fingerprint, head
ModuleJob
claude_code.py, codex.py, deepseek_harness.py, antigravity.py, cursor.py, hermes.pyFind, summarise and parse each format
model.pyNeutral shape: turns of user text and ordered reply blocks
sanitize.pyDrop host scaffolding, remove credentials
writer.pyWrite turns as the DAG a native turn produces
tool_names.pyOther apps' calls as OpenProgram's own tools
app_removals.pyArchived or deleted in the app, archived here
ledger.pyWhat was imported where
service.pylist_candidates, plan_imports, import_transcripts
live.pyThe loop that follows the apps as they write
claude_live.py, codex_live.pyA session read as it grows; what it is doing now

Entry points: openprogram sessions import, /api/sessions/import, the Import settings tab. The CLI sends batches to a running Worker, else writes the store directly. Product page: Session import.

Reading the formats

Claude CodeCodex
Filesprojects/<slug>/<id>.jsonlsessions/YYYY/MM/DD/rollout-*.jsonl
Source idFile name; sessionId is copied into forkssession_meta.id
Conversation orderChain walked back from the newest record through parentUuid / logicalParentUuidFile order; compaction and forks do not rewrite it
Titlecustom-title, then ai-title, then summarysession_index.jsonl, latest rename
Model, cwdmessage.model, record cwdturn_context.model, session_meta.cwd
SkippedisMeta, isSidechain, compact summaries, API error recordsSub-agent rollouts, injected context blocks, encrypted reasoning

A line that is not a JSON object, or a record still being written, is skipped; the rest of the file still imports.

Decisions

ChoiceWhy
Read the conversation the way its own agent resumes itClaude Code's resume follows the parent chain from the newest record; Codex replays the rollout in order. The imported conversation is then the one the user last saw there, not abandoned branches.
Write native nodes, not an attachmentSearch, export, rewind and continuing the conversation work unchanged. Tool calls whose tools do not exist here are replayed to the model as text.
Ids derived from agent, source id and turn indexWriting a turn twice is a no-op, so a grown source appends in place. Same principle as OpenCode's import, which keys an imported session by its original id.
Ledger with last fingerprint and headUnchanged sources are skipped without a parse. A rewound source, or a session continued here, becomes a new session, so nothing already here is rewritten.
Listing recency from the last messageA running agent keeps appending bookkeeping records to a transcript whose conversation has not moved, so the import list sorts by the last message. The live sync wakes on any write instead: reading what was appended costs a fraction of a millisecond, and a turn whose text did not change is not written again.
Credentials removed with the request-redaction shapesAn imported turn is replayed to whichever model continues it. The high-precision shapes from models/providers/request_hygiene/redaction.py catch keys and tokens without rewriting prose that only mentions a key or a token; export's broader rules would. A title is cleaned before it is cut to length, since a key cut short no longer matches its shape; the listing's scan cache keeps its first message and titles cleaned too. Sign-in files are never opened.
Placed in the folder's projectSame as opening that folder here; the original cwd stays in imported_from.cwd.
--dry-run beside --list--list shows every transcript and its state; --dry-run shows only what the same command would create or append to. It runs plan_imports, the same decision the import makes, so a rewound source shows as a new conversation, not an append.
Codex app conversations synced, not importedThe Codex app's and CLI's threads come in by themselves through codex_sync.py, which reuses this reader, writer and ledger but links each conversation to its Codex thread and appends turns made in the app, skipping turns OpenProgram ran on it; see Harness engines.
Synced conversations' projectsSynced conversations of every app get their folder's project as an import does, except in a folder the app made for one chat (the Codex app's ~/Documents/Codex/<day>/…, the Claude app's scratch workspaces) a temporary one, or a folder whose project the person removed, which stay in the default project. One synced before its folder got a project moves there once.
Messages sent from hereThe person's own messages reach Codex, Claude Code and DeepSeek Harness as typed; messages that came through a channel, the owner's there included, keep OpenProgram's speaker envelope so the agent can tell who spoke. An envelope an earlier version sent is unwrapped when the transcript is read, and once in conversations already synced, their title too
PicturesA picture the person sent in the app (Claude Code's base64 image block, Codex's data: image) is kept in the conversation's media/ and shown where it sat, as a picture sent here is, and sent again when a turn here reads the message. One whose bytes the transcript lacks stays [image]. Conversations synced before get theirs once, a few per sync.
Pictures in peersCline keeps Claude Code's image blocks and drops Codex's pictures; Hermes Agent shows [image] and drops Codex's
The Claude app and DeepSeek Harness synced tooapp_sync.py brings in the Claude app's Code tab conversations and DeepSeek Harness's (deepseek_harness.py reads its zstd event log) with the same ledger, and appends turns the app adds after whatever was said here; a conversation rewound in the app is left as it is here. Conversations started with claude in a terminal (entrypoint: cli) come in too.
Antigravity synced, both waysantigravity.py reads the plain-text step log the desktop app and its agy command both keep (brain/<id>/.system_generated/logs/transcript_full.jsonl) and the name and folder from conversation_summaries.db, as magpie does. A conversation that goes on here goes on in the app, on its engine (Harness Engines).
Antigravity subagentsA subagent's conversation is read into the conversation at the top of its chain: what it did (each call, with its first argument) and said becomes the result of the call that started it, the one whose result names its id, else the last invoke_subagent or browser_subagent before it began.
Antigravity documentsA document Antigravity wrote for the person (a file in brain/<id>/ beside its .metadata.json) shows in the reply as it reads now, after the last call that wrote it.
Cursor and Hermes syncedcursor.py reads the editor's agent chats from its globalStorage/state.vscdb (composerData: and bubbleId: rows, read-only and by key: the store is gigabytes) and cursor-agent's from ~/.cursor/chats/*/*/store.db; hermes.py reads Hermes Agent's state.db and each profile's, a compaction's continuation read as the same conversation. Both follow magpie; subagents' chats and hidden rows stay out. A cursor-agent chat and a Hermes conversation go on in their agent (Harness Engines); an editor chat goes on in OpenProgram's own, since cursor-agent cannot resume it.
Cursor's busy storeCursor writes its store all the time it runs, so a listing reads each chat's size and lastUpdatedAt, and the whole chat only of those that moved.
Their calls as OpenProgram's toolsA call with an OpenProgram counterpart is written as that tool, its arguments as that tool takes them (run_command, run_terminal_command_v2 and terminal as bash; edits as edit with the text before and after), so its card shows a command, a diff or a checklist. A Cursor edit_file_v2 names the file's text before and after by content id; both are read from its store. A call starting a subagent keeps its app's name. Conversations synced before are named again once.
Archived or deleted in the appOn every full pass a conversation its app archived or no longer has is archived here, and one it shows again comes back; one taken out of the archive here stays out. DeepSeek Harness, Antigravity, Cursor and Hermes: gone once the app lists it no more (an empty listing counts for nothing). Claude Code and Codex, which can be imported by hand: archived in the app, or its transcript deleted.
They continue in their agentA DeepSeek Harness or Claude conversation is linked to its session on that agent's engine; the turns the engine ran are known by the id of their last assistant message or record and skipped.

Following the apps as they write

File notices FSEvents, inotify · 50 ms Hot files size and time · every 250 ms Full pass every 60 s Read appended fold onto the chain Write the turn running until it ends Tell clients app_activity Rewind, fork, file rewritten → read whole once; otherwise only what was appended

While the person works in the Claude app, claude in a terminal, Codex, DeepSeek Harness or Antigravity, the conversation here shows each block within a fraction of a second of the app writing it, its reply shows Thinking… and the running tool as a turn of OpenProgram's own does, and its sidebar row shows running.

ChoiceWhy, and whose design
Woken by the file system, a hot-file look and a full passwatchfiles gathers notices for 50 ms; magpie watches the same roots through FSEvents with a 10 ms latency. macOS tells of a write to a file held open only once it closes and Codex holds its rollout open (magpie's finding), so the files written in the last ten minutes are looked at every 250 ms, as Ping Island watches each transcript. A notice can be dropped, so everything is read again every minute, as magpie relists.
Only what was appended is readThe offset after the last whole line, trusted while the 64 bytes before it hash the same (state/store/appended_lines.py, shared with the usage reader; Filebeat's and Vector's fingerprint plus offset). A 470 MB transcript takes 2 s to parse and 2 s more to clean of secrets; a grown one takes under a millisecond.
New records folded onto the chainRecords that hang off the last one read are fed to the same fold the whole reading uses; one that hangs off an earlier record (a rewind, a fork) reads the file whole again. Turns before the last two keep only their fingerprint and ids, so a long session stays small. claude-code-ui tails the same way but replays history to rebuild state.
No waiting for a file to restOnly whole lines are read, so a session is read as far as it is written. The 4 s rest and 10 s poll this replaces hid a turn until it ended.
Running, from Claude Code's registry first~/.claude/sessions/<pid>.json says busy or idle for each live claude, its process checked alive (claudecodeui's liveness). The transcript says what it does: a prompt, a tool result or an api-request is thinking, an unanswered tool_use names the tool, end_turn, a stop-hook summary or an interruption ends it. Codex: task_started until task_complete or turn_aborted, an unanswered call names the tool.
Running, in DeepSeek Harnessturn/start until turn/end, a tool-call with no tool/result names the tool. The app appends each write as a zstd frame of its own, so only the whole frames after the last one read are read; a log that shrank or whose start changed is read again from the beginning.
Running, in AntigravityThe person's message, a tool's result or a reply whose calls are unanswered is running, a reply with no call ends it, and the conversation runs while a subagent it started still does, shown as that subagent.
Running, in Cursor and HermesThe last turn's unanswered call is the tool running, its reply the end; their stores' write-ahead logs are the files looked at often. In every app a turn counts as running at most ten minutes after the last write.
No hooksHooks (claude-code-ui, Ping Island, Orca) add the one thing files lack, a wait for a permission answer, but run a command on every event of every session and edit the person's own settings. magpie installs none, and the person answers that prompt in the app they are using.
The turn written runningThe reply is written with status running and each call without a result running, so the transcript draws it with the rows a turn here uses; when the app's turn ends it is written again, done.
Activity told apart from turns hereAn app_activity frame, and the same field on each session-list row, not a run slot: the turn is not OpenProgram's to stop, and the slot's admission and cleanup belong to turns run here.
A message sent here meanwhile waitsTwo processes writing one Claude Code session would fork it. A turn sent here on the Claude engine waits while the registry says the app's process is busy in that session, then a moment for the sync to write that turn, then plans its handoff from it.
Text a block at a timeClaude Code writes a message's blocks when the model's response is complete, so text arrives block by block; nothing that reads its files can show tokens. A harness on the Model Gateway streams through the Worker itself.

Implementation status

  • Only the default homes (or $CLAUDE_CONFIG_DIR, $CODEX_HOME) are scanned; a copied folder from another machine cannot be named on the command line.
  • A session imported before credentials were removed keeps what it holds until its source grows; then only the last imported turn is rewritten clean. A turn's fingerprint is taken from its text as read, so redaction never turns such a source into a duplicate session.
Last updated · 2026-11-30