save-task-list
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSave Task List for Reuse
保存任务列表以便重复使用
Save the current session's task list so it can be restored in future sessions.
保存当前会话的任务列表,以便在未来会话中恢复使用。
Session Context
会话上下文
- Session ID: ${CLAUDE_SESSION_ID}
- Active task directories: !
ls -1t ~/.claude/tasks/ 2>/dev/null | head -5 || echo "none found" - Current tasks in session: !
ls -1t ~/.claude/tasks/ 2>/dev/null | head -1 | xargs -I{} ls ~/.claude/tasks/{} 2>/dev/null | head -10 || echo "no tasks"
- 会话ID: ${CLAUDE_SESSION_ID}
- 活跃任务目录: !
ls -1t ~/.claude/tasks/ 2>/dev/null | head -5 || echo "none found" - 会话中的当前任务: !
ls -1t ~/.claude/tasks/ 2>/dev/null | head -1 | xargs -I{} ls ~/.claude/tasks/{} 2>/dev/null | head -10 || echo "no tasks"
Instructions
操作步骤
-
Find the current task list ID by checkingfor the most recently modified directory. List the directories sorted by modification time.
~/.claude/tasks/ -
Verify the match — read the task files inside the directory and compare them to any tasks you know about from this session. Confirm you have the correct task list.
-
Log the session mapping — write the mapping to:
.claude/archon/sessions/bashmkdir -p .claude/archon/sessions echo '{"session": "${CLAUDE_SESSION_ID}", "task_list": "<TASK_LIST_ID>", "saved_at": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"}' \ >> .claude/archon/sessions/task-lists.jsonl -
Verify the SessionStart hook is installed — the project-levelalready includes a SessionStart hook that runs
.claude/settings.jsonon every session start. Confirm it's present by reading the file. If it's missing for some reason, add it back:verify-task-list.shjson{ "hooks": { "SessionStart": [ { "hooks": [ { "type": "command", "command": ".claude/skills/save-task-list/hooks/verify-task-list.sh", "statusMessage": "Checking for restored task list..." } ] } ] } }Important: Merge — don't overwrite existing settings. Iforhooksalready exists, append to the array. If the hook is already installed, skip this step.SessionStart -
Output the startup command for the user:
To continue with this task list in a new session: CLAUDE_CODE_TASK_LIST_ID=<task_list_id> claudeExplain: On startup, the SessionStart hook will verify the task list exists and show a confirmation message. -
Show the current task summary so the user knows what's preserved (task subjects, statuses, and any dependencies).
-
查找当前任务列表ID:检查目录下最近修改的目录,按修改时间排序列出这些目录。
~/.claude/tasks/ -
验证匹配:读取目录内的任务文件,并与您在本次会话中已知的任务进行对比,确认您找到的是正确的任务列表。
-
记录会话映射:将映射关系写入目录:
.claude/archon/sessions/bashmkdir -p .claude/archon/sessions echo '{"session": "${CLAUDE_SESSION_ID}", "task_list": "<TASK_LIST_ID>", "saved_at": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"}' \ >> .claude/archon/sessions/task-lists.jsonl -
验证SessionStart钩子已安装:项目级别的文件已包含一个SessionStart钩子,会在每次会话启动时运行
.claude/settings.json。通过读取该文件确认钩子是否存在。如果因某些原因缺失,请重新添加:verify-task-list.shjson{ "hooks": { "SessionStart": [ { "hooks": [ { "type": "command", "command": ".claude/skills/save-task-list/hooks/verify-task-list.sh", "statusMessage": "Checking for restored task list..." } ] } ] } }重要提示:合并而非覆盖现有设置。如果或hooks已存在,请追加到数组中。如果钩子已安装,请跳过此步骤。SessionStart -
输出启动命令给用户:
To continue with this task list in a new session: CLAUDE_CODE_TASK_LIST_ID=<task_list_id> claude说明:启动时,SessionStart钩子会验证任务列表是否存在,并显示确认消息。 -
显示当前任务摘要,让用户了解保存的内容(任务主题、状态以及任何依赖关系)。