Harness Notes

Transcript format

Updated 2026-11-22,

On this page

The complete on-disk format of each harness’s session transcripts: every file a session writes, every record type and field, and how to rebuild the conversation from them. Where sessions live and how to resume, export or delete them is on the Transcripts page. Examples use placeholder values.

At a glance

QuestionCursor Agent2026.10.12-d47ca18
SpecificationNo published schema or source; read from the installed build
Transcript file~/.cursor/projects/<slug>/agent-transcripts/<chatId>/<chatId>.jsonl
StorageOne SQLite database per chat (store.db, WAL mode). Table meta holds one row whose value is hex-encoded JSON; table blobs maps a SHA-256 id to bytes that are protobuf messages, JSON prompt messages or raw file contents. A simplified JSON Lines copy is written per project.
Record type fieldBlobs carry no type tag: a blob's type follows from the field that references it, starting at latestRootBlobId in meta. Inside protobuf messages, oneof cases pick the variant; inside JSON prompt messages, role then content[].type. In the JSON Lines copy, type when present, otherwise role.
Size24 record types, 9 content blocks

Records by purpose

Cursor Agent 2026.10.12-d47ca18

No published schema or source; read from the installed build. One SQLite database per chat (store.db, WAL mode). Table meta holds one row whose value is hex-encoded JSON; table blobs maps a SHA-256 id to bytes that are protobuf messages, JSON prompt messages or raw file contents. A simplified JSON Lines copy is written per project.

Files

~/.cursor/ (moves with CURSOR_CONFIG_DIR, else $XDG_CONFIG_HOME/cursor)CLI config root; chats/ and acp-sessions/ live under it.
~/.cursor/chats/<md5hex(path.resolve(cwd))>/Per-workspace folder; name is the lowercase hex MD5 of the resolved absolute working directory (no trailing-slash normalisation beyond path.resolve).
~/.cursor/chats/<md5>/<chatId>/One folder per chat; <chatId> is a v4 UUID equal to meta.agentId. Deleted automatically on dispose if the chat has no root and no blobs.
~/.cursor/chats/<md5>/<chatId>/store.db (+ store.db-wal, store.db-shm)SQLite (WAL mode, user_version=1) with tables meta(key TEXT PK, value TEXT) and blobs(id TEXT PK, data BLOB). Holds the whole conversation as a content-addressed blob graph rooted at meta.latestRootBlobId. This is the source of truth.
~/.cursor/chats/<md5>/<chatId>/meta.jsonListing sidecar for the resume picker: {schemaVersion:1, createdAtMs, updatedAtMs?, hasConversation, title?, isSubagent?, cwd?}. Derived from store.db metadata; backfilled from store.db if missing.
~/.cursor/chats/<md5>/<chatId>/prompt_history.jsonUp-arrow input history for this chat: a JSON array of strings, newest first, de-duplicated, max 500.
~/.cursor/projects/<slug(cwd)>/ (moves with CURSOR_DATA_DIR)Project data dir shared with the Cursor editor; slug = cwd with every non-alphanumeric run replaced by '-', leading/trailing '-' trimmed. Also holds editor/CLI data unrelated to transcripts (mcps/, terminals/, canvases/, rules/, repo.json, worker.log, ...).
~/.cursor/projects/<slug>/agent-transcripts/<chatId>/<chatId>.jsonlLossy, human-oriented JSONL mirror regenerated from store.db's prompt-message JSON blobs: user/assistant lines plus turn_ended lines. No tool results, no system prompt, no ids. <chatId> is encodeURIComponent'd with '%' -> '_' and truncated to 200 chars.
~/.cursor/projects/<slug>/agent-transcripts/<parentChatId>/subagents/<subagentId>.jsonlSame JSONL mirror for each subagent found in the parent root's subagent_states / subagent_state_refs.
~/.cursor/projects/<slug>/agent-transcripts/<chatId>.jsonl | .txt (legacy flat layout)Legacy path still probed by readers (paths.pr includeLegacy); a .txt rendering exists in the writer but the CLI configures writeText:false.
~/.cursor/projects/<slug>/terminals/<n>.txtShell output files referenced from shell tool results (terminalsFolder / outputLocation.filePath). Not part of the blob graph.
~/.cursor/acp-sessions/<sessionId>/meta.json (+ store.db)Sessions created through agent acp: same store.db format at acp-sessions/<id>/store.db plus meta.json {schemaVersion:1, cwd, title?}.

Fields on every record

Record type is chosen by Blobs carry no type tag: a blob's type follows from the field that references it, starting at latestRootBlobId in meta. Inside protobuf messages, oneof cases pick the variant; inside JSON prompt messages, role then content[].type. In the JSON Lines copy, type when present, otherwise role..

