clawt 2.10.1 → 2.11.1

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.
@@ -35,7 +35,9 @@
35
35
  - remove 批量操作时收集错误继续处理,最后汇总报告
36
36
  - 文档中文风格,技术术语保留英文(worktree, merge, branch, SIGINT 等)
37
37
  - cleanupWorktrees 是 merge 和 run 共用的公共清理函数(在 src/utils/worktree.ts)
38
- - `launchInteractiveClaude` 是 run(交互式模式)和 resume 共用的公共函数(在 src/utils/claude.ts
38
+ - `launchInteractiveClaude` 是 run(交互式模式)和 resume 共用的公共函数(在 src/utils/claude.ts),启动前自动检测会话历史并追加 `--continue`
39
+ - `hasClaudeSessionHistory` 检测 `~/.claude/projects/<encoded-path>/` 下是否有 `.jsonl` 文件(在 src/utils/claude.ts)
40
+ - `CLAUDE_PROJECTS_DIR` 常量(`~/.claude/projects/`)定义在 `src/constants/paths.ts`
39
41
  - killAllChildProcesses 是 run 专用的子进程终止函数(在 src/utils/shell.ts)
40
42
  - validate 快照管理函数在 `src/utils/validate-snapshot.ts`,被 validate、merge、remove 和 status 四个命令使用
41
43
  - `confirmDestructiveAction` 在 `src/utils/formatter.ts`,被 reset、validate --clean 和 config reset 使用
@@ -60,7 +62,11 @@
60
62
 
61
63
  run 命令有两种模式(自 claudeCodeCommand 特性后):
62
64
  - 不传 `--tasks`:交互式界面模式(单 worktree + `launchInteractiveClaude` + spawnSync)
63
- - 传 `--tasks`:并行任务模式(多 worktree + `executeClaudeTask` + spawnProcess)
65
+ - 传 `--tasks`:并行任务模式(多 worktree + `executeBatchTasks` + spawnProcess)
66
+ - 批量任务执行逻辑从 `src/commands/run.ts` 提取到 `src/utils/task-executor.ts`(公共函数 `executeBatchTasks`)
67
+ - 进度面板渲染逻辑从 `src/utils/progress.ts` 拆分出 `src/utils/progress-render.ts`(纯渲染函数 + TaskProgress 类型)
68
+ - `formatDuration` 从 `src/utils/progress.ts` 移至 `src/utils/formatter.ts`
69
+ - 进度面板每个任务行末尾显示 worktree 路径(终端可点击跳转)
64
70
 
65
71
  ## 命令清单(11 个)
66
72
 
package/README.md CHANGED
@@ -44,13 +44,36 @@ clawt remove -b feature-auth
44
44
  ### `clawt run` — 创建 worktree 并执行任务
45
45
 
46
46
  ```bash
47
+ # 单 worktree,打开 Claude Code 交互式界面(最常用)
48
+ clawt run -b <branch>
49
+
47
50
  # 多任务并行(每个 --tasks 对应一个独立 worktree)
48
51
  clawt run -b <branch> --tasks "任务1" --tasks "任务2"
49
52
 
50
- # 单 worktree,打开 Claude Code 交互式界面
51
- clawt run -b <branch>
53
+ # 从任务文件读取任务列表(使用文件中定义的分支名)
54
+ clawt run -f tasks.md
55
+
56
+ # 从任务文件读取任务,但用 -b 自动编号分支(文件中分支名可省略)
57
+ clawt run -f tasks.md -b feat
58
+ ```
59
+
60
+ **任务文件格式:**
61
+
62
+ ```markdown
63
+ <!-- CLAWT-TASKS:START -->
64
+ # branch: feat-login
65
+ 实现用户登录功能
66
+ <!-- CLAWT-TASKS:END -->
67
+
68
+ <!-- CLAWT-TASKS:START -->
69
+ # branch: fix-bug
70
+ 修复内存泄漏问题
71
+ 支持多行任务描述
72
+ <!-- CLAWT-TASKS:END -->
52
73
  ```
53
74
 
75
+ > 使用 `-b` 时,文件中的 `# branch: ...` 行可省略,分支名由 `-b` 值自动编号(如 `feat-1`、`feat-2`)。
76
+
54
77
  按 `Ctrl+C` 可中断所有任务。
55
78
 
56
79
  ### `clawt resume` — 恢复之前的 Claude Code 会话
@@ -60,6 +83,8 @@ clawt resume -b <branch> # 指定分支
60
83
  clawt resume # 交互式选择
61
84
  ```
62
85
 
86
+ 如果目标 worktree 存在历史会话,会自动继续上次对话(`--continue`)。
87
+
63
88
  ### `clawt create` — 仅创建 worktree(不执行任务)
64
89
 
65
90
  ```bash