Harness Notes

Transcripts

Updated 2026-11-22,

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

QuestionClaude Codechecked at 2.1.299
Where sessions are saved

Each session is saved as ~/.claude/projects/<project>/<session-id>.jsonl, grouped per working directory: <project> is the directory path with every non-alphanumeric character replaced by - (names over 200 characters are truncated and given a hash suffix). CLAUDE_CONFIG_DIR moves the whole tree off ~/.claude, and CLAUDE_CODE_PROJECT_DIR_NAME (only honoured together with CLAUDE_CONFIG_DIR, v2.1.234+) lets you choose the <project> folder name yourself.

Moving a session with /cd relocates its transcript to the new directory's project folder.

Subagent and forked sessions

Subagent transcripts are written beside the parent at ~/.claude/projects/<project>/<session-id>/subagents/agent-<agentId>.jsonl (with an agent-<agentId>.meta.json sidecar) and are deleted together with the parent session. Forks made with /branch or --fork-session become ordinary top-level sessions with their own IDs, and SubagentStop hooks receive agent_transcript_path pointing at the subagent file.

Compacting the main conversation does not alter subagent transcripts; subagents log their own compact_boundary records.

Subagent transcripts written before 2.1.307 can show placeholder token usage and empty stop reasons.

Prompt history

Prompt history is a separate file, ~/.claude/history.jsonl, with one line per typed prompt (text, pasted content, project path, session ID, timestamp); up-arrow recall and Ctrl+R search filter it per working directory. It isn't swept by cleanupPeriodDays (except under HIPAA configuration), but claude purge removes a project's lines and CLAUDE_CODE_SKIP_PROMPT_HISTORY=1 stops it being written.

Large pastes in recalled prompts are stored in ~/.claude/paste-cache/, which is swept by age.

Getting back to a session

QuestionClaude Codechecked at 2.1.299
Resume or continue

claude --continue (-c) reopens the most recent session in the current directory, claude --resume (-r) opens a picker, and claude --resume <session-id|name|/abs/path/to/file.jsonl> resumes a specific one; inside a session use /resume [session]. Add --fork-session (or run /branch in-session) to continue in a copy with a new session ID, and claude -p --resume <id> "prompt" continues one non-interactively.

Flags such as --mcp-config, --settings, --plugin-dir and --add-dir are not restored and must be passed again.

Resuming a background session that is still running attaches to it instead (v2.1.285+).

Since 2.1.309, a name set with /rename survives VS Code reloads and non-interactive resume.

Find a past session

claude --resume or /resume opens a session picker for the current worktree; type to search, Space to preview, Ctrl+R to rename, Ctrl+B to filter by branch, Ctrl+W for all worktrees and Ctrl+A for every project on the machine. Name sessions with claude -n <name> or /rename so claude --resume <name> finds them, and claude --from-pr <number|url> lists sessions linked to a pull request.

Sessions created with claude -p, the Agent SDK, or starting with /loop are hidden from the picker and --continue, but still resume by ID.

Export or share

Partly

/export copies the current conversation to the clipboard or saves it as a plain-text file (/export <filename> writes directly). There is no built-in Markdown, HTML or share link for local CLI sessions; for JSON use claude -p --output-format json or read the .jsonl file, and only cloud sessions on claude.ai/code can be shared by link with Private/Team/Public visibility.

/feedback, /bug and /share send a transcript to Anthropic as a report, not as a shareable link.

Read sessions from code

The Agent SDK exposes listSessions(), getSessionMessages(), getSessionInfo(), renameSession(), tagSession() and forkSession() in TypeScript (list_sessions(), get_session_messages() and friends in Python), plus resume/forkSession options and a sessionStore adapter for mirroring transcripts to your own storage. From the CLI, claude -p --output-format json or stream-json returns the result, session ID, usage and cost, and hooks and status line commands receive the live transcript_path.

Keeping and removing

QuestionClaude Codechecked at 2.1.299
How long they are kept

Current documentation describes 30-day default retention, minimum cleanupPeriodDays of 1, and guarded/paused sweeps when settings cannot be determined. Desktop/Cowork transcripts have separate exceptions and desktopSessionCleanupPeriodDays. Orphaned/superseded transcripts and session sidecars are separate artifacts; removing a background process with claude rm does not delete its transcript.

claude rm <id> on a background session leaves its transcript on disk.

The sweep is skipped with claude -p --bare and pauses if settings can't be parsed.

Don't save this session

