Install
openclaw skills install @edwardwason/session-branchBranch a coding session into a new conversation with full context handoff — generate structured handoff doc and startup prompts. Triggers ONLY on '支线任务' / '开个支线' / '分叉'. Do NOT use for new projects, general coding, or non-handoff session management.
openclaw skills install @edwardwason/session-branchBranch your current coding session into a new conversation without losing context.
Before executing any step, the agent MUST:
docs/session-handoff.md)Scan the current conversation and project to extract:
Supplementary context (not token-budgeted): project identity, platform status, env var names (status only), capability boundary, knowledge file index, user preferences.
Consent required: Before scanning any of the following, inform the user what files will be accessed and ask for explicit permission. Skip any category the user declines.
For WorkBuddy, also scan (with user consent):
~/.workbuddy/SOUL.md, IDENTITY.md, USER.md — persona and preferences.workbuddy/memory/MEMORY.md + daily logs — project memory~/.workbuddy/skills/ — list of active skillsFor TRAE SOLO, also scan (with user consent):
.trae/rules/ — project-level rules~/.trae-cn/memory/ — user profile, project memory, recent topics (see references/memory-guide.md for path structure)For Cursor, also scan:
.cursor/rules/ or .cursorrulesFor Claude Code, also scan:
CLAUDE.md in project rootBased on Trae IDE session-copy architecture. The handoff doc uses an 8-section fixed structure with token budget management.
8 Core Sections (token budget ~4000 total):
| # | Section | Priority | Budget | Rule |
|---|---|---|---|---|
| 1 | Primary Request and Intent | P2 | ~300 | Numbered list, deduplicated |
| 2 | Key Technical Concepts | P2 | ~200 | Keyword list, categorized |
| 3 | Files and Code Sections | P1 | ~1200 | Paths + changes + snippets (max 500 chars each) |
| 4 | Errors and Fixes | P1 | ~600 | Recent 5-10 only, description + cause + fix |
| 5 | Problem Solving | P2 | ~300 | Completed achievements + decision chain |
| 6 | All User Messages | P0 | ~800 | Original text with sanitization (strip credentials/PII), truncate >500 chars with "..." |
| 7 | Conversation Language | P3 | ~10 | Single field |
| 8 | Current Work | P0 | ~600 | Active task + unfinished Todos + branchable directions with sanitization (no personal paths) |
Compression priority: When content exceeds budget, compress in reverse priority order (P3 first, P0 last):
<REDACTED> placeholdersSupplementary sections (not budgeted): Project identity, platform status, env vars, capability boundary, knowledge index, user preferences, IDE-specific context (with consent).
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:
docs/session-handoff.md), never absolute paths containing usernames or home directories<project-name>, <owner>, <your-path>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.
Use references/startup-prompts.md to generate the startup prompt for the new conversation.
The prompt must include:
Show the user:
| Capability | Used | Description |
|---|---|---|
| Network | No | No network access required |
| File read/write | Yes | Reads project files; writes docs/session-handoff.md (overwrites if exists). Reads IDE memory/identity files (e.g., ~/.trae-cn/memory/, ~/.workbuddy/SOUL.md) ONLY with explicit user consent — opt-in, never silent reads |
| Environment variables | Yes | Reads env var names (status only, never values) |
| subprocess | No | No subprocess calls |
| External API | No | No external API calls |
| 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/handoff-template.md — Full template for the handoff document (8 sections + supplementary context)references/checklist.md — Validation checklist (8 core sections + supplementary + IDE-specific)references/startup-prompts.md — IDE-specific startup prompt templates (5 IDEs with memory integration)references/memory-guide.md — TRAE memory system reference (3 layers + quick lookup guide)