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
| Question | Cursor Agent2026.10.12-d47ca18 |
|---|---|
| Specification | No published schema or source; read from the installed build |
| Transcript file | ~/.cursor/projects/<slug>/agent-transcripts/<chatId>/<chatId>.jsonl |
| Storage | 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. |
| Record type field | 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. |
| Size | 24 record types, 9 content blocks |
Records by purpose
| Records | Cursor Agent2026.10.12-d47ca18 |
|---|---|
| Session | |
| Session header | |
| Title | |
| Model, directory and settings | |
| Forks and subagents | |
| Files and workspace state | |
| Conversation | |
| User message | |
| Assistant message | |
| System and injected context | |
| Reasoning | |
| Images, files and attachments | |
| Queued and steered input | |
| Tools | |
| Tool call | |
| Tool result | |
| Turns | |
| Turn starts | |
| Turn ends | |
| Context and accounting | |
| Compaction | |
| Summaries | |
| Other records | |
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.json | Listing 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.json | Up-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>.jsonl | Lossy, 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>.jsonl | Same 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>.txt | Shell 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..
| Field | Type | Meaning |
|---|---|---|
blobs.id | string (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.data | bytes | Payload. 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.
| Field | Type | Meaning |
|---|---|---|
agentId | string (uuid) | Chat id; equals the chat folder name. |
latestRootBlobId | string (64 hex) | '' | Blob id of the current ConversationStateStructure root. Empty string when the chat never got a checkpoint. |
name | string | Chat title; default 'New Agent'; forks get '<name> (forked)'. |
createdAt | number (ms epoch) | Creation time (readers normalise seconds/micro/nanoseconds too). |
mode | enum(default|plan|debug|search) | UI mode; legacy 'auto-run' is read as default + isRunEverything=true. Values include default, search. |
isRunEverything | boolean | Auto-run/yolo flag. |
approvalModeoptional | enum(allowlist|unrestricted|auto-review) | Approval policy. Values include unrestricted. |
lastUsedModeloptional | string | Model id last used. |
lastDebugServerPortoptional | integer | Debug-mode server port. |
currentPlanUrioptional | string | Plan file URI in plan mode. |
subagentInfooptional | object {parentAgentId, rootParentAgentId, toolCallId, typeName} | Set when this store belongs to a subagent run with its own store. |
blobEncryptionKeyoptional | string (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.
| Field | Type | Meaning |
|---|---|---|
1 root_prompt_messages_jsonoptional | repeated 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 turnsoptional | repeated bytes (blob ids) | Ordered ids of ConversationTurnStructure blobs (UI/turn view). |
3 todosoptional | repeated bytes (blob ids) | TodoItem blobs. |
4 pending_tool_callsoptional | repeated string | Tool call ids still awaiting a result. |
5 token_detailsoptional | ConversationTokenDetails {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 summaryoptional | bytes (blob id) | ConversationSummary blob {1 summary string}. |
7 planoptional | bytes (blob id) | Plan blob; payload type not traced (opaque). |
9 previous_workspace_urisoptional | repeated string | Workspace URIs used earlier. |
10 modeoptional | enum AgentMode | AGENT_MODE_{UNSPECIFIED=0,AGENT=1,ASK=2,PLAN=3,DEBUG=4,TRIAGE=5,MULTITASK=7,CUSTOM=8}. |
11 summary_archiveoptional | bytes (blob id) | Legacy single archive pointer. |
12 file_statesoptional | map<string path, bytes blob id> | Legacy file snapshot map. |
13 summary_archivesoptional | repeated bytes (blob ids) | ConversationSummaryArchive blobs, one per compaction. |
14 turn_timingsoptional | repeated StepTiming {1 duration_ms u64, 2 timestamp_ms u64} | Per-turn timings. |
15 file_states_v2optional | map<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_statesoptional | map<string subagentId, SubagentPersistedState> | Inline subagent conversations (each has its own nested ConversationStateStructure). |
17 self_summary_countoptional | uint32 | Number of self-summarisations. |
18 read_pathsoptional | repeated string | Paths the agent has read (contains user paths). |
19 active_branch_nameoptional | string | — |
20 plansoptional | map<string, PlanRegistryEntry {1 id, 2 path}> | — |
21 tracked_git_repo_branchesoptional | repeated TrackedGitRepo {1 repo_path, 2 branch_name} | — |
22 agent_typeoptional | string | Values 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_idoptional | various | Progress-update tool state (cloud/background agents). |
24 subagent_threadsoptional | map<string,string> | — |
26 conversation_started_timestamp_msoptional | uint64 | — |
27 conversation_started_time_zoneoptional | string | IANA zone. |
30 subagent_runs_by_parent_tool_call_idoptional | map<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_refsoptional | map<string subagentId, bytes blob id> | Out-of-line SubagentPersistedState blobs (newer alternative to field 16). |
32 goal_stateoptional | GoalState | — |
33 is_root_project_conversationoptional | bool | — |
34 completed_ask_question_tool_call_idsoptional | repeated string | — |
35 durable_skill_blocks / 36 durable_custom_mode_idoptional | repeated string / string | — |
37 message_count_at_last_compactionoptional | uint32 | — |
38 recent_user_message_ids / 39 recent_user_message_ids_older_turn_countoptional | repeated string / uint32 | — |
40 turn_telemetryoptional | TurnTelemetryState {completed_turn_count_capped, last_completed_turn_timestamp_ms?} | — |
42 mentioned_agent_idsoptional | repeated string | — |
2 (unknown)optional | length-delimited | Field 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.
| Field | Type | Meaning |
|---|---|---|
1 agent_conversation_turn.1 user_message | bytes (blob id) | UserMessage blob. |
…2 stepsoptional | repeated bytes (blob ids) | ConversationStep blobs in order. |
…3 request_idoptional | string (uuid) | Server request id; matches JSON user message providerOptions.cursor.requestId. |
…4 encrypted_modeloptional | string | Opaque encrypted model identifier (258/263 turns). |
…5 dynamic_tool_count / 9 dynamic_tool_namesoptional | uint32 / repeated string | — |
…6 send_message_step_indices / 13 assistant_text_step_indices / 14 assistant_text_steps_recordedoptional | repeated uint32 / bool | Indices into steps. |
…7 routed_model_display_nameoptional | string | Display name when auto-routed. |
…8 subagent_dispatch_stepsoptional | repeated SubagentDispatchStep {step_index, tool_call_id, tool, backgrounded} | — |
…10 user_message_idoptional | string | — |
…11 long_reasoning_reminder / 12 long_reasoning_reminder_exposure_loggedoptional | message / 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
| Field | Type | Meaning |
|---|---|---|
2 shell_conversation_turn.1 shell_command | bytes (blob id) | ShellCommand {1 command string}. |
…2 shell_output | bytes (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.
| Field | Type | Meaning |
|---|---|---|
1 text | string | Raw prompt text (without the <user_query> wrapper used in the JSON prompt message). |
2 message_id | string (uuid) | — |
3 selected_contextoptional | SelectedContext | Attached 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 mode | enum AgentMode | Values include AGENT, ASK. |
5 is_simulated_msg / 9 simulated_msg_reason / 15 simulated_message_metadataoptional | bool / enum SimulatedMsgReason (35 values) / message | System-injected 'user' messages (e.g. BACKGROUND_TASK_COMPLETION, PLAN_EXECUTION, USER_QUEUED_TO_SUBAGENT, GOAL_CONTINUATION). |
10 conversation_state_blob_id | bytes (blob id) | Root checkpoint as it was before this turn; used as the rewind anchor. |
17 thread_idoptional | string | — |
18 text_blob_id / 19 rich_text_blob_idoptional | bytes (blob id) | Out-of-line large text. |
8 rich_textoptional | string | — |
21 hook_additional_contextsoptional | repeated HookAdditionalContext {hook_event_name, content} | Context added by hooks. |
24 turn_steeroptional | bool | Message sent while the agent was running (steering). |
25 started_at_ms / 26 completed_at_msoptional | uint64 | — |
27 sent_by_agent_id / 29 sender / 28 sent_by_voice_call / 30 forked_context / 31 reply_tooptional | various | Agent-to-agent and multi-agent provenance. |
6,7,11,13,14,16,22,23optional | various | best_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.
| Field | Type | Meaning |
|---|---|---|
1 assistant_message.1 text | string | — |
…2 started_at_ms / 3 completed_at_msoptional | uint64 | — |
(protobuf) {assistant_message:{text:"Done."}}blob: agent.v1.ConversationStep / thinking_message
A reasoning step as shown in the UI.
Written per reasoning block.
| Field | Type | Meaning |
|---|---|---|
3 thinking_message.1 text | string | Often empty or summary text when the provider redacts reasoning. |
…2 duration_ms | uint32 | — |
…3 started_at_ms / 4 completed_at_msoptional | uint64 | — |
(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.
| Field | Type | Meaning |
|---|---|---|
2 tool_call.<case> | oneof tool | One 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>.resultoptional | oneof result | Typical cases: success | error | rejected | failure | timeout | spawn_error | permission_denied (shell). Absent while pending. |
…57 tool_call_idoptional | string | e.g. 'tool_<uuid>'; equals JSON tool-call toolCallId. |
…59 started_at_ms / 60 completed_at_msoptional | uint64 | — |
…54 hook_additional_contextsoptional | repeated 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
| Field | Type | Meaning |
|---|---|---|
1 id | string | — |
2 content | string | — |
3 status | enum TodoStatus(UNSPECIFIED,PENDING,IN_PROGRESS,COMPLETED,CANCELLED) | — |
4 created_at / 5 updated_at | int64 ms | — |
6 dependenciesoptional | repeated 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
| Field | Type | Meaning |
|---|---|---|
1 summary | string | — |
(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
| Field | Type | Meaning |
|---|---|---|
1 summarized_messages | repeated bytes (blob ids) | The JSON prompt-message blobs that were compacted away. |
2 summary | string | — |
3 window_tail | uint32 | Number of trailing messages kept. |
4 summary_message | bytes (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
| Field | Type | Meaning |
|---|---|---|
1 conversation_state | ConversationStateStructure | Same structure as the parent; its blob ids live in the parent's store.db. |
2 created_timestamp_ms / 3 last_used_timestamp_ms | uint64 | — |
4 subagent_type | SubagentType (oneof type: unspecified | custom{name} | …) | — |
5 model_idoptional | string | — |
6 environment | SubagentExecutionEnvironment | — |
7 cloud_subagentoptional | CloudSubagentReference {bc_id, transcript_path?} | — |
8 first_class_bc_id / 9 cloud_requested_environment_build_id / 10 machineoptional | string / 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
| Field | Type | Meaning |
|---|---|---|
(whole blob) | bytes | No envelope. May itself be valid JSON (e.g. a package.json) - do not classify by first byte alone. |
(raw bytes) export const example = 1;\nblob: 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.
| Field | Type | Meaning |
|---|---|---|
(whole blob) | bytes | Same formats as above. |
(protobuf) older ConversationStateStructurePrevious 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.
| Field | Type | Meaning |
|---|---|---|
role | "system" | — |
content | string | — |
{"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.
| Field | Type | Meaning |
|---|---|---|
role | "user" | — |
content | string | array of content parts | String for the initial <user_info> context; array of text parts for queries. |
providerOptions.cursor.requestIdoptional | string (uuid) | On query messages; equals AgentConversationTurnStructure.request_id. |
providerOptions.cursor.requestContextCompletenessoptional | object<string,bool> {agentSkills, customSubagents, env, gitRepos, gitStatus, mcp, mcpFileSystem, repositoryInfo, rules} | On the context message. |
providerOptions.cursor.isSummaryoptional | boolean | true 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).
| Field | Type | Meaning |
|---|---|---|
role | "assistant" | — |
id | string | Short per-request counter-like id (Values include 1-char strings); not globally unique. |
content | array of parts (redacted-reasoning | reasoning | text | tool-call) | — |
providerOptions.cursor.pendingToolCallStartedAtMsoptional | number | Values 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.
| Field | Type | Meaning |
|---|---|---|
role | "tool" | — |
id | string | Equals the toolCallId (5,861/5,863). |
content | array with one tool-result part | — |
providerOptions.cursor.highLevelToolCallResultoptional | object {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.
| Field | Type | Meaning |
|---|---|---|
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.
| Field | Type | Meaning |
|---|---|---|
role | "assistant" | — |
message.content[] | array of text | tool_use | First 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
| Field | Type | Meaning |
|---|---|---|
type | "turn_ended" | — |
status | enum(success|error|aborted) | — |
erroroptional | string | Present 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
| Field | Type | Meaning |
|---|---|---|
type | "metadata" | — |
metadata.overview | string | — |
{"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
| Field | Type | Meaning |
|---|---|---|
schemaVersion | 1 | — |
createdAtMs | number | — |
updatedAtMsoptional | number | — |
hasConversation | boolean | latestRootBlobId non-empty. |
titleoptional | string | Chat name (omitted for default). |
isSubagentoptional | true | Present when meta.subagentInfo is set. |
cwdoptional | string | Absolute 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
| Field | Type | Meaning |
|---|---|---|
[] | array of string | Newest 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.
| Field | Type | Meaning |
|---|---|---|
type | "text" | — |
text | string | — |
{"type":"text","text":"Hello"}json part / redacted-reasoning
Provider-encrypted reasoning; content is not readable.
Written assistant messages from reasoning models.
| Field | Type | Meaning |
|---|---|---|
type | "redacted-reasoning" | — |
data | string (opaque, base64-like) | Opaque. |
providerOptions.cursor.modelNameoptional | string | Model 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
| Field | Type | Meaning |
|---|---|---|
type | "reasoning" | — |
text | string | — |
{"type":"reasoning","text":"Thinking about it"}json part / tool-call
A tool invocation by the model.
| Field | Type | Meaning |
|---|---|---|
type | "tool-call" | — |
toolCallId | string | 'tool_<uuid>'. |
toolName | string | Model-facing name: Read, StrReplace, Grep, Shell, Glob, Write, ReadLints, TodoWrite, SemanticSearch, Delete, WebFetch, AskQuestion, WebSearch, Task, ListMcpResources, Await, MCP tool names, … (may be null). |
args | object | JSON arguments. |
{"type":"tool-call","toolCallId":"tool_00000000-0000-4000-8000-000000000004","toolName":"Grep","args":{"pattern":"example"}}json part / tool-result
Model-visible tool output.
| Field | Type | Meaning |
|---|---|---|
type | "tool-result" | — |
toolCallId | string | — |
toolName | string | — |
result | string | object | number | Usually string; objects for MCP results; a number once. |
experimental_contentoptional | array 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
| Field | Type | Meaning |
|---|---|---|
type | "image" | — |
imageoptional | string | {__type:'Uint8Array', hex} | Byte arrays are stored as {__type:'Uint8Array',hex} to bytes; field names follow the AI SDK CoreMessage shape. |
mimeTypeoptional | string | unknown |
{"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
| Field | Type | Meaning |
|---|---|---|
type | "file" | — |
filenameoptional | string | Used by the writer. |
data / mimeTypeoptional | unknown | — |
{"type":"file","filename":"example.pdf","mimeType":"application/pdf","data":{"__type":"Uint8Array","hex":"25504446"}}jsonl part / text
Text in a JSONL mirror line.
| Field | Type | Meaning |
|---|---|---|
type | "text" | — |
text | string | — |
{"type":"text","text":"Hello"}jsonl part / tool_use
Tool call in a JSONL mirror assistant line (no id, no result).
| Field | Type | Meaning |
|---|---|---|
type | "tool_use" | — |
name | string | — |
input | object | — |
{"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
- cursor-agent 2026.10.12-d47ca18 local transcript shape survey, live observation, checked 2026-10-26
- Cursor CLI 2026.11.13-eacade1 distributed implementation (darwin arm64 archive; SHA-256 in audit manifest), Source code, checked 2026-11-15