FieldTypeMeaning
blobs.idstring (64 hex)SHA-256 of blobs.data, lowercase hex. Root blobs are hashed by the CLI; other blob ids are chosen by the server
blobs.databytesPayload. Type is NOT stored; it is implied by which field references the blob. Heuristic: first byte '{' => JSON prompt message (or raw file that happens to be JSON); otherwise protobuf or raw bytes.
meta['0']string (hex of UTF-8 JSON)Chat metadata object; see record 'meta / 0'.

Records (24)

meta / '0'

Chat metadata: id, title, mode, timestamps and the pointer to the current conversation root.

Written created on store open (defaults), rewritten (INSERT OR REPLACE, debounced via microtask) whenever any key changes, e.g. after every checkpoint.

FieldTypeMeaning
agentIdstring (uuid)Chat id; equals the chat folder name.
latestRootBlobIdstring (64 hex) | ''Blob id of the current ConversationStateStructure root. Empty string when the chat never got a checkpoint.
namestringChat title; default 'New Agent'; forks get '<name> (forked)'.
createdAtnumber (ms epoch)Creation time (readers normalise seconds/micro/nanoseconds too).
modeenum(default|plan|debug|search)UI mode; legacy 'auto-run' is read as default + isRunEverything=true. Values include default, search.
isRunEverythingbooleanAuto-run/yolo flag.
approvalModeoptionalenum(allowlist|unrestricted|auto-review)Approval policy. Values include unrestricted.
lastUsedModeloptionalstringModel id last used.
lastDebugServerPortoptionalintegerDebug-mode server port.
currentPlanUrioptionalstringPlan file URI in plan mode.
subagentInfooptionalobject {parentAgentId, rootParentAgentId, toolCallId, typeName}Set when this store belongs to a subagent run with its own store.
blobEncryptionKeyoptionalstring (64 hex)Random 32-byte key generated in defaults by this build; its purpose is not known.
{"agentId":"00000000-0000-4000-8000-000000000001","latestRootBlobId":"aa…(64 hex)","name":"Example chat","mode":"default","isRunEverything":false,"createdAt":1760000000000,"lastUsedModel":"example-model"} (stored as hex of this JSON)

Value is hex-encoded: bytes.fromhex(value).decode('utf-8') then JSON.parse.

Keys outside the zod schema are dropped on load.

blob: agent.v1.ConversationStateStructure (root checkpoint)

The conversation checkpoint: ordered lists of blob ids for the model prompt and for UI turns, plus todos, token budget, file snapshots, subagents and compaction state.

Written every checkpoint the server streams (AgentServerMessage.conversation_checkpoint_update) is serialized, SHA-256 hashed and stored as a new blob; meta.latestRootBlobId is then pointed at it. Older roots are never deleted.

FieldTypeMeaning
1 root_prompt_messages_jsonoptionalrepeated bytes (blob ids)Ordered ids of JSON prompt-message blobs = the exact model context (system, user, assistant, tool). Primary source for a faithful transcript.
8 turnsoptionalrepeated bytes (blob ids)Ordered ids of ConversationTurnStructure blobs (UI/turn view).
3 todosoptionalrepeated bytes (blob ids)TodoItem blobs.
4 pending_tool_callsoptionalrepeated stringTool call ids still awaiting a result.
5 token_detailsoptionalConversationTokenDetails {1 used_tokens u32, 2 max_tokens u32, 3 breakdown PromptTokenBreakdownSnapshot{total_used_tokens,max_tokens,categories[{id,label,character_count,estimated_tokens}]}, 4 prompt_context_usage_tree}Context-window occupancy snapshot (not billing usage).
6 summaryoptionalbytes (blob id)ConversationSummary blob {1 summary string}.
7 planoptionalbytes (blob id)Plan blob; payload type not traced (opaque).
9 previous_workspace_urisoptionalrepeated stringWorkspace URIs used earlier.
10 modeoptionalenum AgentModeAGENT_MODE_{UNSPECIFIED=0,AGENT=1,ASK=2,PLAN=3,DEBUG=4,TRIAGE=5,MULTITASK=7,CUSTOM=8}.
11 summary_archiveoptionalbytes (blob id)Legacy single archive pointer.
12 file_statesoptionalmap<string path, bytes blob id>Legacy file snapshot map.
13 summary_archivesoptionalrepeated bytes (blob ids)ConversationSummaryArchive blobs, one per compaction.
14 turn_timingsoptionalrepeated StepTiming {1 duration_ms u64, 2 timestamp_ms u64}Per-turn timings.
15 file_states_v2optionalmap<string path, FileStateStructure {1 content bytes?, 2 initial_content bytes?}>Per-file snapshots; both fields are 32-byte blob ids of raw file bytes. Used by rewind to restore files.
16 subagent_statesoptionalmap<string subagentId, SubagentPersistedState>Inline subagent conversations (each has its own nested ConversationStateStructure).
17 self_summary_countoptionaluint32Number of self-summarisations.
18 read_pathsoptionalrepeated stringPaths the agent has read (contains user paths).
19 active_branch_nameoptionalstring—
20 plansoptionalmap<string, PlanRegistryEntry {1 id, 2 path}>—
21 tracked_git_repo_branchesoptionalrepeated TrackedGitRepo {1 repo_path, 2 branch_name}—
22 agent_typeoptionalstringValues include on every current-format root.
23 communicate_update_history / 25 communicate_update_final_summary / 28 communicate_update_completed_subtitle / 29 communicate_update_states_by_parent_tool_call_idoptionalvariousProgress-update tool state (cloud/background agents).
24 subagent_threadsoptionalmap<string,string>—
26 conversation_started_timestamp_msoptionaluint64—
27 conversation_started_time_zoneoptionalstringIANA zone.
30 subagent_runs_by_parent_tool_call_idoptionalmap<string, SubagentRunState {parent_tool_call_id, subagent_id?, environment, status SubagentRunStatus, title?, detail?, transcript_path?, output_path?, completed_timestamp_ms?, completion_reason?}>SubagentRunStatus: UNSPECIFIED, RUNNING, BACKGROUNDED, SUCCESS, ERROR, ABORTED.
31 subagent_state_refsoptionalmap<string subagentId, bytes blob id>Out-of-line SubagentPersistedState blobs (newer alternative to field 16).
32 goal_stateoptionalGoalState—
33 is_root_project_conversationoptionalbool—
34 completed_ask_question_tool_call_idsoptionalrepeated string—
35 durable_skill_blocks / 36 durable_custom_mode_idoptionalrepeated string / string—
37 message_count_at_last_compactionoptionaluint32—
38 recent_user_message_ids / 39 recent_user_message_ids_older_turn_countoptionalrepeated string / uint32—
40 turn_telemetryoptionalTurnTelemetryState {completed_turn_count_capped, last_completed_turn_timestamp_ms?}—
42 mentioned_agent_idsoptionalrepeated string—
2 (unknown)optionallength-delimitedField number 2 is absent from this build's descriptor but present in older roots: a removed field. Skip unknown fields.
(protobuf) {root_prompt_messages_json:[<32B>,<32B>], turns:[<32B>], token_details:{used_tokens:12000,max_tokens:200000}, mode:AGENT_MODE_AGENT, agent_type:"example"}

