write-session-handoff
Use when asked for a handoff or a resume note, to hand this off, to leave notes for whoever takes over (a teammate or another agent), start a new session, compact the conversation, continue tomorrow, pick this up later, or when context is full. Writes one handoff file outside the
Install
npx skills add https://github.com/Heyvhuang/copybook-skills/tree/main/plugins/skills/skills/write-session-handoff
claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install heyvhuang-copybook-skills@llmmart
git clone https://github.com/Heyvhuang/copybook-skills.git
The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole heyvhuang/copybook-skills collection as a plugin from our marketplace. Git is the plain clone.
Skill manifest
Write a handoff a fresh agent can trust
A fresh agent has no memory of this chat. Give it the next goal, the real status of every check, and links to existing docs without leaking secrets.
1. Set the goal for the next session
Read what the user wants the next session to accomplish and shape the handoff around that goal. Trim background details that do not serve it.
If the user only said they are out of context or asked for a handoff, infer the next goal from the open work and state it at the top. Ask a question only when two next steps conflict and the session gives no hint.
2. Record what is proven and what is stale
Take the time of each test, build or lint run, and of each file edit, from the conversation or from a session log or transcript in the repo; then compare each run against every edit made after it. If the workspace is a git repo, check git status -s and git rev-parse --short HEAD to verify the current commit and modified files.
| Status | When to use it | What to write |
|---|---|---|
| Fresh | No relevant file changed after the run | Command, exit status or count, and commit |
| Stale | Any file was edited after the run | Command, earlier result, and every file edited since |
| Not run | The check was not run in this session | Check name and why it was skipped |
Do not carry forward "tests pass" from an earlier run once files have changed. Mark that result stale, name every edited file (for example, pytest: passed earlier, now stale after edits to src/auth.py and src/session.py), and note that it needs a rerun.
3. Link existing docs instead of copying them
Point to specs, plans, ADRs, issues, commits, and diffs by repo path or URL, such as SPEC.md or a commit hash. Add one short line saying why the next agent should open it.
Do not copy sections into the handoff. Quote at most 3 lines from any linked document, and only when an exact requirement or error string matters.
4. Redact secrets and personal details
Inspect every line before saving, including copied logs, command output, stack traces, and URLs. Replace API keys, tokens, passwords, private keys, auth headers, cookies, emails, and personal details with [REDACTED].
Scan specifically for key-shaped strings (sk-, ghp_, AKIA, bearer tokens, or long hex and base64 values) inside log lines. Keep zero key-shaped strings in the saved file.
5. Save outside the repo and print the path
Write one Markdown file to the OS temp folder so it stays out of the repo ($TMPDIR or /tmp on macOS and Linux, %TEMP% on Windows). Name it with the project or task and a timestamp, such as handoff-auth-20260405-1430.md.
Organize the file into five short parts:
- Next goal: one or two lines on what the next session should finish.
- Where things stand: completed work, open items, blockers, and key decisions.
- Check status: each claim with its command, result, and
fresh,stale(naming edited files), ornot run. - References: paths or URLs to specs, ADRs, issues, commits, and diffs, with a one-line note on each.
- First step: the exact file or command to start with.
Before finishing, review the saved file once: confirm every stale check names the files edited after the run, confirm zero key-shaped strings remain, and confirm linked specs use paths with 3 quoted lines or fewer. Print the full file path and a two-line summary of what is ready and what needs a rerun.
Based on mattpocock/skills (MIT), rewritten by Copybook.
Files (copybook-skills)
-
CHANGES.md 456 B
Loading… -
example.md 1.1 KB
Loading… -
LICENSE 1 KB · in bundle
-
SKILL.md 4 KB
--- name: write-session-handoff description: "Use when asked for a handoff or a resume note, to hand this off, to leave notes for whoever takes over (a teammate or another agent), start a new session, compact the conversation, continue tomorrow, pick this up later, or when context is full. Writes one handoff file outside the repo that separates proven checks from stale ones, links existing specs instead of copying them, and redacts secrets so a fresh agent can resume safely. Not for proving the work is done right now (verify-work-done)." license: MIT (see LICENSE) --- # Write a handoff a fresh agent can trust A fresh agent has no memory of this chat. Give it the next goal, the real status of every check, and links to existing docs without leaking secrets. ## 1. Set the goal for the next session Read what the user wants the next session to accomplish and shape the handoff around that goal. Trim background details that do not serve it. If the user only said they are out of context or asked for a handoff, infer the next goal from the open work and state it at the top. Ask a question only when two next steps conflict and the session gives no hint. ## 2. Record what is proven and what is stale Take the time of each test, build or lint run, and of each file edit, from the conversation or from a session log or transcript in the repo; then compare each run against every edit made after it. If the workspace is a git repo, check `git status -s` and `git rev-parse --short HEAD` to verify the current commit and modified files. | Status | When to use it | What to write | |---|---|---| | Fresh | No relevant file changed after the run | Command, exit status or count, and commit | | Stale | Any file was edited after the run | Command, earlier result, and every file edited since | | Not run | The check was not run in this session | Check name and why it was skipped | Do not carry forward "tests pass" from an earlier run once files have changed. Mark that result `stale`, name every edited file (for example, `pytest: passed earlier, now stale after edits to src/auth.py and src/session.py`), and note that it needs a rerun. ## 3. Link existing docs instead of copying them Point to specs, plans, ADRs, issues, commits, and diffs by repo path or URL, such as `SPEC.md` or a commit hash. Add one short line saying why the next agent should open it. Do not copy sections into the handoff. Quote at most 3 lines from any linked document, and only when an exact requirement or error string matters. ## 4. Redact secrets and personal details Inspect every line before saving, including copied logs, command output, stack traces, and URLs. Replace API keys, tokens, passwords, private keys, auth headers, cookies, emails, and personal details with `[REDACTED]`. Scan specifically for key-shaped strings (`sk-`, `ghp_`, `AKIA`, bearer tokens, or long hex and base64 values) inside log lines. Keep zero key-shaped strings in the saved file. ## 5. Save outside the repo and print the path Write one Markdown file to the OS temp folder so it stays out of the repo (`$TMPDIR` or `/tmp` on macOS and Linux, `%TEMP%` on Windows). Name it with the project or task and a timestamp, such as `handoff-auth-20260405-1430.md`. Organize the file into five short parts: - Next goal: one or two lines on what the next session should finish. - Where things stand: completed work, open items, blockers, and key decisions. - Check status: each claim with its command, result, and `fresh`, `stale` (naming edited files), or `not run`. - References: paths or URLs to specs, ADRs, issues, commits, and diffs, with a one-line note on each. - First step: the exact file or command to start with. Before finishing, review the saved file once: confirm every stale check names the files edited after the run, confirm zero key-shaped strings remain, and confirm linked specs use paths with 3 quoted lines or fewer. Print the full file path and a two-line summary of what is ready and what needs a rerun. Based on mattpocock/skills (MIT), rewritten by Copybook.
Reviews (0)
No reviews yet.
Comments
Sign in to join the conversation.
No comments yet. Start the conversation.