claude-baton 2.1.1 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +242 -64
- package/commands/memo-checkpoint.md +6 -5
- package/commands/memo-eod.md +12 -12
- package/commands/memo-resume.md +23 -23
- package/dist/cli.js +23 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,116 +1,294 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<h1 align="center">🎭 claude-baton</h1>
|
|
3
|
+
<p align="center"><strong>Never lose context between Claude Code sessions again.</strong></p>
|
|
4
|
+
<p align="center">
|
|
5
|
+
<a href="https://www.npmjs.com/package/claude-baton"><img src="https://img.shields.io/npm/v/claude-baton.svg" alt="npm version"></a>
|
|
6
|
+
<a href="https://github.com/bakabaka91/claude-baton/actions/workflows/ci.yml"><img src="https://github.com/bakabaka91/claude-baton/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
7
|
+
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
|
|
8
|
+
<a href="https://www.npmjs.com/package/claude-baton"><img src="https://img.shields.io/npm/dm/claude-baton.svg" alt="npm downloads"></a>
|
|
9
|
+
</p>
|
|
10
|
+
</p>
|
|
2
11
|
|
|
3
|
-
|
|
12
|
+
---
|
|
4
13
|
|
|
5
|
-
|
|
14
|
+
## 😤 The Problem
|
|
6
15
|
|
|
7
|
-
|
|
16
|
+
You're deep in a Claude Code session — 45 minutes in, multiple files changed, complex decisions made. Then:
|
|
17
|
+
|
|
18
|
+
- Context gets compacted and Claude forgets what it was doing
|
|
19
|
+
- You `/clear` or start a new session and lose everything
|
|
20
|
+
- You spend 10 minutes re-explaining where you left off
|
|
21
|
+
- Claude makes the same wrong decisions you already corrected
|
|
22
|
+
|
|
23
|
+
**Sound familiar?**
|
|
24
|
+
|
|
25
|
+
## ✨ The Solution
|
|
26
|
+
|
|
27
|
+
claude-baton gives Claude Code **persistent memory across sessions**. It automatically saves what was built, what's next, and why — then restores it perfectly when you come back.
|
|
8
28
|
|
|
9
29
|
```
|
|
10
|
-
|
|
30
|
+
Session 1 Session 2
|
|
31
|
+
┌─────────────────────┐ ┌─────────────────────┐
|
|
32
|
+
│ Work on features │ │ /memo-resume │
|
|
33
|
+
│ Make decisions │ │ ↓ │
|
|
34
|
+
│ Hit blockers │ │ Full context restored│
|
|
35
|
+
│ ...context compacts │──💾──→ │ Decisions preserved │
|
|
36
|
+
│ (auto-saved!) │ DB │ Next steps ready │
|
|
37
|
+
└─────────────────────┘ │ Git diff shown │
|
|
38
|
+
│ Ready to continue! │
|
|
39
|
+
└─────────────────────┘
|
|
11
40
|
```
|
|
12
41
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
42
|
+
## 🎯 What You Get
|
|
43
|
+
|
|
44
|
+
- **🔄 Seamless resume** — Start any session with `/memo-resume` and pick up exactly where you left off
|
|
45
|
+
- **💾 Auto-checkpoint** — PreCompact hook saves your session state *before* Claude compacts context. You never have to remember.
|
|
46
|
+
- **📊 Diff intelligence** — Resume shows what changed since your last session (new commits, modified files, dependency changes)
|
|
47
|
+
- **🧠 Decision memory** — Key decisions and their reasoning survive across sessions
|
|
48
|
+
- **📋 EOD summaries** — Generate end-of-day reports from all sessions with `/memo-eod`
|
|
49
|
+
- **🔒 Fully local** — All data in a local SQLite database. No cloud, no API keys, no data leaves your machine.
|
|
50
|
+
|
|
51
|
+
## 🏗️ Claude Code vs Claude Code + Baton
|
|
52
|
+
|
|
53
|
+
Claude Code is powerful, but it has structural limitations around context persistence. Here's what changes with claude-baton:
|
|
54
|
+
|
|
55
|
+
| Scenario | Claude Code alone | Claude Code + Baton |
|
|
56
|
+
|----------|-------------------|---------------------|
|
|
57
|
+
| **Context compaction** | 🔴 Claude silently loses session state. After compaction, it may forget decisions, repeat mistakes, or restart work already done. | 🟢 PreCompact hook auto-saves a structured checkpoint *before* compaction. Claude resumes with full context. |
|
|
58
|
+
| **New session** | 🔴 Blank slate. You re-explain everything from scratch. Claude has to re-read files and rediscover project state. | 🟢 `/memo-resume` loads the last checkpoint with what was built, decisions, blockers, next steps, and git diff since then. |
|
|
59
|
+
| **Decision persistence** | 🔴 "We decided not to use Redux because..." — gone after `/clear`. Claude may suggest Redux again next session. | 🟢 Decisions and their reasoning are stored in checkpoints and surfaced on resume. |
|
|
60
|
+
| **Long-running tasks** | 🔴 Multi-session tasks lose continuity. Each session starts from zero context. | 🟢 Chained checkpoints maintain a thread across sessions. Each auto-checkpoint includes the previous one for continuity. |
|
|
61
|
+
| **Team handover** | 🔴 No way to export what Claude was doing. Knowledge lives only in the conversation. | 🟢 `claude-baton export` produces JSON. `/memo-eod` generates daily summaries of all sessions. |
|
|
62
|
+
| **Git awareness** | 🟡 Claude can run git commands but doesn't automatically know what changed since last session. | 🟢 Resume computes git diff since checkpoint — shows new commits, modified files, dependency changes. |
|
|
63
|
+
|
|
64
|
+
### 🧱 The Moat: What Claude Code Can't Do Natively
|
|
65
|
+
|
|
66
|
+
Claude Code has no **persistent structured memory** across sessions. This is the fundamental gap:
|
|
16
67
|
|
|
17
|
-
|
|
68
|
+
1. **No session state survives `/compact` or `/clear`** — Claude Code's context window is ephemeral. When it compacts, the nuanced understanding of *why* you made decisions, *what* you tried and rejected, and *where* you were headed is lost. CLAUDE.md can store project rules, but not dynamic session state.
|
|
69
|
+
|
|
70
|
+
2. **No automatic preservation** — There's no built-in mechanism to save state before compaction. You'd have to manually write notes every time, which you won't.
|
|
71
|
+
|
|
72
|
+
3. **No structured handover** — Even if you paste notes into a new session, Claude has to parse free-text. claude-baton provides structured data (what was built, current state, next steps, decisions, blockers, git context) that Claude can act on immediately.
|
|
73
|
+
|
|
74
|
+
4. **No cross-session diff intelligence** — Claude Code can't tell you "3 files changed and 2 new commits landed since your last session." claude-baton compares checkpoint state against current git state and surfaces the delta.
|
|
75
|
+
|
|
76
|
+
5. **No session history** — There's no way to look back at what you accomplished across multiple sessions in a day. claude-baton's `/memo-eod` synthesizes all checkpoints into a daily summary.
|
|
77
|
+
|
|
78
|
+
claude-baton fills these gaps by sitting alongside Claude Code as an MCP server — it doesn't replace anything, it adds the persistence layer that's missing.
|
|
79
|
+
|
|
80
|
+
## 🚀 Quick Start
|
|
81
|
+
|
|
82
|
+
Two commands. That's it.
|
|
18
83
|
|
|
19
84
|
```bash
|
|
20
85
|
npm install -g claude-baton
|
|
86
|
+
claude-baton setup
|
|
21
87
|
```
|
|
22
88
|
|
|
23
|
-
|
|
89
|
+
Start a new Claude Code session and you're ready to go:
|
|
24
90
|
|
|
25
|
-
```
|
|
26
|
-
|
|
91
|
+
```
|
|
92
|
+
You: /memo-checkpoint ← saves session state
|
|
93
|
+
You: /compact ← safe, state is preserved
|
|
94
|
+
You: /memo-resume ← restores everything
|
|
27
95
|
```
|
|
28
96
|
|
|
29
|
-
|
|
30
|
-
- Registers the MCP server via `claude mcp add` (user scope, available across all projects)
|
|
31
|
-
- Registers the PreCompact hook for auto-checkpoint
|
|
32
|
-
- Registers allowed tools so slash commands run without approval prompts
|
|
33
|
-
- Initializes the SQLite database at `~/.claude-baton/store.db`
|
|
34
|
-
- Installs slash commands to `~/.claude/commands/`
|
|
97
|
+
## 📸 What It Looks Like
|
|
35
98
|
|
|
36
|
-
|
|
99
|
+
### `/memo-resume` — Session handover briefing
|
|
37
100
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
| `save_checkpoint` | Save session state (what was built, current state, next steps, git context) |
|
|
41
|
-
| `get_checkpoint` | Retrieve a checkpoint by ID, or the latest for the project |
|
|
42
|
-
| `list_checkpoints` | List all checkpoints for a date |
|
|
43
|
-
| `daily_summary` | Generate EOD summary from the day's checkpoints |
|
|
101
|
+
```
|
|
102
|
+
## Session Resume — my-project — 2026-03-25
|
|
44
103
|
|
|
45
|
-
|
|
104
|
+
Resuming from checkpoint: 2026-03-25T15:26:07Z
|
|
105
|
+
Source: auto checkpoint
|
|
46
106
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
| `/memo-checkpoint` | Save session state with git context — safe to `/compact` or `/clear` after |
|
|
50
|
-
| `/memo-resume` | Restore context from last checkpoint at session start |
|
|
51
|
-
| `/memo-eod` | End-of-day summary combining git activity with stored data |
|
|
107
|
+
### Branch
|
|
108
|
+
main — currently on main
|
|
52
109
|
|
|
53
|
-
|
|
110
|
+
### Where We Left Off
|
|
111
|
+
v2.1.1 published on npm. Build clean. All tests passing.
|
|
54
112
|
|
|
55
|
-
|
|
113
|
+
### What Was Built (Last Session)
|
|
114
|
+
Implemented auto-checkpoint chaining with git diff context,
|
|
115
|
+
switched LLM from haiku to sonnet for better summarization quality.
|
|
56
116
|
|
|
57
|
-
|
|
117
|
+
### Decisions Made
|
|
118
|
+
Used claude mcp add for server registration instead of manual config.
|
|
119
|
+
Added source field (manual/auto) to distinguish checkpoint types.
|
|
58
120
|
|
|
59
|
-
|
|
121
|
+
### Next Steps
|
|
122
|
+
1. Test /memo-resume in a fresh session
|
|
123
|
+
2. Verify auto-checkpoint fires on context compaction
|
|
60
124
|
|
|
61
|
-
|
|
125
|
+
### Changes Since Checkpoint
|
|
126
|
+
No changes since checkpoint — clean working tree, HEAD at 795f9aa.
|
|
62
127
|
|
|
63
|
-
|
|
128
|
+
### Commits From Last Session
|
|
129
|
+
795f9aa 2.1.1
|
|
130
|
+
108b65e feat: switch LLM calls from haiku to sonnet
|
|
131
|
+
fe5dae0 docs: fix README to reflect claude mcp add registration
|
|
132
|
+
```
|
|
64
133
|
|
|
65
|
-
|
|
134
|
+
### `/memo-eod` — End-of-day summary
|
|
66
135
|
|
|
67
|
-
|
|
136
|
+
```
|
|
137
|
+
## EOD Summary — my-project — 2026-03-25
|
|
68
138
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
139
|
+
### What Was Built / Shipped
|
|
140
|
+
feat: auto-checkpoint chaining and resume resilience
|
|
141
|
+
feat: allowed tools for frictionless slash commands
|
|
142
|
+
fix: MCP server registration via claude mcp add
|
|
143
|
+
|
|
144
|
+
### Decisions Made
|
|
145
|
+
- Used claude mcp add for correct MCP discovery
|
|
146
|
+
- Chained auto-checkpoints with previous context + git diff
|
|
147
|
+
|
|
148
|
+
### Git Stats
|
|
149
|
+
- Commits today: 12
|
|
150
|
+
- Files changed: 15
|
|
151
|
+
- Feature areas: feat, fix, docs, style, chore
|
|
77
152
|
```
|
|
78
153
|
|
|
79
|
-
##
|
|
154
|
+
## 🔧 How It Works
|
|
80
155
|
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
|
|
156
|
+
```
|
|
157
|
+
┌──────────────────────────────────────────────────────────┐
|
|
158
|
+
│ Claude Code Session │
|
|
159
|
+
│ │
|
|
160
|
+
│ /memo-resume ←── reads latest checkpoint from DB │
|
|
161
|
+
│ ↓ │
|
|
162
|
+
│ You work normally │
|
|
163
|
+
│ ↓ │
|
|
164
|
+
│ /memo-checkpoint ──→ saves state + git context to DB │
|
|
165
|
+
│ ↓ │
|
|
166
|
+
│ /compact or /clear (safe!) │
|
|
167
|
+
│ │
|
|
168
|
+
│ ┌─────────────────────────────────────────────┐ │
|
|
169
|
+
│ │ 🪝 PreCompact Hook (automatic) │ │
|
|
170
|
+
│ │ │ │
|
|
171
|
+
│ │ Context about to compact? │ │
|
|
172
|
+
│ │ → Read conversation transcript │ │
|
|
173
|
+
│ │ → Fetch previous checkpoint for chaining │ │
|
|
174
|
+
│ │ → Extract state via claude -p --model sonnet│ │
|
|
175
|
+
│ │ → Save auto-checkpoint to DB │ │
|
|
176
|
+
│ └─────────────────────────────────────────────┘ │
|
|
177
|
+
└──────────────────────────────────────────────────────────┘
|
|
178
|
+
↕
|
|
179
|
+
~/.claude-baton/store.db
|
|
180
|
+
(local SQLite)
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### The checkpoint lifecycle
|
|
184
|
+
|
|
185
|
+
1. **💾 Checkpoint** — Captures what you built, current state, next steps, decisions, blockers, and git context (branch, uncommitted files, recent commits)
|
|
186
|
+
|
|
187
|
+
2. **🪝 Auto-checkpoint** — Before context compaction, the PreCompact hook reads the transcript, fetches the previous checkpoint for continuity, and uses `claude -p --model sonnet` to extract a structured checkpoint automatically
|
|
188
|
+
|
|
189
|
+
3. **🔄 Resume** — Fetches the latest checkpoint, compares current git state vs checkpoint state, computes what changed (new commits, file diffs, dependency changes), and presents a structured handover briefing
|
|
190
|
+
|
|
191
|
+
4. **📊 EOD Summary** — Synthesizes all checkpoints from the day into a daily summary: what was built, decisions made, blockers, and next steps
|
|
192
|
+
|
|
193
|
+
## 📋 Slash Commands
|
|
194
|
+
|
|
195
|
+
| Command | Description |
|
|
196
|
+
|---------|-------------|
|
|
197
|
+
| `/memo-resume` | 🔄 Restore context from last checkpoint — run this at session start |
|
|
198
|
+
| `/memo-checkpoint` | 💾 Save session state with git context — safe to `/compact` after |
|
|
199
|
+
| `/memo-eod` | 📊 End-of-day summary combining all sessions |
|
|
84
200
|
|
|
85
|
-
|
|
86
|
-
|
|
201
|
+
## 🛠️ CLI Commands
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
claude-baton setup # 🔧 one-time setup (MCP, hooks, commands)
|
|
205
|
+
claude-baton status # 📊 checkpoint counts, db size
|
|
206
|
+
claude-baton projects # 📁 list tracked projects
|
|
207
|
+
claude-baton export [--project] # 📤 export as JSON
|
|
208
|
+
claude-baton import <file> # 📥 import from JSON
|
|
209
|
+
claude-baton reset [--project] # 🗑️ clear data (with confirmation)
|
|
210
|
+
claude-baton uninstall # ❌ remove everything cleanly
|
|
211
|
+
claude-baton uninstall --keep-data # ❌ uninstall but preserve your data
|
|
87
212
|
```
|
|
88
213
|
|
|
89
|
-
|
|
214
|
+
## 🔌 MCP Tools
|
|
215
|
+
|
|
216
|
+
For automation and advanced use cases, claude-baton exposes 4 MCP tools:
|
|
90
217
|
|
|
91
|
-
|
|
218
|
+
| Tool | Description |
|
|
219
|
+
|------|-------------|
|
|
220
|
+
| `save_checkpoint` | Save session state (what was built, current state, next steps, git context) |
|
|
221
|
+
| `get_checkpoint` | Retrieve a checkpoint by ID, or the latest for the project |
|
|
222
|
+
| `list_checkpoints` | List all checkpoints for a date |
|
|
223
|
+
| `daily_summary` | Generate EOD summary from the day's checkpoints |
|
|
92
224
|
|
|
93
|
-
|
|
225
|
+
## 🤔 Why Not Just...
|
|
94
226
|
|
|
95
|
-
|
|
227
|
+
| Alternative | Limitation |
|
|
228
|
+
|-------------|------------|
|
|
229
|
+
| **Manual notes** | You have to remember to write them. You won't. |
|
|
230
|
+
| **CLAUDE.md** | Great for project rules, not for session state that changes every hour |
|
|
231
|
+
| **TodoWrite** | Tracks tasks, not context. Doesn't capture decisions, blockers, or git state |
|
|
232
|
+
| **Just re-explain** | Wastes 5-10 minutes per session. Loses decision reasoning. |
|
|
233
|
+
| **Git commit messages** | Captures *what* changed, not *why* or *what's next* |
|
|
234
|
+
|
|
235
|
+
claude-baton captures the **full session context** — what was built, why decisions were made, what's blocked, and what to do next — automatically.
|
|
236
|
+
|
|
237
|
+
## 📦 What Setup Does
|
|
238
|
+
|
|
239
|
+
`claude-baton setup` is a single command that configures everything:
|
|
240
|
+
|
|
241
|
+
```
|
|
242
|
+
✓ Registered MCP server (user scope — works across all projects)
|
|
243
|
+
✓ Registered PreCompact hook for auto-checkpoint
|
|
244
|
+
✓ Registered allowed tools (slash commands run without prompts)
|
|
245
|
+
✓ Initialized database at ~/.claude-baton/store.db
|
|
246
|
+
✓ Installed slash commands to ~/.claude/commands/
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
## 🗄️ Data Model
|
|
250
|
+
|
|
251
|
+
All data lives locally in `~/.claude-baton/store.db`:
|
|
252
|
+
|
|
253
|
+
- **checkpoints** — session state snapshots with git context, source tracking (`manual` | `auto`)
|
|
96
254
|
- **daily_summaries** — LLM-generated EOD summaries
|
|
97
255
|
|
|
98
|
-
|
|
256
|
+
No data leaves your machine. No cloud. No API keys. LLM calls use your existing `claude -p` subscription.
|
|
99
257
|
|
|
100
|
-
|
|
101
|
-
- Claude Code CLI installed and authenticated (setup uses `claude mcp add`)
|
|
102
|
-
- No API keys needed — LLM calls use `claude -p`
|
|
258
|
+
## 📋 Requirements
|
|
103
259
|
|
|
104
|
-
|
|
260
|
+
- **Node.js** >= 18
|
|
261
|
+
- **Claude Code CLI** installed and authenticated
|
|
262
|
+
- **No API keys needed** — all LLM calls use `claude -p` (your existing subscription)
|
|
263
|
+
|
|
264
|
+
## 🧑💻 Development
|
|
105
265
|
|
|
106
266
|
```bash
|
|
107
267
|
git clone https://github.com/bakabaka91/claude-baton.git
|
|
108
268
|
cd claude-baton
|
|
109
269
|
npm install
|
|
110
270
|
npm run build
|
|
111
|
-
npm test
|
|
271
|
+
npm test # 97 tests
|
|
112
272
|
```
|
|
113
273
|
|
|
114
|
-
##
|
|
274
|
+
## 🗑️ Uninstall
|
|
275
|
+
|
|
276
|
+
Clean removal — no traces left behind:
|
|
277
|
+
|
|
278
|
+
```bash
|
|
279
|
+
claude-baton uninstall # removes hooks, MCP server, commands, and database
|
|
280
|
+
npm uninstall -g claude-baton # removes the binary
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
To keep your checkpoint data: `claude-baton uninstall --keep-data`
|
|
284
|
+
|
|
285
|
+
## 📄 License
|
|
115
286
|
|
|
116
287
|
MIT
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
<p align="center">
|
|
292
|
+
<strong>Built for developers who are tired of re-explaining context to Claude.</strong><br>
|
|
293
|
+
<a href="https://www.npmjs.com/package/claude-baton">npm</a> · <a href="https://github.com/bakabaka91/claude-baton/issues">Issues</a> · <a href="https://github.com/bakabaka91/claude-baton/blob/main/CONTRIBUTING.md">Contributing</a>
|
|
294
|
+
</p>
|
|
@@ -35,9 +35,10 @@ Save session state before context loss.
|
|
|
35
35
|
6. Print structured confirmation:
|
|
36
36
|
|
|
37
37
|
```
|
|
38
|
-
Checkpoint saved
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
💾 Checkpoint saved — safe to /compact or /clear
|
|
39
|
+
|
|
40
|
+
🌿 Branch: [branch name]
|
|
41
|
+
📍 State: [current_state summary]
|
|
42
|
+
🎯 Next: [next_steps]
|
|
43
|
+
📝 Uncommitted: [count] files
|
|
43
44
|
```
|
package/commands/memo-eod.md
CHANGED
|
@@ -12,31 +12,31 @@ End-of-day summary combining git activity with stored checkpoints.
|
|
|
12
12
|
- `git diff --name-only HEAD~10 HEAD 2>/dev/null | head -30`
|
|
13
13
|
|
|
14
14
|
4. Call the `daily_summary` MCP tool (defaults to today).
|
|
15
|
-
This internally gathers checkpoints and sends them to
|
|
15
|
+
This internally gathers checkpoints and sends them to Sonnet for synthesis, then stores the result.
|
|
16
16
|
|
|
17
17
|
5. Merge git activity from step 2 with the daily_summary output.
|
|
18
18
|
|
|
19
19
|
6. Display formatted summary:
|
|
20
20
|
|
|
21
21
|
```
|
|
22
|
-
## EOD Summary
|
|
22
|
+
## 📊 EOD Summary — [Project Name] — [DATE]
|
|
23
23
|
|
|
24
|
-
### What Was Built / Shipped
|
|
24
|
+
### 🏗️ What Was Built / Shipped
|
|
25
25
|
[Commits grouped by area + what_was_built from daily_summary]
|
|
26
26
|
|
|
27
|
-
### Decisions Made
|
|
27
|
+
### 🧭 Decisions Made
|
|
28
28
|
[From daily_summary + checkpoint decisions]
|
|
29
29
|
|
|
30
|
-
### Blockers and Failures
|
|
31
|
-
[From daily_summary blockers]
|
|
30
|
+
### 🚧 Blockers and Failures
|
|
31
|
+
[From daily_summary blockers -- or "✅ None"]
|
|
32
32
|
|
|
33
|
-
### Open Questions / Tomorrow
|
|
33
|
+
### 🔮 Open Questions / Tomorrow
|
|
34
34
|
[next_steps from daily_summary]
|
|
35
35
|
|
|
36
|
-
### Git Stats
|
|
37
|
-
- Commits today: [count]
|
|
38
|
-
- Files changed: [count]
|
|
39
|
-
- Feature areas: [list of commit prefixes]
|
|
36
|
+
### 📈 Git Stats
|
|
37
|
+
- 📝 Commits today: [count]
|
|
38
|
+
- 📁 Files changed: [count]
|
|
39
|
+
- 🏷️ Feature areas: [list of commit prefixes]
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
7. Confirm: "EOD saved for [Project Name]
|
|
42
|
+
7. Confirm: "✅ EOD saved for [Project Name] — [DATE]. [N] commits today."
|
package/commands/memo-resume.md
CHANGED
|
@@ -9,13 +9,13 @@ Restore context from last checkpoint at session start.
|
|
|
9
9
|
3. Call the `get_checkpoint` MCP tool (latest by default, or by ID if the user specified one via $ARGUMENTS).
|
|
10
10
|
|
|
11
11
|
3.5. **Staleness check:** If a checkpoint was found, compute the time delta between the checkpoint's `created_at` and now:
|
|
12
|
-
- More than 7 days old: display `"WARNING: This checkpoint is [N] days old. Project state may have changed significantly."`
|
|
13
|
-
- More than 24 hours but 7 days or less: display `"Note: This checkpoint is [N] hours/days old."`
|
|
12
|
+
- More than 7 days old: display `"⚠️ WARNING: This checkpoint is [N] days old. Project state may have changed significantly."`
|
|
13
|
+
- More than 24 hours but 7 days or less: display `"📌 Note: This checkpoint is [N] hours/days old."`
|
|
14
14
|
- 24 hours or less: no staleness note
|
|
15
15
|
|
|
16
16
|
3.75. **Cold-start fallback:** If NO checkpoint exists for this project:
|
|
17
17
|
- Run `git log --oneline -20`, `git diff --stat HEAD~5..HEAD`, `git branch --show-current`, `git status --short`
|
|
18
|
-
- Present a "Cold Start Briefing" with recent commits, file changes, and uncommitted work
|
|
18
|
+
- Present a "🆕 Cold Start Briefing" with recent commits, file changes, and uncommitted work
|
|
19
19
|
- End with: "No checkpoint to resume from, but here is the project state from git. What would you like to work on?"
|
|
20
20
|
- Skip remaining steps (4-8)
|
|
21
21
|
|
|
@@ -36,54 +36,54 @@ Restore context from last checkpoint at session start.
|
|
|
36
36
|
7. Present the structured handover briefing:
|
|
37
37
|
|
|
38
38
|
```
|
|
39
|
-
## Session Resume
|
|
39
|
+
## 🔄 Session Resume — [Project Name] — [DATE]
|
|
40
40
|
|
|
41
|
-
Resuming from checkpoint: [timestamp]
|
|
42
|
-
Source: [auto/manual] checkpoint
|
|
41
|
+
📍 Resuming from checkpoint: [timestamp]
|
|
42
|
+
🏷️ Source: [auto/manual] checkpoint
|
|
43
43
|
[Staleness warning if applicable]
|
|
44
44
|
|
|
45
|
-
### Branch
|
|
46
|
-
[checkpoint branch]
|
|
47
|
-
[Flag if they differ]
|
|
45
|
+
### 🌿 Branch
|
|
46
|
+
`[checkpoint branch]` — currently on `[current branch]`
|
|
47
|
+
[Flag if they differ with ⚠️]
|
|
48
48
|
|
|
49
|
-
### Where We Left Off
|
|
49
|
+
### 📍 Where We Left Off
|
|
50
50
|
[current_state from checkpoint]
|
|
51
51
|
|
|
52
|
-
### What Was Built (Last Session)
|
|
52
|
+
### 🏗️ What Was Built (Last Session)
|
|
53
53
|
[what_was_built from checkpoint]
|
|
54
54
|
|
|
55
|
-
### Decisions Made
|
|
55
|
+
### 🧭 Decisions Made
|
|
56
56
|
[decisions from checkpoint -- or "None recorded"]
|
|
57
57
|
|
|
58
|
-
### Blockers
|
|
59
|
-
[blockers from checkpoint -- or "None"]
|
|
60
|
-
[If blockers exist, surface them prominently with
|
|
58
|
+
### 🚧 Blockers
|
|
59
|
+
[blockers from checkpoint -- or "✅ None"]
|
|
60
|
+
[If blockers exist, surface them prominently with ⚠️]
|
|
61
61
|
|
|
62
|
-
### Active Plan Context
|
|
62
|
+
### 📋 Active Plan Context
|
|
63
63
|
[If plan_reference exists: show the reference, then the extracted section content from step 5]
|
|
64
64
|
[If no plan_reference: "No active plan"]
|
|
65
65
|
|
|
66
|
-
### Changes Since Checkpoint
|
|
66
|
+
### 🔀 Changes Since Checkpoint
|
|
67
67
|
[Diff intelligence summary from step 6]
|
|
68
68
|
[Files changed, new commits, dependency changes]
|
|
69
69
|
|
|
70
|
-
### Next Steps
|
|
70
|
+
### 🎯 Next Steps
|
|
71
71
|
Present as numbered action items:
|
|
72
72
|
1. [first action from next_steps]
|
|
73
73
|
2. [second action if applicable]
|
|
74
74
|
...
|
|
75
75
|
|
|
76
|
-
### Uncommitted Work
|
|
76
|
+
### 📝 Uncommitted Work
|
|
77
77
|
[checkpoint uncommitted_files vs current git status]
|
|
78
|
-
[Flag if they differ -- someone may have stashed or committed manually]
|
|
78
|
+
[Flag if they differ with ⚠️ -- someone may have stashed or committed manually]
|
|
79
79
|
|
|
80
|
-
### Commits From Last Session
|
|
80
|
+
### 📜 Commits From Last Session
|
|
81
81
|
[git_snapshot from checkpoint -- these are the commits made during that session]
|
|
82
82
|
[If empty: "No commits were made in the last session"]
|
|
83
83
|
|
|
84
|
-
### Git Activity Since Checkpoint
|
|
84
|
+
### 🆕 Git Activity Since Checkpoint
|
|
85
85
|
[Any NEW commits since the checkpoint timestamp that were NOT in git_snapshot]
|
|
86
86
|
[If none: "No new commits since checkpoint"]
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
-
8. End with: "Ready to continue. Want me to start with step 1, or are we doing something else?" (referring to the numbered action items above)
|
|
89
|
+
8. End with: "✅ Ready to continue. Want me to start with step 1, or are we doing something else?" (referring to the numbered action items above)
|
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
|
-
import { readFileSync, writeFileSync,
|
|
2
|
+
import { readFileSync, writeFileSync, existsSync, statSync, lstatSync, readdirSync, unlinkSync, symlinkSync, rmSync, } from "fs";
|
|
3
3
|
import { execSync } from "child_process";
|
|
4
4
|
import { fileURLToPath } from "url";
|
|
5
5
|
import path from "path";
|
|
@@ -214,15 +214,31 @@ export function installCommands() {
|
|
|
214
214
|
const files = readdirSync(sourceDir).filter((f) => f.endsWith(".md"));
|
|
215
215
|
for (const file of files) {
|
|
216
216
|
const targetPath = path.join(targetDir, file);
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
217
|
+
const sourcePath = path.join(sourceDir, file);
|
|
218
|
+
const name = file.replace(".md", "");
|
|
219
|
+
let isSymlink = false;
|
|
220
|
+
try {
|
|
221
|
+
isSymlink = lstatSync(targetPath).isSymbolicLink();
|
|
222
|
+
}
|
|
223
|
+
catch {
|
|
224
|
+
// File doesn't exist
|
|
225
|
+
}
|
|
226
|
+
if (isSymlink) {
|
|
227
|
+
// Our symlink — update to point to current package version
|
|
228
|
+
unlinkSync(targetPath);
|
|
229
|
+
symlinkSync(sourcePath, targetPath);
|
|
230
|
+
console.error(` Updated /${name}`);
|
|
231
|
+
installed++;
|
|
232
|
+
}
|
|
233
|
+
else if (existsSync(targetPath)) {
|
|
234
|
+
// Regular file from old install — don't overwrite
|
|
235
|
+
console.error(` Skipping ${name} -- already exists (run uninstall first to upgrade)`);
|
|
220
236
|
skipped++;
|
|
221
237
|
}
|
|
222
238
|
else {
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
console.error(`
|
|
239
|
+
// Fresh install — create symlink
|
|
240
|
+
symlinkSync(sourcePath, targetPath);
|
|
241
|
+
console.error(` Linked /${name}`);
|
|
226
242
|
installed++;
|
|
227
243
|
}
|
|
228
244
|
}
|