Field order in the descriptor is not numeric; decode by field number.

blob: agent.v1.ConversationTurnStructure / agent_conversation_turn

One user turn: pointer to the user message and ordered pointers to the assistant steps it produced.

Written written by the server when a turn starts and re-written (new blob id) as steps are appended.

FieldTypeMeaning
1 agent_conversation_turn.1 user_messagebytes (blob id)UserMessage blob.
…2 stepsoptionalrepeated bytes (blob ids)ConversationStep blobs in order.
…3 request_idoptionalstring (uuid)Server request id; matches JSON user message providerOptions.cursor.requestId.
…4 encrypted_modeloptionalstringOpaque encrypted model identifier (258/263 turns).
…5 dynamic_tool_count / 9 dynamic_tool_namesoptionaluint32 / repeated string—
…6 send_message_step_indices / 13 assistant_text_step_indices / 14 assistant_text_steps_recordedoptionalrepeated uint32 / boolIndices into steps.
…7 routed_model_display_nameoptionalstringDisplay name when auto-routed.
…8 subagent_dispatch_stepsoptionalrepeated SubagentDispatchStep {step_index, tool_call_id, tool, backgrounded}—
…10 user_message_idoptionalstring—
…11 long_reasoning_reminder / 12 long_reasoning_reminder_exposure_loggedoptionalmessage / bool—
(protobuf) {agent_conversation_turn:{user_message:<32B>, steps:[<32B>,<32B>], request_id:"00000000-0000-4000-8000-000000000002"}}

blob: agent.v1.ConversationTurnStructure / shell_conversation_turn

A user-run shell command turn (shell mode), stored as two blobs: command and output.

Written when the user runs a shell command directly instead of prompting the agent.

Stored only user shell-mode commands

FieldTypeMeaning
2 shell_conversation_turn.1 shell_commandbytes (blob id)ShellCommand {1 command string}.
…2 shell_outputbytes (blob id)ShellOutput {1 stdout, 2 stderr, 3 exit_code int32}.
(protobuf) {shell_conversation_turn:{shell_command:<32B>, shell_output:<32B>}}

blob: agent.v1.UserMessage

The user's prompt as typed, with mode, attached context and the id of the root checkpoint that preceded it.

Written once per turn.

