/install session-branch
Session Branch
Branch your current coding session into a new conversation without losing context.
When to Use
- Current conversation is getting long and context compression is degrading quality
- You want to start a new task on the same project but keep full context
- You need to fork your work into a parallel direction
- User says: "开个支线" / "分叉" / "branch" / "新任务但保留上下文"
Execution Flow
Step 1: Analyze Current Session
Scan the current conversation and project to extract:
- Project identity — name, description, platforms, version, tech stack
- Decision chain — what was chosen, what was rejected, and why
- Data flow — how data moves through the system (input → process → output)
- Capability boundary — what the project CAN do and CANNOT do
- Code changes — what files were modified in this session and why
- Platform status — GitHub, ClawHub, npm, PyPI current state
- Environment — which env vars are set, which need user config
- Knowledge files — index of docs/knowledge/ and docs/rules/ by scenario
- User preferences — language, work style, code style, security sensitivity
- Branchable directions — what can be built next, with files involved and prerequisites
IDE-Specific Additional Scanning
For WorkBuddy, also scan:
- Identity files:
~/.workbuddy/SOUL.md,IDENTITY.md,USER.md— persona and preferences - Memory files:
.workbuddy/memory/MEMORY.md+ daily logs — project memory - Installed skills:
~/.workbuddy/skills/— list of active skills - Scheduled tasks: automation/cron task list and status
- Channel config: IMA knowledge base IDs, Feishu channel configuration
- MCP connectors: active MCP connector status
For TRAE SOLO, also scan:
- Rules:
.trae/rules/— project-level rules - Schedule: TRAE SOLO Schedule task list
For Cursor, also scan:
- Rules:
.cursor/rules/or.cursorrules
For Claude Code, also scan:
- Rules:
CLAUDE.mdin project root
Step 2: Generate Handoff Document
Use the template at references/handoff-template.md to create a structured handoff document.
Save location by IDE:
| IDE | Default path | Rationale |
|---|---|---|
| WorkBuddy | .workbuddy/session-handoff.md |
Align with memory system, keep project root clean |
| TRAE SOLO | docs/session-handoff.md |
Standard docs location |
| Cursor | docs/session-handoff.md |
Standard docs location |
| Claude Code | docs/session-handoff.md |
Standard docs location |
Critical rules:
- NO personal information (real names, emails, specific paths, token values)
- NO project-specific secrets or credentials
- Use generic placeholders:
\x3Cproject-name>,\x3Cowner>,\x3Cyour-path> - The handoff doc must be reusable as a TEMPLATE, not a one-time snapshot
Step 3: Validate with Checklist
Cross-check the generated handoff against references/checklist.md.
Every item must be covered. If something is not applicable, write "N/A" with a reason.
Step 4: Generate Startup Prompt
Use references/startup-prompts.md to generate the startup prompt for the new conversation.
The prompt must include:
- Exact file paths for the new AI to read (absolute or relative per IDE)
- A three-step flow: Load → Report → Ask
- Clear role: "This is a continuation of an existing project, not starting from scratch"
Step 5: Present to User
Show the user:
- The generated handoff document (key sections summary)
- The startup prompt (ready to copy-paste)
- List of files created and their locations
- Ask: "Ready to open a new conversation?"
Configuration
| Setting | Default | Description |
|---|---|---|
handoff_path |
Auto (by IDE) | Where to save the handoff document |
include_checklist |
true |
Whether to validate against checklist |
target_ide |
auto |
Target IDE for startup prompt (auto/trae/workbuddy/cursor/claude-code) |
References
references/handoff-template.md— Full template for the handoff documentreferences/checklist.md— Validation checklist (12 categories + IDE-specific)references/startup-prompts.md— IDE-specific startup prompt templates
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install session-branch - 安装完成后,直接呼叫该 Skill 的名称或使用
/session-branch触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Session Branch 是什么?
Branch a coding session into a new conversation with full context handoff — generate structured handoff doc, startup prompts, and guide the new session to pi... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 40 次。
如何安装 Session Branch?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install session-branch」即可一键安装,无需额外配置。
Session Branch 是免费的吗?
是的,Session Branch 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Session Branch 支持哪些平台?
Session Branch 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Session Branch?
由 AI花生(@edwardwason)开发并维护,当前版本 v1.1.0。