원클릭으로
save-session
在对话 compact 前保存会话行动路线摘要。当检测到 context 即将满、用户准备结束会话、或用户主动调用时使用。提炼关键 prompt、思路、探索方向和执行结果,写入 docs/history/ 目录。
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
在对话 compact 前保存会话行动路线摘要。当检测到 context 即将满、用户准备结束会话、或用户主动调用时使用。提炼关键 prompt、思路、探索方向和执行结果,写入 docs/history/ 目录。
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Run, monitor, recover, and babysit ML evaluation experiments end-to-end. Covers the full lifecycle: intent alignment, dry-run validation, auto-launch, checkpoint recovery, real-time/cron-based self-healing monitoring, and post-completion validation. TRIGGER when: user wants to run/start/launch/rerun experiments or evaluations, monitor running experiments or check experiment logs, recover from failures like 429 quota errors or process death, set up monitoring for long-running tasks, or do a dry-run before committing to a full run. Also trigger for 'babysit', 'experiment-runner', and when user provides monitor CLI args like 'monitor experiments/X.json --log Y --expected N'. DO NOT trigger for: analyzing/comparing existing results (tables, charts, LaTeX), writing scripts to parse result files, code review or code modification, dataset creation or preprocessing, GPU/system monitoring, training job submission (use amlt-run-job), or autonomous development tasks.
Bootstrap a new project for Claude Code: writes CLAUDE.md, research-notes.md, pyproject.toml/equivalent, and .gitignore from project-type signals (ML research / web app / CLI / library / data pipeline). Dry-run preview before writing. TRIGGER when: bootstrap project, init-project, 配置新项目, new project setup. DO NOT trigger when: editing an existing CLAUDE.md (use claude-md-improver).
Compact the current conversation into a handoff document for another agent to pick up. Use when the user wants to hand off the current session to a fresh agent, save context before compact, or asks for '交接'/'移交'/'handoff'/'下一个 agent 接手'. Complements save-session (which writes to docs/history/), while handoff writes to OS tmp dir for cross-session pickup.
Use Codex to review code changes AND optionally execute fixes. Two modes — (1) review-only (默认,输出 findings 不动代码); (2) review-and-fix (autonomous, 找出 BLOCKER/MAJOR 后直接派 codex exec 修,最多 N 轮,每轮 Claude 重审). TRIGGER when 用户要 review 代码 / audit a diff / inspect uncommitted work / check branch vs base / 用 codex 修 bug / "review 完顺便修" / "review and fix" / "review 并改" / "review 后自动修"; user mentions /codex-review or invokes Codex for code work. DO NOT trigger for: 单纯写新代码 / feature implementation without prior review intent (let user pick the right entry point), broad architecture discussion without concrete diff.
Use when user invokes /ultra-plan to run an end-to-end loop — interview (Claude clarifies + writes spec) → execute (Codex 默认执行: Single/Todo/Teams 三种粒度,对应 1 次/多次串行/多次并行 `codex exec`) → evaluate (Claude review + AC check) → fix-loop (找到问题派 Codex 修,最多 2 轮) → report. Default Autonomous mode: Phase 1 talks spec clear then AI runs without interrupting user until final report. `/ultra-plan --collaborative` switches to step-by-step user confirmation. **Role split (since 2026-05-10)**: Claude = planner + judge; Codex = executor + fixer. 角色对称。
Simplifies and refines code for clarity, consistency, and maintainability while preserving all functionality. Focuses on recently modified code unless instructed otherwise.
| name | save-session |
| description | 在对话 compact 前保存会话行动路线摘要。当检测到 context 即将满、用户准备结束会话、或用户主动调用时使用。提炼关键 prompt、思路、探索方向和执行结果,写入 docs/history/ 目录。 |
将当前对话的关键行动路线提炼为结构化 Markdown,保存到 docs/history/{project_name}/round_{N}.md。
核心改进: 使用 Agent 子进程执行保存,避免在主 context 中产生大量 token 导致 compact。
/save-session 或 /save-session my-project重要: 如果你感觉当前对话内容已经很丰富(多轮探索、重要决策、实验结果),应主动建议用户运行此 skill 或直接执行。
项目名称优先级:
/save-session estp-phase3misc项目名称应该简短(1-3个词,kebab-case),如:estp-bench、streaming-agent、gui-pipeline
用 Bash 检查已有 round 文件确定编号:
ls docs/history/{project_name}/round_*.md 2>/dev/null | sort -V | tail -1
在你的脑中快速回顾对话,提炼出:
不要在主对话中展开写——只在脑中整理,直接写入 Agent prompt。
必须使用 Agent 工具,不要在主对话中直接写文件。
使用以下模式启动 Agent:
Agent tool:
subagent_type: "general-purpose"
description: "Save session history"
model: "sonnet" (用 sonnet 即可,不需要 opus)
prompt: |
你是会话历史保存助手。请根据当前对话内容,生成结构化的会话历史文件。
## 任务
将当前对话的行动路线保存到: `docs/history/{project_name}/round_{N}.md`
## 项目信息
- 项目名: {project_name}
- Round: {N}
- 日期: {today}
## 对话要点摘要
{你在 Step 2 中整理的要点,200-500 tokens}
## 输出要求
1. 先 `mkdir -p docs/history/{project_name}`
2. 回顾上方对话历史,提炼完整的行动路线
3. 按下面的模板格式写入文件
4. 长度 100-300 行,质量标准:可回顾性、原始性、数据优先
## 模板格式
```markdown
# {Project Name} - Round {N}
> 日期: YYYY-MM-DD
> 会话轮数: 约 X 轮
> 主要方向: {一句话概括}
## 会话目标
{1-3 句话}
## 行动路线
### 1. {阶段标题}
**Prompt**: > {用户原始指令,保留原文}
**探索过程**: - {做了什么} - {发现了什么}
**结果**: {关键数据/结论}
---
### 2. {下一阶段}
...
## 关键决策
| 决策点 | 选择 | 原因 | 备选方案 |
|--------|------|------|----------|
## 关键数据/指标
{硬数据优先}
## 文件变更摘要
- `path/to/file.py` - {修改说明}
## 问题与发现
- **{问题}**: {描述} → {状态}
## 当前状态
{进展到哪一步}
## 下一步
- [ ] TODO 1
- [ ] TODO 2
```
## 质量标准
- 用户的关键 prompt 保留原文,不要改写
- 实验数据、F1 分数、错误信息等硬数据优先保留
- 按对话的实际推进顺序组织
- 使用中文撰写
子 Agent 完成后,简要告知用户保存位置和 round 编号。
model: "sonnet" 节省成本,sonnet 足够完成格式化写作任务~/.claude/backups/{timestamp}_{session_id}_{trigger}.md。即使 /save-session 未运行,原始 prompt 也不会丢失。如果子 Agent 需要补充细节,可以读取该目录下的备份文件