FieldTypeMeaning
1 textstringRaw prompt text (without the <user_query> wrapper used in the JSON prompt message).
2 message_idstring (uuid)—
3 selected_contextoptionalSelectedContextAttached context: selected_images[] (SelectedImage {oneof data_or_blob_id: 1 blob_id | 8 data | 9 blob_id_with_data | 10 prompt_upload_ref; uuid, path, dimension, mime_type}), files, code_selections, terminals, folders, external_links, cursor_rules, git diffs/commits, past_chats, pull requests, subagents, browsers, documents, skills, … (28 fields).
4 modeenum AgentModeValues include AGENT, ASK.
5 is_simulated_msg / 9 simulated_msg_reason / 15 simulated_message_metadataoptionalbool / enum SimulatedMsgReason (35 values) / messageSystem-injected 'user' messages (e.g. BACKGROUND_TASK_COMPLETION, PLAN_EXECUTION, USER_QUEUED_TO_SUBAGENT, GOAL_CONTINUATION).
10 conversation_state_blob_idbytes (blob id)Root checkpoint as it was before this turn; used as the rewind anchor.
17 thread_idoptionalstring—
18 text_blob_id / 19 rich_text_blob_idoptionalbytes (blob id)Out-of-line large text.
8 rich_textoptionalstring—
21 hook_additional_contextsoptionalrepeated HookAdditionalContext {hook_event_name, content}Context added by hooks.
24 turn_steeroptionalboolMessage sent while the agent was running (steering).
25 started_at_ms / 26 completed_at_msoptionaluint64—
27 sent_by_agent_id / 29 sender / 28 sent_by_voice_call / 30 forked_context / 31 reply_tooptionalvariousAgent-to-agent and multi-agent provenance.
6,7,11,13,14,16,22,23optionalvariousbest_of_n_group_id, try_use_best_of_n_promotion, subagent_system_reminder, triggering_user_info, execute_plan_info, prompt_reference_id, custom_mode_intent, project_details.
(protobuf) {text:"Example prompt", message_id:"00000000-0000-4000-8000-000000000003", mode:AGENT_MODE_AGENT, conversation_state_blob_id:<32B>, thread_id:"…"}

blob: agent.v1.ConversationStep / assistant_message

A visible assistant text segment.

Written per assistant text output within a turn.

FieldTypeMeaning
1 assistant_message.1 textstring—
…2 started_at_ms / 3 completed_at_msoptionaluint64—
(protobuf) {assistant_message:{text:"Done."}}

blob: agent.v1.ConversationStep / thinking_message

A reasoning step as shown in the UI.

Written per reasoning block.

FieldTypeMeaning
3 thinking_message.1 textstringOften empty or summary text when the provider redacts reasoning.
…2 duration_msuint32—
…3 started_at_ms / 4 completed_at_msoptionaluint64—
(protobuf) {thinking_message:{text:"", duration_ms:1200}}

blob: agent.v1.ConversationStep / tool_call

A tool invocation with its structured arguments AND result in one message (ToolCall oneof tool, 68 cases).

Written re-written (new blob) as the call progresses from started to completed; the turn's steps list is updated to the newest id.

FieldTypeMeaning
2 tool_call.<case>oneof toolOne of: shell_tool_call, delete_tool_call, glob_tool_call, grep_tool_call, read_tool_call, update_todos_tool_call, read_todos_tool_call, edit_tool_call, ls_tool_call, read_lints_tool_call, mcp_tool_call, sem_search_tool_call, create_plan_tool_call, web_search_tool_call, task_tool_call, list_mcp_resources_tool_call, read_mcp_resource_tool_call, apply_agent_diff_tool_call, ask_question_tool_call, fetch_tool_call, switch_mode_tool_call, generate_image_tool_call, record_screen_tool_call, computer_use_tool_call, write_shell_stdin_tool_call, reflect_tool_call, setup_vm_environment_tool_call, truncated_tool_call, start_grind_execution_tool_call, start_grind_planning_tool_call, web_fetch_tool_call, report_bugfix_results_tool_call, ai_attribution_tool_call, pr_management_tool_call, mcp_auth_tool_call, await_tool_call, blame_by_file_path_tool_call, get_mcp_tools_tool_call, report_bug_tool_call, set_active_branch_tool_call, communicate_update_tool_call, send_final_summary_tool_call, replace_env_tool_call, edit_pr_labels_tool_call, record_ci_investigation_findings_tool_call, send_message_tool_call, fetch_cloud_agent_data_tool_call, send_to_user_tool_call, pi_read_tool_call, pi_bash_tool_call, pi_edit_tool_call, pi_write_tool_call, pi_grep_tool_call, pi_find_tool_call, pi_ls_tool_call, connect_scm_tool_call, search_conversations_tool_call, create_goal_tool_call, update_goal_tool_call, get_agent_status_tool_call, send_to_agent_tool_call, read_agent_transcript_tool_call, create_agent_tool_call, stop_agent_tool_call, write_canvas_tool_call, read_canvas_tool_call, generate_video_tool_call, x_search_tool_call. Each case is a <Name>ToolCall {1 args <Name>Args, 2 result <Name>Result} (some add description etc.).
…<case>.resultoptionaloneof resultTypical cases: success | error | rejected | failure | timeout | spawn_error | permission_denied (shell). Absent while pending.
…57 tool_call_idoptionalstringe.g. 'tool_<uuid>'; equals JSON tool-call toolCallId.
…59 started_at_ms / 60 completed_at_msoptionaluint64—
…54 hook_additional_contextsoptionalrepeated HookAdditionalContext—
(protobuf) {tool_call:{read_tool_call:{args:{path:"src/example.ts"}, result:{success:{path:"src/example.ts", total_lines:10, content:"…"}}}, tool_call_id:"tool_00000000-0000-4000-8000-000000000004"}}

