-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsave-state.schema.json
More file actions
139 lines (139 loc) · 4.04 KB
/
save-state.schema.json
File metadata and controls
139 lines (139 loc) · 4.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Claude Code Save State",
"description": "Structured checkpoint of a Claude Code session for resumption",
"type": "object",
"required": ["version", "id", "timestamp", "project", "cwd", "save_type"],
"properties": {
"version": {
"type": "integer",
"const": 1,
"description": "Schema version for forward compatibility"
},
"id": {
"type": "string",
"description": "Unique save ID: save_<unix_timestamp_ms>",
"pattern": "^save_[0-9]+$"
},
"timestamp": {
"type": "string",
"format": "date-time",
"description": "ISO 8601 timestamp of when the save was created"
},
"duration_minutes": {
"type": ["integer", "null"],
"description": "Approximate session duration in minutes"
},
"project": {
"type": "object",
"required": ["slug"],
"properties": {
"slug": {
"type": "string",
"description": "kebab-case project identifier",
"pattern": "^[a-z0-9][a-z0-9-]*$"
},
"name": {
"type": "string",
"description": "Human-readable project name"
},
"path": {
"type": "string",
"description": "Canonical project root path"
}
}
},
"cwd": {
"type": "string",
"description": "Working directory at save time"
},
"save_type": {
"type": "string",
"enum": ["manual", "auto"],
"description": "manual = /save command, auto = SessionEnd hook"
},
"git": {
"type": ["object", "null"],
"description": "Git repository state at save time. Null if not in a git repo.",
"properties": {
"branch": {
"type": "string",
"description": "Current branch name"
},
"last_commit": {
"type": "string",
"description": "Short hash + subject of the most recent commit"
},
"dirty_files": {
"type": "integer",
"description": "Number of uncommitted changes"
},
"uncommitted_summary": {
"type": "array",
"items": { "type": "string" },
"description": "Lines from git status --porcelain (max 20)"
}
}
},
"intent": {
"type": "string",
"description": "What was being attempted this session (1-3 sentences, written by Claude from context)"
},
"files_modified": {
"type": "array",
"items": {
"type": "object",
"required": ["path", "action"],
"properties": {
"path": {
"type": "string",
"description": "File path relative to project root"
},
"action": {
"type": "string",
"enum": ["created", "modified", "deleted"]
},
"description": {
"type": "string",
"description": "What changed in this file"
}
}
}
},
"decisions": {
"type": "array",
"items": { "type": "string" },
"description": "Key decisions made during the session with rationale"
},
"next_steps": {
"type": "array",
"items": { "type": "string" },
"description": "Ranked list of what to do next. Most important first. Each step should be completable in a single session."
},
"lessons": {
"type": "array",
"items": {
"type": "object",
"properties": {
"title": { "type": "string" },
"finding": { "type": "string" },
"implication": { "type": "string" }
}
},
"description": "Technical pitfalls solved, strategic insights confirmed, or patterns discovered"
},
"tags": {
"type": "array",
"items": { "type": "string" },
"description": "Free-form tags for searchability (2-5 recommended)"
},
"machine": {
"type": "string",
"description": "Hostname where save was created"
},
"session_id": {
"type": "string",
"description": "Claude Code session ID (may be truncated)"
}
}
}