direct-handoff
Skill0 starsChanged 55 days agoMITView on GitHub
Hand off the current task to a fresh Claude session in a terminal-multiplexer sidecar pane. This skill should be used when context is getting heavy (>50%), when a task needs a fresh context window, or when the user explicitly asks to hand off work. Handles doc updates, ephemeral context capture, task list transition, and sidecar launch with confirmation.
We split this skill into the rules it gives an agent
17 rules. About 0 are common, 13 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈13
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 41
Before any handoff mechanics, ensure all session learnings are in their permanent homes.
- Distinctive: line 49
If any in-progress documents were being worked on this session, update them now.
- Distinctive: line 57
Verify the task list reflects current state:
- Very specific: line 67
Write to /tmp/handoff-<topic>.txt only content that has no permanent home:
- Distinctive: line 73
Keep it short: If the handoff doc exceeds ~50 lines, something belongs in a durable location instead.
- Distinctive: line 90
If everything is already in durable docs and the task list, skip this step entirely.
- Very specific: line 94
Session naming convention: If the current session was named (via /rename), the new session inherits the name with a sequence suffix -N.
- Distinctive: line 107
Detect or create the pane: Default (stock tmux):
- Distinctive: line 128
If you have a richer sidecar skill installed (e.g.
- Distinctive: line 134
Use the Write tool to create the ephemeral handoff file (if Step 3 produced one) and a prompt file with the prompt content.
- Distinctive: line 141
If a richer sidecar skill is installed, its delivery mechanism may be more robust — use it if available, but the buffer load/paste sequence …
- Distinctive: line 164
If anything goes wrong, this session is still here as fallback
- Distinctive: line 179
No tmux session available
- Very specific: line 197
Read resources/personal-skill.md if it exists — personal tool bindings and preferences.
- Very specific: line 198
Read resources/domain-skill.md if it exists — project-specific configuration.
- Distinctive: line 199
Check the project's CLAUDE.md / CLAUDE.local.md for environment-level capability bindings.
- Distinctive: line 213
Default when unbound: skip the session log checklist item.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Direct Handoff
Hand off the current task to a fresh Claude session in a terminal-multiplexer sidecar pane. The receiving session gets full context through updated durable docs + task list + a minimal ephemeral handoff for anything that doesn't have a permanent home.
Why Direct Handoff (Not /clear or /compact)
Direct handoff creates a new session alongside the old one. The old session stays open and accessible — scroll up, re-read context, copy information. This is better than /clear (destroys context) or /compact (lossy compression) because:
- Old context is preserved intact while the new session ramps up
- Graceful transition — verify the new session is running smoothly before abandoning the old one
- Rollback — if the handoff goes wrong, the old session is still there
- Session sequence — named sessions (e.g.,
feature-x,feature-x-1,feature-x-2) form a clear lineage
The old session can be closed once the new one is confirmed working.
Core Principle: Update Existing Docs, Don't Create New Ones
The handoff doc is a last resort, not the primary mechanism. Before creating any handoff content:
- Update memory files — decisions, patterns, team roles belong in
memory/ - Update project docs — research findings, specs, architecture docs belong in their permanent homes
- Update specs — requirement changes discovered during the session belong in the spec files
- Task list is the coordination backbone — the receiving session sees it via
TaskList
The /tmp handoff doc captures only what's truly ephemeral: gathered signal references (Slack thread timestamps, file paths scanned), session-specific context that hasn't been persisted yet, and the receiving session's marching orders.
Workflow
Step 1: Persist Durable Context
Before any handoff mechanics, ensure all session learnings are in their permanent homes.
Checklist:
- Memory files updated? (decisions, patterns, team roles →
memory/) - Specs updated? (requirement changes →
specs/) - Project docs updated? (research, analysis →
project-docs/) - Session log entry written? (use the session-logging capability if configured)
If any in-progress documents were being worked on this session, update them now. The goal: if the handoff doc disappeared, the receiving session could still reconstruct most context from durable sources.
Step 2: Review Task List
TaskListVerify the task list reflects current state:
- In-progress tasks marked correctly
- Completed tasks resolved
- Remaining work captured as pending tasks with clear descriptions
- Task descriptions contain enough context for an independent reader
The task list is what the receiving session will use to know what to do. If tasks are vague or missing context, fix them now — not in the handoff doc.
Step 3: Create Ephemeral Handoff (Only If Needed)
Write to /tmp/handoff-<topic>.txt only content that has no permanent home:
- Signal references — Slack thread timestamps, file paths that were scanned, URLs visited
- Unpersisted session context — e.g., "we discussed X with the user but haven't updated the spec yet"
- Receiving session instructions — what to do first, which task to start with, any special mode (e.g., "present each section for review")
Keep it short. If the handoff doc exceeds ~50 lines, something belongs in a durable location instead.
Format:
## Handoff: <topic>
<Date>
### What the receiving session should do first
<Clear instruction, e.g., "Read project-docs/X.md then start task #8">
### Signal references gathered this session
<File paths, Slack thread_ts values, URLs — things the receiving session needs to re-read>
### Unpersisted context
<Anything discussed but not yet written to durable docs>If everything is already in durable docs and the task list, skip this step entirely. Just send the prompt directly.
Step 4: Name the New Session and Create Sidecar Pane
Session naming convention: If the current session was named (via /rename), the new session inherits the name with a sequence suffix -N.
# Naming sequence:
# feature-x → feature-x-1
# feature-x-1 → feature-x-2
# feature-x-2 → feature-x-3
# my-task → my-task-1
# If current name already ends in -N, increment N
# If current name has no suffix, append -1Detect or create the pane. Default (stock tmux):
# Get current location
LOCATION=$(tmux display-message -p '#S:#I')
# Check for existing panes
tmux list-panes -t $LOCATION -F '#P: #{pane_current_command}'If a Claude pane already exists (pane running claude), use it.
If no sidecar exists, create one:
tmux split-window -v -t $LOCATION
tmux send-keys -t ${LOCATION}.1 'claude' C-m
sleep 6
# Verify Claude started
tmux capture-pane -p -t ${LOCATION}.1If you have a richer sidecar skill installed (e.g. one that adds pane-status polling or private launch helpers), use it in place of the raw commands above — but the plain tmux sequence is the default and works with nothing else installed.
Do NOT send /rename or other slash commands programmatically into the new pane. Slash commands sent that way are unreliable and can break the receiving session. Instead, tell the user what to name the session, or include a note in the prompt asking the receiving session to suggest a name.
Step 5: Compose and Send Handoff Prompt
- Use the Write tool to create the ephemeral handoff file (if Step 3 produced one) and a prompt file with the prompt content.
- Deliver the prompt into the pane reliably. Sending raw keystrokes through
send-keyscan misfire on slash commands or special characters, so load the prompt into the tmux paste buffer and paste it as a single unit. Default (stock tmux):
tmux load-buffer /tmp/handoff-prompt.txt
tmux paste-buffer -t ${LOCATION}.1
tmux send-keys -t ${LOCATION}.1 C-mIf a richer sidecar skill is installed, its delivery mechanism may be more robust — use it if available, but the buffer load/paste sequence above is the default that works standalone.
Prompt structure:
- One-line summary of what the receiving session is doing
- Point to the task list: "Check TaskList for tasks #N-#M"
- Point to durable docs: "Read
<file>for full context" - Point to ephemeral handoff (if created): "Read
<path>for signal references" - Any special instructions (e.g., "present each section for user review", "say TASK COMPLETE when done")
- Suggest a session name for the user to apply manually (e.g., "Suggested session name:
feature-x-1")
Step 6: Confirm and Transition
Give the pane a few seconds to start working, then check its status. Default (stock tmux):
sleep 8
tmux capture-pane -p -t ${LOCATION}.1Read the captured output to verify the session is actively working, not idle or blocked. If idle or blocked, check the output and retry or troubleshoot. If a richer sidecar skill provides a dedicated status check, prefer it — but capturing and reading the pane is the default.
Report to user:
- Handoff complete, new session
<name>is working - The old session (this one) stays open — user can scroll up, re-read, copy context
- Once the new session is confirmed running smoothly, user can close this session
- If anything goes wrong, this session is still here as fallback
When to Use This Skill
- Context usage exceeds ~50% and significant work remains
- User explicitly asks to hand off or "use a fresh session"
- Task is well-defined enough that a new session can pick it up from docs + task list
- Current session has gathered signals/context that would be lost to compaction
When NOT to Use This Skill
- Task is nearly complete — just finish it
- The work requires deep conversational context that can't be captured in docs (e.g., nuanced design discussion still in progress)
- No tmux session available
Anti-Patterns
- Dumping everything into the handoff doc — If it's durable knowledge, put it in a durable location
- Vague task descriptions — "Continue the work" is not a handoff. Task list entries must be specific.
- Skipping Step 1 — Updating durable docs IS the handoff. The sidecar mechanics are just the delivery.
- Creating handoff docs for things that belong in memory/ — Decisions and patterns persist across sessions via memory files, not handoff docs
Interoperates With
- tmux-sidecar — if you have a richer sidecar skill covering pane detection, creation, prompt delivery, and status-check mechanics, it can replace the stock tmux commands this skill uses by default in Steps 4-6. Not required — the stock commands work standalone.
Project and User Configuration
Load configuration in this order. When multiple sources define the same binding, the first one found wins — stop checking lower sources for that binding:
- Read
resources/personal-skill.mdif it exists — personal tool bindings and preferences. - Read
resources/domain-skill.mdif it exists — project-specific configuration. - Check the project's CLAUDE.md / CLAUDE.local.md for environment-level capability bindings.
- For any capability still unbound, use the defaults specified in this skill.
Extension Points
domain-skill.md
Provide project-specific handoff configuration:
- Where durable docs, memory, and specs live in this project (paths Step 1 should check)
- Project-specific session-naming conventions, if different from the default sequence
- Any team convention for what belongs in the ephemeral handoff vs. durable docs
personal-skill.md
Provide session-logging preferences:
- Map the session-logging capability to a concrete tool (see Standard Capability Catalog in the plugin architecture spec — e.g. a session-logging MCP tool, or file-based logging)
- Default when unbound: skip the session log checklist item; rely on durable docs and the task list as the record of what happened
In this repository43 other files it gives its agents.
- skills/technical/supabase-postgres-best-practices/AGENTS.mdAGENTS.md
- skills/technical/supabase-postgres-best-practices/CLAUDE.mdCLAUDE.md
- handoffSkill
- nt-commsSkill
- threadsSkill
- meal-planningSkill
- resume-workflowSkill
- bash-scriptsSkill
- code-reviewSkill
- davinci-resolveSkill
- disk-cleanupSkill
- fastmcp-pythonSkill
- go-cliSkill
- markdown-to-pdfSkill
- pr-createSkill
- qa-planSkill
- rcaSkill
- react-native-best-practicesSkill
- ruby-railsSkill
- skill-creatorSkill
- spec-checkSkill
- supabase-migrationsSkill
- supabase-postgres-best-practicesSkill
- supabase-sqlSkill
- testingSkill
- ui-state-managementSkill
- waydroid-adbSkill
- calcinatioSkill
- citationsSkill
- exploreSkill
- manual-qaSkill
- nvim-copilotSkill
- orchestrateSkill
- orthogonal-emanationSkill
- product-intent-signal-extractionSkill
- project-management-signal-extractionSkill
- request-researchSkill
- researchSkill
- skill-discoverySkill
- slack-thread-triageSkill
- specSkill
- tmux-sidecarSkill
- youtube-transcribeSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