Edit results carry before_full_file_content and after_full_file_content (whole files).

ReadToolSuccess may hold content inline or as content_blob_id (raw bytes blob).

TaskSuccess.conversation_steps embeds the subagent's ConversationSteps inline.

blob: agent.v1.TodoItem

One todo-list entry.

Written when the todo tool updates the list.

Stored only todo tool used

FieldTypeMeaning
1 idstring—
2 contentstring—
3 statusenum TodoStatus(UNSPECIFIED,PENDING,IN_PROGRESS,COMPLETED,CANCELLED)—
4 created_at / 5 updated_atint64 ms—
6 dependenciesoptionalrepeated string—
(protobuf) {id:"1", content:"Write tests", status:TODO_STATUS_PENDING, created_at:1760000000000, updated_at:1760000000000}

blob: agent.v1.ConversationSummary

Running conversation summary text.

Written after summarisation.

Stored only summarisation

FieldTypeMeaning
1 summarystring—
(protobuf) {summary:"Summary of earlier work"}

blob: agent.v1.ConversationSummaryArchive

Archive of the prompt messages replaced by a compaction, plus the summary that replaced them.

Written on /summarize or automatic summarisation; appended to root.summary_archives.

Stored only compaction

FieldTypeMeaning
1 summarized_messagesrepeated bytes (blob ids)The JSON prompt-message blobs that were compacted away.
2 summarystring—
3 window_tailuint32Number of trailing messages kept.
4 summary_messagebytes (blob id)JSON prompt message carrying the summary (providerOptions.cursor.isSummary=true).
(protobuf) {summarized_messages:[<32B>,<32B>], summary:"…", window_tail:4, summary_message:<32B>}

blob: agent.v1.SubagentPersistedState

A subagent's own conversation state, keyed by subagent id from the parent root.

Written when a Task/subagent runs; inline in root field 16 or out-of-line via field 31.

Stored only subagents

FieldTypeMeaning
1 conversation_stateConversationStateStructureSame structure as the parent; its blob ids live in the parent's store.db.
2 created_timestamp_ms / 3 last_used_timestamp_msuint64—
4 subagent_typeSubagentType (oneof type: unspecified | custom{name} | …)—
5 model_idoptionalstring—
6 environmentSubagentExecutionEnvironment—
7 cloud_subagentoptionalCloudSubagentReference {bc_id, transcript_path?}—
8 first_class_bc_id / 9 cloud_requested_environment_build_id / 10 machineoptionalstring / string / TargetMachine—
(protobuf) {conversation_state:{…}, created_timestamp_ms:1760000000000, last_used_timestamp_ms:1760000005000, subagent_type:{unspecified:{}}, model_id:"example-model"}

blob: raw file content

Raw bytes of a file snapshot (FileStateStructure.content / initial_content) or of read-tool output (ReadToolSuccess.content_blob_id), or image data (SelectedImage.blob_id).

Written when the agent edits/reads files; used by rewind to restore files.

Stored only file edits/reads

FieldTypeMeaning
(whole blob)bytesNo envelope. May itself be valid JSON (e.g. a package.json) - do not classify by first byte alone.
(raw bytes) export const example = 1;\n

blob: superseded root checkpoints and steps (unreachable)

Older ConversationStateStructure roots and superseded turn/step/user-message blobs that the latest root no longer references.

Written every checkpoint leaves the previous root in place; steps re-written with new content leave the old blob.

FieldTypeMeaning
(whole blob)bytesSame formats as above.
(protobuf) older ConversationStateStructure

Previous roots are still meaningful: UserMessage.conversation_state_blob_id points at them for rewind.

blob: prompt message JSON / role=system

The system prompt sent to the model.

Written first entry of root_prompt_messages_json.

FieldTypeMeaning
role"system"—
contentstring—
{"role":"system","content":"You are an AI coding assistant."}

blob: prompt message JSON / role=user

A user-role model message: either injected context (<user_info>, <system_reminder>, <system_notification>, <timestamp> …) or the user's query wrapped in <user_query> tags.

Written per user turn, plus context injections.

