Where each harness keeps the record of past sessions, how to get back into one, and how to keep, export or remove them. Automatic notes carried between sessions are on the Memories page.
What is saved
| Question | Codex CLIchecked at 0.162.1 | Claude Codechecked at 2.1.299 | Cursor Agentchecked at 2026.10.12-d47ca18 | OpenCodechecked at 2.0.28 | pichecked at 1.2.0 |
|---|---|---|---|---|---|
| Where sessions are saved | Each session is one file at If | Each session is saved as Moving a session with | In CLI 2026.10.12 each chat lives in Only the config directory override is documented; the chats/ and projects/ layout is how CLI 2026.10.12 behaves on disk. Source | Sessions live in the SQLite database | Each session is one file at
Run |
| File format | Partly Each file is JSON Lines. Every record carries Cold files may be stored as | Partly Transcripts are JSONL: one JSON object per line for a message, tool use, or metadata entry, each tagged with a Each message record carries the writing Claude Code | Partly The session itself is a SQLite database ( The documented, stable machine format is the headless | Partly SQLite. Sessions are in the On first start, 2.x migrates 1.x sessions in place within the same database from the old | JSONL: the first line is a New entry types still appear (for example |
| What a transcript records | The first record, Reasoning is stored as the model returns it, usually a summary plus encrypted content rather than raw chain of thought. Since 0.162.0, paginated history caps persisted command output at 64 KiB and truncates oversized MCP results. Source | The transcript holds the full conversation: every prompt, response, tool call and tool result, plus thinking blocks, per-response token usage, compaction markers ( Everything is plaintext and unencrypted; a secret printed by a tool ends up in the transcript. Since v2.1.299 the bytes of @-mentioned PDFs are no longer kept in the transcript. Source | Partly
Token counts are available to | Entries cover user prompts (text, files, agents, skills), assistant turns whose content is text, reasoning and tool calls (input, output content, status, errors), and shell commands. They also include synthetic and system messages, skill loads, agent/model/location switches, compaction summaries ( |
The system prompt and tool list are saved too: the first request writes a full system message, and later changes are saved as deltas. Compaction and context edits never delete the original entries; the file keeps the full history. Source |
| Subagent and forked sessions | Each subagent gets its own rollout file in the same Ephemeral subagents and | Subagent transcripts are written beside the parent at Compacting the main conversation does not alter subagent transcripts; subagents log their own | Partly Subagent transcripts are written next to their parent at | Subagent runs become child sessions in the same | Partly Pi has no built-in subagents. Third-party subagent extensions can save child sessions any way they like. Source |
| Prompt history | Prompt history for Up/Down recall and Ctrl+R search is a separate file, The docs call this file 'session transcripts', but full transcripts live in | Prompt history is a separate file, Large pastes in recalled prompts are stored in | Up-arrow history is per conversation: since June 2026 it is saved in that chat's own | TUI prompt recall is separate from transcripts and kept in | Pi doesn't keep a separate prompt-history file. Up-arrow recall ( Prompts sent with |
Getting back to a session
| Question | Codex CLIchecked at 0.162.1 | Claude Codechecked at 2.1.299 | Cursor Agentchecked at 2026.10.12-d47ca18 | OpenCodechecked at 2.0.28 | pichecked at 1.2.0 |
|---|---|---|---|---|---|
| Resume or continue | Run When the saved working directory differs from the current one, Codex asks which to use. Set |
Flags such as Resuming a background session that is still running attaches to it instead (v2.1.285+). Source | Run | Run | Run If |
| Find a past session |
Session names are kept in |
Sessions created with |
| Use |
Session files are plain JSONL, so |
| Export or share | Partly
Wait for the current turn to finish before running | Partly
| Partly The CLI has no export or share command. You can copy the JSONL file under
| Partly
Export and import moved from top-level |
Exports and shares can contain prompts, command output, file contents and any credentials that appeared in the conversation. Review them before sharing. Source |
| Read sessions from code | The supported interface is
| The Agent SDK exposes | Headless runs (
| Every client talks to a local background server whose V2 HTTP API includes | The SDK ( You can also parse the JSONL files directly; |
Keeping and removing
| Question | Codex CLIchecked at 0.162.1 | Claude Codechecked at 2.1.299 | Cursor Agentchecked at 2026.10.12-d47ca18 | OpenCodechecked at 2.0.28 | pichecked at 1.2.0 |
|---|---|---|---|---|---|
| How long they are kept | Partly Session files are kept until you remove them; Codex never deletes them by age. If you delete files by hand, the SQLite index in | A background sweep deletes transcripts, subagent transcripts and tool-result sidecars older than
The sweep is skipped with | Partly Local CLI chats have no expiry and are kept until you delete them. In the Deleting from the picker removes the chat folder. The JSONL copy under ~/.cursor/projects is a separate file, so check it too. Source | Partly Sessions are kept indefinitely, and | Pi keeps sessions until you delete them; there's no automatic expiry or retention setting. Delete a session by removing its You can't delete the session that's currently open from the picker. A session file is only created once the session has a user or assistant message, so opening and closing Pi without chatting leaves no file. Source |
| Don't save this session | Partly For non-interactive runs, The config reference describes | Set The Python Agent SDK has no
| Not supported There is no flag, setting or environment variable to run without saving the session; every interactive and | Partly There is no documented no-save switch. | Start Pi with There's no setting that turns persistence off for every run; pass the flag (or a shell alias) each time.
|
| Cloud sync and upload | Partly Local sessions are not uploaded. They stay under ChatGPT Work local-thread sync is a separate ChatGPT Work feature; Codex keeps its own history. Source | Local CLI transcripts stay on your machine by default and Turn Remote Control auto-connect off with Teleport is one-way: work continued in the terminal isn't pushed back to the cloud session. Source | Partly CLI chats are stored only on your machine and are not synced to the Cursor editor, the web or other devices. Your prompts and context still go to Cursor's servers for each model request, and Privacy Mode controls whether that data can be retained or used for training. Prefixing a message with The resume picker can also list your cloud agents next to local chats. Source | Partly Transcripts stay in the local database owned by your background server, and 2.x has no session sharing yet. The | Sessions stay on local disk and aren't synced to any cloud or other device. They only leave your machine when you run
|