Current documentation supports CLAUDE_CODE_SKIP_PROMPT_HISTORY to suppress transcripts and prompt history in all modes, and --no-session-persistence for -p runs. CLAUDE_CODE_TRANSCRIPT_LOCAL_GC separately limits non-interactive/SDK transcript growth. The TypeScript SDK offers persistSession:false; this is not a Python SDK option.

The Python Agent SDK has no persistSession option; use the environment variable.

CLAUDE_CODE_TRANSCRIPT_LOCAL_GC=1 instead trims long -p/SDK transcripts past 5 MB after each compaction.

Cloud sync and upload

Local CLI transcripts stay on your machine by default and --resume doesn't list cloud sessions. While Remote Control is connected, the session transcript is also stored on Anthropic servers to sync with claude.ai and the Claude app; cloud sessions on claude.ai/code are stored by Anthropic and can be pulled into a terminal copy with claude --teleport or /teleport. Transcripts are uploaded only when you send /feedback, /bug or /share, or answer Yes to the optional session-transcript survey (disable with CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY=1).

Turn Remote Control auto-connect off with remoteControlAtStartup: false or /config.

Teleport is one-way: work continued in the terminal isn't pushed back to the cloud session.

Notes and sources

Claude Code, 25 sources
  • Claude Code says the entry format is internal and can change between versions.
  • Prompt history (~/.claude/history.jsonl) is a different artifact.
  • 2.1.304 adds earlier tool names to compaction summaries in Ctrl+O, avoids storing auto-mode classifier context with every request, and fixes local transcript GC dropping messages when disk fills during trimming. Mods settings.read can impose a cleanupPeriodDays ceiling used by retention sweeps. These are publisher claims, not a new transcript schema audit.
  • 2026-10-26 automatic-approval audit: publisher docs show auto-mode denials and reasons alongside tool calls in the conversation/Ctrl+O viewer. This is not evidence for a stable JSONL classifier verdict record or a complete audit of approvals.
  • 2.1.304 publisher changelog says classifier context is no longer saved with every request. Older transcripts may therefore contain more classifier context. Remaining private metadata/decision fields are not exhaustively specified or claimed absent.
  • For documented machine-readable classifier decisions use separately configured OpenTelemetry tool_decision: classifier_verdict and permission_mode (2.1.301+), and optional classifier_category with OTEL_LOG_TOOL_DETAILS=1. safety_event (2.1.307–2.1.311; no longer sent from 2.1.312) recorded blocked/prompted checks, not every successful classifier allow. Telemetry is not the session transcript. See docs/research/automatic-approval.md.
  • 2.1.311 publisher fixes out-of-order or retracted messages retained by -p/SDK transcripts. JSON/stream-json now escape DEL, C1 controls and Unicode format characters as \uXXXX without changing parsed values. 2.1.310 fixes cleanup of recent files with very large cleanupPeriodDays; a large value does not disable retention.
  • 2.1.312 publisher fixes a rare case where the first reply after a terminal resume could be missing when the session was resumed again, and makes transcripts name the effort level in force rather than a newly picked level the model has not applied yet. Not a new JSONL schema audit.
  • Documentation checked 2026-11-15 against latest 2.1.325 / stable 2.1.311 release metadata. Detailed internal shapes remain the historical 2.1.310 survey (high-level observedVersion 2.1.299); readable implementation JavaScript has now been located in the installed native executable; the 2.1.325 source supplement traces selected fields and storage policies. The four-field implementation supplement is not a complete 2.1.325 schema or controlled runtime verification.
  • 2026-11-15 aggregate-only existing-record survey found 1,769 version-matched 2.1.325 records across five files. Ten record/subtype families and top-level/message field types were retained without content. Unversioned metadata in these mixed files is counted separately and cannot be attributed to 2.1.325. This supplements the 2.1.310 full survey; it is not a controlled writer/resume probe or an exhaustive current schema.
  • Installed 2.1.325 source correction: the native executable embeds readable JavaScript alongside bytecode/string tables. Static extraction recovered transcript constructors, write routing and GC policy tables plus four field definitions. See docs/research/evidence/claude-transcript-source-2.1.325.json and its partial JSON Schema. Keep the older full catalogue version pin; these are explicitly current source supplements.
  • Expanded 2.1.325 installed-source supplement: 46 write/read/GC policy registrations plus repl-mode special handling, six previously uncatalogued metadata families, and actual cost-state validator projection with eight passing isolated checks. Do not treat constructor candidates or normalized-reader shapes as complete runtime input schemas.
Where sessions are saved, 5
Subagent and forked sessions, 5
Prompt history, 3
Resume or continue, 6
Find a past session, 4
Export or share, 6
Read sessions from code, 8
How long they are kept, 3
Don't save this session, 4
Cloud sync and upload, 5