/cairn:handoff [title]from cairn
Save a handoff of the current task so a new session (another account, another agent, or tomorrow) can continue without the user re-explaining. Use when the user wants to stop, switch account, is running out of usage or quota, or says "handoff", "save context", "wrap up for the next session", "bàn giao", "lưu ngữ cảnh", "sắp hết quota", "đổi tài khoản", "lưu lại để làm tiếp".
Ships in cairn. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Write a handoff for the work in THIS conversation and save it with cairn save, in one turn.
Rules:
Next steps is an ordered checklist the next agent can start
on immediately.ARGUMENTS: line follows these instructions, use its text as the title.PROJ-268, from the conversation or
the session name), pass it as --task <id>; otherwise leave --task out. Saving again with
the same task replaces the older handoff of that task.User rules & preferences, quoted briefly;Environment / how to run;~/,
never with your home directory spelled out. Under Key files list every file the next agent
needs, including notes, tickets, evidence and other files git does not track: cairn share
attaches the ones git does not carry. Put pull request links (number and URL) in
Current state or Workspace.Steps:
Fill the template below from this conversation. Replace every <...> and remove the
<!-- --> hints. The three sections marked required must have real content.
Run exactly this, with the filled template between the markers:
cairn save --dir "${CLAUDE_PROJECT_DIR}" --agent claude-code --session ${CLAUDE_SESSION_ID} --task <id> <<'CAIRN_EOF'
<filled template>
CAIRN_EOF
Exit code 3 means the handoff was rejected. Each stderr line is line N: rule: message
(line numbers count from the first line of the template). Fix every reported problem and
run step 2 again. Stop after 3 attempts and show the user the remaining lines verbatim.
If the user wants to send this handoff to someone else (another person, another machine),
also run cairn share --dir "${CLAUDE_PROJECT_DIR}" <task or saved id>. It writes a
.cairn.tgz bundle without the user's local paths, with untracked files and uncommitted work
attached. If it refuses because of secrets, show the listed lines and ask before adding
--redact. Tell the user the bundle path, any warning: lines (for example a commit that is
not pushed), and that the receiver runs cairn import <file> then /cairn:resume <task>.
On success, reply in at most 2 lines: the saved id (and the bundle path if shared), and the first next step.
Template:
# <short title of the task>
## Goal
<!-- required: what the user wants and what "done" means (tests, behaviour) -->
## Current state
<!-- required: what is finished, half-done or broken right now -->
## Next steps
<!-- required: ordered checklist the next agent can start on immediately -->
- [ ] <first step>
## Decisions
<!-- each decision, its reason, and who made it (user, PO with a link or comment id, reviewer);
the next agent must not change it without asking -->
## Tried / didn't work
<!-- approaches that failed and why, so they are not retried -->
## User rules & preferences
<!-- instructions the user gave in this conversation that still apply, quoted briefly:
work mode (e.g. "fix fast, no unit tests"), writing style, how to address people, UI rules -->
## Environment / how to run
<!-- how to bring the work back up: where data comes from and why (e.g. which DB dump),
services and ports, logins the user must redo, launch commands, ids of stopped runs -->
## Open questions
<!-- questions only the user can answer -->
## Key files
<!-- paths that matter, one per line; for files in a temporary worktree give repo, branch
and PR instead, since the worktree may be deleted -->
## Workspace
<!-- one "- label: value" per line; cairn checks worktree and pipeline paths, e.g.
- worktree: .worktrees/proj-268-app
- pipeline: .pipeline/PROJ-268
- db: app_db_proj_268 -->
What SKILL.md sets; muted values are Claude Code's defaults
2 skills in this plugin
Other plugins' skills for the same job
npx claudepluginhub sdc-ren/cairn --plugin cairn