Where coding agents store session history
Claude Code and Codex store JSONL under ~/.claude/projects/ and ~/.codex/sessions/. Pi uses ~/.pi/agent/sessions/; Grok Build, Kimi Code and Antigravity CLI use session directories. The supported opencode layout uses one SQLite database. The tables below compare the defaults, project metadata and resume commands.
Default locations and formats
| Agent | Default location | Transcript |
|---|---|---|
| Claude Code | ~/.claude/projects/ | <project>/<session-id>.jsonl |
| Codex | ~/.codex/sessions/ | <YYYY>/<MM>/<DD>/rollout-*.jsonl; archives in ~/.codex/archived_sessions/ |
| Grok Build | ~/.grok/sessions/ | <group>/<session-id>/updates.jsonl |
| Kimi Code | ~/.kimi-code/sessions/ | <group>/<session-id>/agents/main/wire.jsonl |
| Pi | ~/.pi/agent/sessions/ | <project>/<timestamp>_<uuid>.jsonl |
| Antigravity CLI | ~/.gemini/antigravity-cli/brain/ | <uuid>/.system_generated/logs/transcript*.jsonl |
| opencode | ~/.local/share/opencode/opencode.db | SQLite: session → message → part |
How can I resume a session?
Run from the original project directory with the corresponding CLI installed and configured. Replace SESSION_ID, CONVERSATION_ID or the path; these commands start the CLI and can make provider requests or write data.
| Agent | Terminal command | In-app chat |
|---|---|---|
| Claude Code | claude --resume SESSION_ID | Yes |
| Codex | codex resume SESSION_ID | Yes |
| Grok Build | grok --resume SESSION_ID | No |
| Kimi Code | kimi --session SESSION_ID | No |
| Pi | pi --session "/absolute/path/to/session.jsonl" | No |
| Antigravity CLI | agy --conversation CONVERSATION_ID | No |
| opencode | opencode --session SESSION_ID | No |
All seven have history browsing/search, export and terminal resume in Sessions Viewer. Statistics depend on recorded usage: Antigravity CLI's supported transcript has no usage fields. See resuming sessions and exporting sessions.
Where does the project identity come from?
| Agent | Metadata used by the viewer |
|---|---|
| Claude Code | JSONL cwd; encoded folder name is a fallback, not a reversible path |
| Codex | session_meta.payload.cwd |
| Grok Build | summary.json → info.cwd, with group-directory fallbacks |
| Kimi Code | Session metadata / index; state.json.cwd identifies the working directory |
| Pi | cwd in the first session record |
| Antigravity CLI | history.jsonl → workspace |
| opencode | project table joined by session.project_id |
Which custom roots does the viewer discover?
| Agent | Recognized override |
|---|---|
| Grok Build | GROK_HOME (default ~/.grok) |
| Kimi Code | KIMI_CODE_HOME (default ~/.kimi-code) |
| Pi | PI_CODING_AGENT_SESSION_DIR, then settings.json.sessionDir, then <PI_CODING_AGENT_DIR>/sessions |
| opencode | XDG_DATA_HOME (default ~/.local/share) |
The current Claude Code, Codex and Antigravity adapters read fixed locations under the home directory. This is a viewer limitation, not a claim that those CLIs cannot use other roots. Environment variables in your shell may not reach a desktop app launched from Finder or a shortcut. Follow the missing-session checklist before moving files.
Read a transcript without the app
Each agent's reference page includes jq or read-only sqlite3 examples. They extract selected fields, not every image, tool result or branch. Use Sessions Viewer for a searchable view, or download the app.
Evidence and scope
Path and resume information was checked against the agent adapters at source revision 22fefc6. Each reference page links its own adapter and, where identified, an upstream entry point.
Reference scope: checked against the Sessions Viewer 0.6.0 adapters on 2026-10-05, not a compatibility guarantee for every CLI release. Shell examples use macOS/Linux paths and require
jq(orsqlite3for opencode). Replace placeholders with real values and use your configured data root. Text extraction does not replay tools, images or the active branch of a session tree. Command regressions use downloadable synthetic samples, not private sessions. Check the capability and evidence matrix for tested scope. Browsing is distinct from resuming or editing data; see privacy and data handling.