FieldTypeMeaning
role"user"—
contentstring | array of content partsString for the initial <user_info> context; array of text parts for queries.
providerOptions.cursor.requestIdoptionalstring (uuid)On query messages; equals AgentConversationTurnStructure.request_id.
providerOptions.cursor.requestContextCompletenessoptionalobject<string,bool> {agentSkills, customSubagents, env, gitRepos, gitStatus, mcp, mcpFileSystem, repositoryInfo, rules}On the context message.
providerOptions.cursor.isSummaryoptionalbooleantrue on compaction summary messages; JSONL writer skips them.
{"role":"user","content":[{"type":"text","text":"<user_query>\nExample prompt\n</user_query>"}],"providerOptions":{"cursor":{"requestId":"00000000-0000-4000-8000-000000000002"}}}

blob: prompt message JSON / role=assistant

One model response message: reasoning, text and tool calls.

Written per model response (one per LLM call within a turn).

FieldTypeMeaning
role"assistant"—
idstringShort per-request counter-like id (Values include 1-char strings); not globally unique.
contentarray of parts (redacted-reasoning | reasoning | text | tool-call)—
providerOptions.cursor.pendingToolCallStartedAtMsoptionalnumberValues include on 3 messages.
{"role":"assistant","id":"1","content":[{"type":"redacted-reasoning","data":"ZXhhbXBsZQ==","providerOptions":{"cursor":{"modelName":"example-model"}}},{"type":"text","text":"Reading the file."},{"type":"tool-call","toolCallId":"tool_00000000-0000-4000-8000-000000000004","toolName":"Read","args":{"path":"src/example.ts"}}]}

blob: prompt message JSON / role=tool

The result of exactly one tool call as sent back to the model, plus the structured result as JSON.

Written after each tool call completes.

FieldTypeMeaning
role"tool"—
idstringEquals the toolCallId (5,861/5,863).
contentarray with one tool-result part—
providerOptions.cursor.highLevelToolCallResultoptionalobject {output: <camelCase JSON of the protobuf <Name>Result oneof, e.g. {success:{...}} | {failure:{...}} | {rejected:{...}} | {error:{...}}, plus isBackground, terminalsFolder, sandboxPolicy}, isError: bool, rawErrorMessages?: string[]}Structured result (same data as ToolCall.result in the step blob).
{"role":"tool","id":"tool_00000000-0000-4000-8000-000000000004","content":[{"type":"tool-result","toolCallId":"tool_00000000-0000-4000-8000-000000000004","toolName":"Read","result":"1|export const example = 1;","experimental_content":[{"type":"text","text":"1|export const example = 1;"}]}],"providerOptions":{"cursor":{"highLevelToolCallResult":{"output":{"success":{"path":"src/example.ts","totalLines":1}},"isError":false}}}}

jsonl / role=user

A user prompt in the readable mirror.

Written appended when the corresponding prompt-message JSON blob appears in the root.

FieldTypeMeaning
role"user"—
message.content[]array of {type:'text', text}Single text part; context tags (user_info, rules, system_reminder, git_status, attached_files, …24 tags) are stripped; <user_query> wrapper is kept.
{"role":"user","message":{"content":[{"type":"text","text":"<user_query>\nExample prompt\n</user_query>"}]}}

If the first two non-system messages are both user, the first (the <user_info> context) is dropped.

jsonl / role=assistant

One assistant prompt message flattened: text (+thinking) then tool_use parts.

Written appended per assistant prompt message.

FieldTypeMeaning
role"assistant"—
message.content[]array of text | tool_useFirst part: text = visible text and thinking joined by blank line; redacted reasoning becomes the literal '[REDACTED]'; <think>/<thinking> tags removed. Then one {type:'tool_use', name, input} per tool call.
{"role":"assistant","message":{"content":[{"type":"text","text":"[REDACTED]\n\nReading the file."},{"type":"tool_use","name":"Read","input":{"path":"src/example.ts"}}]}}

jsonl / type=turn_ended

Marks the end of an agent turn with its outcome.

Written after each agent run completes, errors or is aborted.

Stored only survives only until the next full rewrite of the file; usually only the last turn's line remains

FieldTypeMeaning
type"turn_ended"—
statusenum(success|error|aborted)—
erroroptionalstringPresent for error and (optionally) aborted.
{"type":"turn_ended","status":"success"}

jsonl / type=metadata

Optional first line with a generated overview of the transcript.

Written only when the writer is given an overviewFactory (full write).

Stored only not configured by the CLI writer; other hosts may emit it

FieldTypeMeaning
type"metadata"—
metadata.overviewstring—
{"type":"metadata","metadata":{"overview":"Example overview"}}

meta.json

Resume-picker sidecar for a chat.

Written on chat creation and whenever name or latestRootBlobId changes; backfilled from store.db if absent.

Stored only written by newer builds

FieldTypeMeaning
schemaVersion1—
createdAtMsnumber—
updatedAtMsoptionalnumber—
hasConversationbooleanlatestRootBlobId non-empty.
titleoptionalstringChat name (omitted for default).
isSubagentoptionaltruePresent when meta.subagentInfo is set.
cwdoptionalstringAbsolute workspace path.
{"schemaVersion":1,"createdAtMs":1760000000000,"hasConversation":true,"title":"Example chat","updatedAtMs":1760000300000,"cwd":"/path/to/project"}

