@masslessai/push-todo 3.5.7 → 3.5.9

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.
Files changed (3) hide show
  1. package/SKILL.md +10 -1
  2. package/lib/cli.js +25 -1
  3. package/package.json +1 -1
package/SKILL.md CHANGED
@@ -36,7 +36,16 @@ When this command is invoked:
36
36
 
37
37
  5. Ask which task the user wants to work on
38
38
 
39
- 6. When user selects a task, mark it as started and begin working
39
+ 6. **Check for resumable daemon sessions first:**
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 has full context (files read, edits made, decisions)
42
+ - Instead, tell the user:
43
+ 1. The daemon already worked on this task (show the execution summary if available)
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
47
+
48
+ 7. If no resumable session exists, begin working on the task normally
40
49
 
41
50
  ## Review Mode
42
51
 
package/lib/cli.js CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  import { parseArgs } from 'util';
8
8
  import { spawn } from 'child_process';
9
- import { readFileSync } from 'fs';
9
+ import { readFileSync, existsSync } from 'fs';
10
10
  import { join, dirname } from 'path';
11
11
  import { fileURLToPath } from 'url';
12
12
  import * as fetch from './fetch.js';
@@ -17,6 +17,7 @@ import { showSettings, toggleSetting, setMaxBatchSize } from './config.js';
17
17
  import { ensureDaemonRunning, getDaemonStatus, startDaemon, stopDaemon } from './daemon-health.js';
18
18
  import { getScreenshotPath, screenshotExists, openScreenshot } from './utils/screenshots.js';
19
19
  import { bold, red, cyan, dim, green } from './utils/colors.js';
20
+ import { getMachineId } from './machine-id.js';
20
21
 
21
22
  const __filename = fileURLToPath(import.meta.url);
22
23
  const __dirname = dirname(__filename);
@@ -306,6 +307,28 @@ export async function run(argv) {
306
307
  process.exit(1);
307
308
  }
308
309
 
310
+ // Find the worktree directory where the daemon ran this task.
311
+ // Sessions are directory-scoped in Claude Code, so we must launch
312
+ // from the same directory (worktree) where the session was created.
313
+ let resumeCwd = process.cwd();
314
+ try {
315
+ const machineId = getMachineId();
316
+ const parts = machineId.split('-');
317
+ const suffix = parts.length > 1 ? parts[parts.length - 1].slice(0, 8) : machineId.slice(0, 8);
318
+ const worktreeName = `push-${displayNumber}-${suffix}`;
319
+
320
+ // Try to find the worktree relative to CWD's parent (sibling directory)
321
+ const candidate = join(dirname(process.cwd()), worktreeName);
322
+ if (existsSync(candidate)) {
323
+ resumeCwd = candidate;
324
+ console.log(`Found daemon worktree: ${candidate}`);
325
+ } else {
326
+ console.log(dim(`Worktree not found at ${candidate}, using current directory`));
327
+ }
328
+ } catch {
329
+ // Fall back to current directory
330
+ }
331
+
309
332
  // Launch claude --resume with the session ID
310
333
  console.log(`Resuming session for task #${displayNumber}...`);
311
334
  console.log(`Session ID: ${sessionId}`);
@@ -313,6 +336,7 @@ export async function run(argv) {
313
336
 
314
337
  // Use spawn with stdio: 'inherit' to give control to Claude
315
338
  const child = spawn('claude', ['--resume', sessionId], {
339
+ cwd: resumeCwd,
316
340
  stdio: 'inherit',
317
341
  shell: true
318
342
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@masslessai/push-todo",
3
- "version": "3.5.7",
3
+ "version": "3.5.9",
4
4
  "description": "Voice tasks from Push iOS app for Claude Code",
5
5
  "type": "module",
6
6
  "bin": {