Shed accumulated context mid-session. Writes a knowledge handoff document capturing session state, decisions, observations, and behavioral calibration, then guides the user through /clear and resumption.
From zenflownpx claudepluginhub brewpirate/zen-flow --plugin zenflowThis skill uses the workspace's default tool permissions.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
Long sessions accumulate dead context — file reads, debug output, old diffs — that wastes attention weight and degrades quality. This skill writes a structured handoff document that lets you resume cleanly after /clear.
Announce at start: "Preparing a context refresh handoff."
Suggest (never force) a context refresh when:
Never clear unilaterally. Always frame as a suggestion: "We've accumulated a lot of context from debugging. Want to do a context refresh so we can continue with a clean slate?"
Follow these steps in order:
If the session doesn't already have a name, ask the user to pick one — a short label for this working thread (e.g., "auth-rewrite", "sse-debugging"). This becomes the handoff filename and helps both human and agent recall context later.
Before writing anything, reflect on the session so far:
These observations are the most perishable part of context — task lists survive /clear, but nuance doesn't.
Read TaskList and capture all tasks with their current status.
If any background agents are running:
Invoke field-notes:write with:
context-refreshWrite to .claude/handoffs/<session-name>-<timestamp>.md using the template below. Fill every section — empty sections mean lost context.
"Handoff document written to .claude/handoffs/<filename>. Ready to clear. After you run /clear, re-invoke /zenflow:collab and I'll pick up from the handoff."
# Context Refresh Handoff
<!-- Generated: <timestamp> | Reason: <why the refresh was triggered> -->
## Session Identity
- **Name:** <session name — what the user chose and why>
- **Started:** <when the session began>
- **Refresh count:** <how many refreshes so far, including this one>
## Session Goals
- <What we set out to accomplish — as stated during opening protocol>
## Accomplished
- <Completed items — reference commit hashes, PR numbers, or specific outcomes>
## Active Decisions & Constraints
- <Architectural choices made during this session>
- <User-imposed constraints: e.g., "no changes to auth until after release">
- <Workflow agreements: e.g., "worktree delegation for anything > 20 lines">
- <Technical decisions: e.g., "chose X over Y because Z">
## Behavioral Calibration
<!-- This is critical — without it, the post-clear agent loses partnership dynamics -->
- <User working style: hands-on vs. high-level, terse vs. detailed>
- <Communication preferences: options vs. recommendations, depth of explanation>
- <Corrections received: "User told me not to X" — include why if stated>
- <What's working in the partnership: pacing, delegation style, decision flow>
## User & Session Observations
- <Key notes about the user's focus, energy, or interests this session>
- <Notable discoveries — "aha" moments, surprising findings>
- <Things that shifted our direction and why>
- <Patterns: what the user gravitates toward, what they avoid>
- <Anything significant that doesn't fit other sections>
## Open Tasks
| ID | Status | Subject | Notes |
|----|--------|---------|-------|
<snapshot from TaskList>
## Active Delegates
- <Agent description, what it's working on, expected status>
- <If none: "No active delegates">
## Key Files & Learnings
- `path/to/file` — <what we learned about it, why it matters>
- <Only files still relevant to ongoing work — drop dead-end investigations>
## Next Steps
- <The immediate next action and why it's next>
- <Enough context to pick this up without re-reading the entire history>
- <Any prerequisites or blockers>
When the collab skill detects a recent handoff file (added to collab's opening protocol):
Find the handoff: Check .claude/handoffs/ for files modified within the last 2 hours. If multiple exist, use the most recent.
Read the handoff document in full.
Re-read the collab philosophy — calibration fade applies to /clear just like it does to cross-day resumes. The handoff doc has the facts, but the philosophy re-establishes the behavioral frame.
Acknowledge the refresh to the user:
"Resuming session <name>. Here's where we are:
- [2-3 line summary from handoff]
- Next up: [immediate next step] Does this match your understanding, or has anything changed?"
Check delegate status: If the handoff noted in-flight delegates, check on them now.
Resume from "Next Steps" — don't re-explore accomplished work.
If a handoff file is more than 2 hours old, treat it as informational rather than authoritative:
.claude/handoffs/<session-name>-<ISO-timestamp>.md