prompt_history.json

Per-chat input history (up-arrow).

Written when the user submits a prompt.

Stored only chat had typed prompts in an interactive build ≥ June 2026

FieldTypeMeaning
[]array of stringNewest first, de-duplicated after normalisation, max 500.
["Second prompt","First prompt"]

A global ~/.cursor/prompt_history.json from earlier builds may also exist.

Content blocks (9)

json part / text

Plain text in a user or assistant prompt message.

FieldTypeMeaning
type"text"—
textstring—
{"type":"text","text":"Hello"}

json part / redacted-reasoning

Provider-encrypted reasoning; content is not readable.

Written assistant messages from reasoning models.

FieldTypeMeaning
type"redacted-reasoning"—
datastring (opaque, base64-like)Opaque.
providerOptions.cursor.modelNameoptionalstringModel that produced it.
{"type":"redacted-reasoning","data":"ZXhhbXBsZQ==","providerOptions":{"cursor":{"modelName":"example-model"}}}

json part / reasoning

Readable reasoning text.

Written models that expose reasoning.

Stored conditional

FieldTypeMeaning
type"reasoning"—
textstring—
{"type":"reasoning","text":"Thinking about it"}

json part / tool-call

A tool invocation by the model.

FieldTypeMeaning
type"tool-call"—
toolCallIdstring'tool_<uuid>'.
toolNamestringModel-facing name: Read, StrReplace, Grep, Shell, Glob, Write, ReadLints, TodoWrite, SemanticSearch, Delete, WebFetch, AskQuestion, WebSearch, Task, ListMcpResources, Await, MCP tool names, … (may be null).
argsobjectJSON arguments.
{"type":"tool-call","toolCallId":"tool_00000000-0000-4000-8000-000000000004","toolName":"Grep","args":{"pattern":"example"}}

json part / tool-result

Model-visible tool output.

FieldTypeMeaning
type"tool-result"—
toolCallIdstring—
toolNamestring—
resultstring | object | numberUsually string; objects for MCP results; a number once.
experimental_contentoptionalarray of {type:'text', text}Multi-part version of result (5,866/5,869).
{"type":"tool-result","toolCallId":"tool_00000000-0000-4000-8000-000000000004","toolName":"Grep","result":"No matches","experimental_content":[{"type":"text","text":"No matches"}]}

json part / image

Image attached to a user message.

Stored conditional

FieldTypeMeaning
type"image"—
imageoptionalstring | {__type:'Uint8Array', hex}Byte arrays are stored as {__type:'Uint8Array',hex} to bytes; field names follow the AI SDK CoreMessage shape.
mimeTypeoptionalstringunknown
{"type":"image","image":{"__type":"Uint8Array","hex":"89504e47"},"mimeType":"image/png"}

Field names other than type are not established.

json part / file

File attached to a message.

Stored conditional

FieldTypeMeaning
type"file"—
filenameoptionalstringUsed by the writer.
data / mimeTypeoptionalunknown—
{"type":"file","filename":"example.pdf","mimeType":"application/pdf","data":{"__type":"Uint8Array","hex":"25504446"}}

jsonl part / text

Text in a JSONL mirror line.

FieldTypeMeaning
type"text"—
textstring—
{"type":"text","text":"Hello"}

jsonl part / tool_use

Tool call in a JSONL mirror assistant line (no id, no result).

FieldTypeMeaning
type"tool_use"—
namestring—
inputobject—
{"type":"tool_use","name":"Read","input":{"path":"src/example.ts"}}

Rebuilding the conversation

ordering
Do NOT order blobs by rowid or id. Start at meta.latestRootBlobId, decode ConversationStateStructure, and follow root_prompt_messages_json in array order for the model transcript, or turns[] -> user_message + steps[] in array order for the UI transcript. rowid changes on INSERT OR REPLACE.
message parent links
There are no parent pointers between messages; order is positional within the root's lists. A turn links to its UserMessage and steps by 32-byte blob ids (bytes fields), hex-encode them to look up blobs.id.
tool call ↔ result
JSON: assistant part tool-call.toolCallId == tool message content[0].toolCallId == tool message id. Protobuf: ToolCall.tool_call_id; args and result are in the same ToolCall message. JSONL: no ids and no results.
turns
Each ConversationTurnStructure is one user turn; its request_id matches the JSON user message providerOptions.cursor.requestId. JSONL marks turn end with type=turn_ended (often only the last).
subagents
Subagents share the parent's store.db. Walk root.subagent_states (inline) and root.subagent_state_refs (blob ids of SubagentPersistedState); each has its own ConversationStateStructure. Link to the parent call via subagent_runs_by_parent_tool_call_id / AgentConversationTurnStructure.subagent_dispatch_steps. JSONL mirrors go to agent-transcripts/<parent>/subagents/<id>.jsonl. A separate store with meta.subagentInfo {parentAgentId, rootParentAgentId, toolCallId, typeName} is also possible.
forks
/fork copies every blob into a new chat folder (new uuid) in the same workspace, sets the same latestRootBlobId, name '<name> (forked)' and a new createdAt. No parent-chat id is recorded, so lineage can only be reconstructed from shared blob ids/roots.
compaction
Compaction appends a ConversationSummaryArchive (summarized_messages blob ids + summary_message blob id + window_tail) to root.summary_archives and replaces the head of root_prompt_messages_json with a summary message flagged providerOptions.cursor.isSummary. Full history = concat(archives[].summarized_messages) + current root_prompt_messages_json minus system and isSummary messages (this is what the JSONL writer does).
resume
Resume opens the same store.db and reloads the root from latestRootBlobId; new turns append to the same lists and a new root is written.
branches/rewind
Each UserMessage.conversation_state_blob_id is the root before that turn. Rewind sets the root back to that blob (conversation) and optionally restores files from file_states_v2 content/initial_content blob ids. Rewound-away blobs stay in the table as unreachable rows.
sidecar references
File snapshots, read content and images are separate raw blobs referenced by 32-byte ids. Shell output files are referenced by path under ~/.cursor/projects/<slug>/terminals/. Subagent cloud transcripts by transcript_path strings.

