{
"info": {
"id": "ses_main0001",
"slug": "demo-session",
"projectID": "proj_demo0001",
"workspaceID": "ws_demo0001",
"directory": "/tmp/demo-repo",
"path": "demo-repo",
"summary": {
"additions": 2,
"deletions": 0,
"files": 1
},
"cost": 0.0018,
"tokens": {
"input": 500,
"output": 200,
"reasoning": 0,
"cache": {
"read": 0,
"write": 0
}
},
"share": {
"url": "https://opencode.example/s/demo"
},
"title": "demo session",
"agent": "build",
"model": {
"id": "claude-opus-4-6",
"providerID": "anthropic"
},
"version": "1.17.14",
"metadata": {
"foo": "bar"
},
"time": {
"created": 1751900000000,
"updated": 1751900010000
},
"revert": {
"messageID": "msg_a0002",
"partID": "prt_a0002b",
"snapshot": "snap123",
"diff": "--- a/hello.txt\n+++ b/hello.txt\n@@ -0,0 +1 @@\n+hi\n",
"files": [
"hello.txt"
]
},
"experimentalFeatureFlag": true
},
"messages": [
{
"info": {
"id": "msg_u0001",
"sessionID": "ses_main0001",
"role": "user",
"time": {
"created": 1751900001000
},
"format": {
"type": "text"
},
"summary": {
"title": "initial ask",
"diffs": []
},
"agent": "build",
"model": {
"providerID": "anthropic",
"modelID": "claude-opus-4-6"
},
"system": "You are a terminal assistant, be concise.",
"tools": {
"bash": true,
"write_file": true
}
},
"parts": [
{
"id": "prt_u0001a",
"sessionID": "ses_main0001",
"messageID": "msg_u0001",
"type": "text",
"text": "Please create hello.txt with 'hi' in it, and check this screenshot."
},
{
"id": "prt_u0001b",
"sessionID": "ses_main0001",
"messageID": "msg_u0001",
"type": "file",
"mime": "image/png",
"filename": "screenshot.png",
"url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII=",
"source": {
"path": "/tmp/screenshot.png"
}
}
]
},
{
"info": {
"id": "msg_a0002",
"sessionID": "ses_main0001",
"role": "assistant",
"time": {
"created": 1751900002000,
"completed": 1751900002500
},
"parentID": "msg_u0001",
"modelID": "claude-opus-4-6",
"providerID": "anthropic",
"mode": "build",
"agent": "build",
"path": {
"cwd": "/tmp/demo-repo",
"root": "/tmp/demo-repo"
},
"cost": 0.001035,
"tokens": {
"input": 120,
"output": 45,
"reasoning": 0,
"cache": {
"read": 0,
"write": 0
}
},
"finish": "tool-calls"
},
"parts": [
{
"id": "prt_a0002a",
"sessionID": "ses_main0001",
"messageID": "msg_a0002",
"type": "text",
"text": "Sure, creating hello.txt now."
},
{
"id": "prt_a0002b",
"sessionID": "ses_main0001",
"messageID": "msg_a0002",
"type": "tool",
"callID": "call_write0001",
"tool": "write_file",
"state": {
"status": "completed",
"input": {
"path": "hello.txt",
"content": "hi"
},
"output": "wrote 2 bytes to hello.txt",
"title": "write_file",
"metadata": {},
"time": {
"start": 1751900002100,
"end": 1751900002200,
"compacted": 1751900009000
}
}
},
{
"id": "prt_a0002c",
"sessionID": "ses_main0001",
"messageID": "msg_a0002",
"type": "reasoning",
"text": "The user wants a file created with specific contents.",
"metadata": {
"anthropic": {
"signature": "sig-abc123"
}
},
"time": {
"start": 1751900002000,
"end": 1751900002050
}
},
{
"id": "prt_a0002d",
"sessionID": "ses_main0001",
"messageID": "msg_a0002",
"type": "step-start",
"snapshot": "snap_stepstart_1"
},
{
"id": "prt_a0002e",
"sessionID": "ses_main0001",
"messageID": "msg_a0002",
"type": "step-finish",
"reason": "tool-calls",
"snapshot": "snap_stepfinish_1",
"cost": 0.0002,
"tokens": {
"input": 20,
"output": 5,
"reasoning": 0,
"cache": {
"read": 0,
"write": 0
}
}
},
{
"id": "prt_a0002f",
"sessionID": "ses_main0001",
"messageID": "msg_a0002",
"type": "snapshot",
"snapshot": "snap_direct_1"
},
{
"id": "prt_a0002g",
"sessionID": "ses_main0001",
"messageID": "msg_a0002",
"type": "patch",
"hash": "patchhash1",
"files": [
"hello.txt"
]
},
{
"id": "prt_a0002h",
"sessionID": "ses_main0001",
"messageID": "msg_a0002",
"type": "retry",
"attempt": 1,
"error": {
"name": "APIError",
"data": {
"message": "transient upstream error",
"isRetryable": true
}
},
"time": {
"created": 1751900002001
}
}
]
},
{
"info": {
"id": "msg_u0003",
"sessionID": "ses_main0001",
"role": "user",
"time": {
"created": 1751900003000
},
"agent": "build",
"model": {
"providerID": "anthropic",
"modelID": "claude-opus-4-6"
}
},
"parts": [
{
"id": "prt_u0003a",
"sessionID": "ses_main0001",
"messageID": "msg_u0003",
"type": "text",
"text": "@build please compact now, then cat the file."
},
{
"id": "prt_u0003b",
"sessionID": "ses_main0001",
"messageID": "msg_u0003",
"type": "compaction",
"auto": true,
"tail_start_id": "msg_u0005"
},
{
"id": "prt_u0003c",
"sessionID": "ses_main0001",
"messageID": "msg_u0003",
"type": "agent",
"name": "build",
"source": {
"value": "@build",
"start": 0,
"end": 6
}
},
{
"id": "prt_u0003d",
"sessionID": "ses_main0001",
"messageID": "msg_u0003",
"type": "subtask",
"prompt": "verify hello.txt contents",
"description": "sanity check",
"agent": "reviewer"
}
]
},
{
"info": {
"id": "msg_a0004",
"sessionID": "ses_main0001",
"role": "assistant",
"time": {
"created": 1751900004000,
"completed": 1751900004100
},
"parentID": "msg_u0003",
"modelID": "claude-opus-4-6",
"providerID": "anthropic",
"agent": "build",
"summary": true,
"cost": 0.0003,
"tokens": {
"input": 200,
"output": 60,
"reasoning": 0,
"cache": {
"read": 0,
"write": 0
}
}
},
"parts": [
{
"id": "prt_a0004a",
"sessionID": "ses_main0001",
"messageID": "msg_a0004",
"type": "text",
"text": "[compaction summary]\nCreated hello.txt with 'hi'; reviewed the attached screenshot."
}
]
},
{
"info": {
"id": "msg_u0005",
"sessionID": "ses_main0001",
"role": "user",
"time": {
"created": 1751900005000
},
"agent": "build",
"model": {
"providerID": "anthropic",
"modelID": "claude-opus-4-6"
}
},
"parts": [
{
"id": "prt_u0005a",
"sessionID": "ses_main0001",
"messageID": "msg_u0005",
"type": "text",
"text": "cat hello.txt"
}
]
},
{
"info": {
"id": "msg_a0006",
"sessionID": "ses_main0001",
"role": "assistant",
"time": {
"created": 1751900006000,
"completed": 1751900006200
},
"parentID": "msg_u0005",
"modelID": "claude-opus-4-6",
"providerID": "anthropic",
"agent": "build",
"cost": 0.0004,
"tokens": {
"input": 30,
"output": 10,
"reasoning": 0,
"cache": {
"read": 0,
"write": 0
}
},
"finish": "tool-calls"
},
"parts": [
{
"id": "prt_a0006a",
"sessionID": "ses_main0001",
"messageID": "msg_a0006",
"type": "text",
"text": "Sure."
},
{
"id": "prt_a0006b",
"sessionID": "ses_main0001",
"messageID": "msg_a0006",
"type": "tool",
"callID": "call_bash0001",
"tool": "bash",
"state": {
"status": "completed",
"input": {
"command": "cat hello.txt"
},
"output": "hi",
"title": "bash",
"metadata": {},
"time": {
"start": 1751900006050,
"end": 1751900006100
}
}
}
]
},
{
"info": {
"id": "msg_u0007",
"sessionID": "ses_main0001",
"role": "user",
"time": {
"created": 1751900007000
}
},
"parts": [
{
"id": "prt_u0007a",
"sessionID": "ses_main0001",
"messageID": "msg_u0007",
"type": "text",
"text": "Thanks!"
}
]
},
{
"info": {
"id": "msg_a0008",
"sessionID": "ses_main0001",
"role": "assistant",
"time": {
"created": 1751900008000,
"completed": 1751900008100
},
"parentID": "msg_u0007",
"modelID": "claude-opus-4-6",
"providerID": "anthropic",
"agent": "build",
"finish": "stop"
},
"parts": [
{
"id": "prt_a0008a",
"sessionID": "ses_main0001",
"messageID": "msg_a0008",
"type": "text",
"text": "You're welcome!"
},
{
"id": "prt_a0008b",
"sessionID": "ses_main0001",
"messageID": "msg_a0008",
"type": "text",
"text": "[internal telemetry note: do not surface]",
"ignored": true,
"synthetic": true
}
]
}
]
}