@masslessai/push-todo 3.6.0 → 3.6.2
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/SKILL.md +68 -14
- package/lib/daemon.js +1 -1
- package/package.json +1 -1
package/SKILL.md
CHANGED
|
@@ -38,12 +38,9 @@ When this command is invoked:
|
|
|
38
38
|
|
|
39
39
|
6. **Check for resumable daemon sessions first:**
|
|
40
40
|
- If the task output contains `**Session:** Resumable`, the daemon already ran Claude Code on this task
|
|
41
|
-
- Do NOT start working from scratch — the daemon's session
|
|
42
|
-
-
|
|
43
|
-
|
|
44
|
-
2. To continue where the daemon left off, run in a **new terminal**: `push-todo resume <number>`
|
|
45
|
-
3. This resumes the exact Claude Code conversation with full history
|
|
46
|
-
- Only if the user explicitly says they want to start fresh should you begin new work
|
|
41
|
+
- Do NOT start working from scratch — automatically load the daemon's session context
|
|
42
|
+
- Follow the [Auto-Resume from Session Transcript](#auto-resume-from-session-transcript) procedure below
|
|
43
|
+
- Only if the session transcript cannot be found should you begin working from scratch
|
|
47
44
|
|
|
48
45
|
7. If no resumable session exists, begin working on the task normally
|
|
49
46
|
|
|
@@ -206,17 +203,74 @@ If no CLAUDE.md or README.md exists, generate minimal keywords from:
|
|
|
206
203
|
- Git repo name
|
|
207
204
|
- Primary file extensions (`.swift` -> iOS, `.py` -> Python, `.rs` -> Rust)
|
|
208
205
|
|
|
209
|
-
##
|
|
206
|
+
## Auto-Resume from Session Transcript
|
|
210
207
|
|
|
211
|
-
When
|
|
208
|
+
When a task has a resumable daemon session, automatically load the session context instead of starting from scratch. The daemon's session transcript contains every file read, edit, and decision — use it to continue intelligently.
|
|
212
209
|
|
|
213
|
-
|
|
214
|
-
- The task has a saved Claude Code session from the daemon
|
|
215
|
-
- They can resume it with `push-todo resume <number>` (run in their terminal, not here)
|
|
216
|
-
- This opens an **interactive** Claude Code session with the full conversation history - every file read, edit, and decision the daemon made
|
|
217
|
-
- It must be run on the **same machine** that executed the task (sessions are stored locally)
|
|
210
|
+
### Step 1: Locate the Session File
|
|
218
211
|
|
|
219
|
-
|
|
212
|
+
The daemon runs in a git worktree. Find the session transcript:
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
# Get machine ID suffix for worktree name
|
|
216
|
+
MACHINE_ID=$(cat ~/.config/push/machine_id 2>/dev/null)
|
|
217
|
+
SUFFIX=$(echo "$MACHINE_ID" | rev | cut -d'-' -f1 | rev | cut -c1-8)
|
|
218
|
+
TASK_NUM=<display_number>
|
|
219
|
+
|
|
220
|
+
# Session files are stored under ~/.claude/projects/ with path-encoded directory names
|
|
221
|
+
SESSION_DIR="$HOME/.claude/projects/-Users-$(whoami)-projects-push-${TASK_NUM}-${SUFFIX}"
|
|
222
|
+
SESSION_ID=<session_id_from_task>
|
|
223
|
+
|
|
224
|
+
# Check if transcript exists
|
|
225
|
+
ls "${SESSION_DIR}/${SESSION_ID}.jsonl" 2>/dev/null
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### Step 2: Extract Session Context
|
|
229
|
+
|
|
230
|
+
Read the JSONL transcript and extract what the daemon did:
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
cat "${SESSION_DIR}/${SESSION_ID}.jsonl" | node -e "
|
|
234
|
+
const lines = [];
|
|
235
|
+
process.stdin.on('data', d => lines.push(d));
|
|
236
|
+
process.stdin.on('end', () => {
|
|
237
|
+
const entries = Buffer.concat(lines).toString().split('\n')
|
|
238
|
+
.filter(Boolean).map(l => { try { return JSON.parse(l); } catch { return null; } }).filter(Boolean);
|
|
239
|
+
|
|
240
|
+
const assistantMsgs = entries.filter(e => e.type === 'assistant');
|
|
241
|
+
const edits = [];
|
|
242
|
+
const texts = [];
|
|
243
|
+
|
|
244
|
+
assistantMsgs.forEach(a => {
|
|
245
|
+
(a.message?.content || []).forEach(b => {
|
|
246
|
+
if (b.type === 'text' && b.text.trim()) texts.push(b.text.trim());
|
|
247
|
+
if (b.type === 'tool_use' && (b.name === 'Edit' || b.name === 'Write'))
|
|
248
|
+
edits.push(b.input?.file_path);
|
|
249
|
+
});
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
console.log('FILES_EDITED:', JSON.stringify(edits));
|
|
253
|
+
console.log('---TRANSCRIPT_START---');
|
|
254
|
+
texts.forEach(t => console.log(t));
|
|
255
|
+
console.log('---TRANSCRIPT_END---');
|
|
256
|
+
});
|
|
257
|
+
"
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
### Step 3: Present Context and Continue
|
|
261
|
+
|
|
262
|
+
1. Tell the user what the daemon did (root cause found, files edited, commits made)
|
|
263
|
+
2. Check if the daemon's changes are already in the main branch (it may have committed to a worktree branch)
|
|
264
|
+
3. If the daemon's work is complete but not merged, help merge/cherry-pick the changes
|
|
265
|
+
4. If the daemon's work is incomplete, continue from where it left off using the context
|
|
266
|
+
|
|
267
|
+
### Fallback: Terminal Resume
|
|
268
|
+
|
|
269
|
+
If the session transcript can't be read (file not found, parse error), tell the user they can also resume interactively in a **new terminal**:
|
|
270
|
+
```
|
|
271
|
+
push-todo resume <number>
|
|
272
|
+
```
|
|
273
|
+
This launches a full interactive Claude Code session with the daemon's complete conversation history.
|
|
220
274
|
|
|
221
275
|
## CLI Reference
|
|
222
276
|
|
package/lib/daemon.js
CHANGED