Token usage

root.token_details.used_tokens / max_tokens
Current context-window occupancy vs limit at the checkpoint; not cumulative and not billing.
root.token_details.breakdown.categories[] {id,label,character_count,estimated_tokens}
Estimated per-category context breakdown (rules, tools, history …).
(not persisted) InteractionUpdate.turn_ended TurnEndedUpdate {input_tokens, output_tokens, cache_read_tokens, cache_write_tokens, reasoning_tokens, ended_at_ms}
Per-turn token usage exists only on the live stream / hooks; it is not written to store.db or JSONL. No cost field anywhere.

Versions

No format version inside blobs or JSONL. Signals: SQLite PRAGMA user_version=1 (set on every open by this build); meta.json schemaVersion=1; the CLI build is not recorded per chat. Protobuf is forward/backward compatible by field number: older roots carry a removed field 2 (seen in 113 local roots) and lack newer fields (e.g. agent_type, subagent_state_refs). Meta mode 'auto-run' is a legacy value mapped to default+isRunEverything. Because the server authors all non-root blobs, the JSON message shape can change independently of the CLI version. JSONL tool names CallDynamicTool/CallMcpTool appear only in older mirrors.

Parsing pitfalls

  • Blob type is not stored. Decode by graph position from the root; a first-byte heuristic ('{' => JSON) misclassifies raw file snapshots that are JSON (package.json, tsconfig) and scanning for 0x0a/0x12+0x20 reference markers can produce false references.
  • Most rows are dead: every checkpoint writes a new root and never deletes the old one (≈9.4k of 28.8k local blobs are stale roots). Walking 'all blobs' double-counts messages.
  • Two parallel transcripts live in one DB: root_prompt_messages_json (model context JSON, includes tool results and the system prompt) and turns (protobuf UI steps with structured args/results and timings). They are not 1:1 (one assistant JSON message per LLM call vs one step per text/thinking/tool segment).
  • Blob ids in protobuf are raw 32-byte values; blobs.id is their lowercase hex. latestRootBlobId in meta is already hex.
  • meta.value is hex-encoded JSON, not JSON.
  • Open with WAL: copy store.db + -wal + -shm together, or open read-only with immutable=1 when -shm is missing; opening mode=ro without -shm fails ('unable to open database file').
  • The JSONL mirror is not append-only: the writer rewrites the whole file after compaction, after a turn_ended write, or when the prefix changes (rewind), so older turn_ended lines disappear and lines can change.
  • JSONL drops: system prompt, tool results, ids, timestamps, isSummary messages, the leading <user_info> message, and context tags inside user text; redacted reasoning is merged into the text part as '[REDACTED]'.
  • Edit tool results embed full before/after file contents; read_paths and file_states_v2 keys are absolute user paths - treat the DB as sensitive.
  • JSONL files can outlive their chat folder: deleting from the picker removes only ~/.cursor/chats/.../<chatId>.
  • Forks copy every blob and record no parent id.
  • Chats without a checkpoint have latestRootBlobId '' and may have no meta.json.
  • 2026-11-15 packaged-source supplement for CLI 2026.11.13-eacade1 (archive SHA-256 087220ccf1e124dcdf2753601422892042a45a2c577ef0ea25b8a5b0e47bb691): CLI chat store.db still uses SQLite blobs/meta and binary metadata; ACP independently uses acp-sessions/<id>/store.db plus meta.json. The SQLite driver can degrade to an in-memory store after failures, so successful continuation alone does not prove durable writes. The detailed record/blob survey remains pinned to 2026.10.12-d47ca18; no current runtime transcript probe or desktop survey was run.

Sources

Cursor Agent