handoff
Session continuity for Claude Code. Gather context at start, archive state at end. Use when user mentions handoff, saving progress, or resuming work.
What this skill does
# Handoff
Session continuity for Claude Code. Like hospital shift changes, bad handoffs lose context.
## Argument: $ARGUMENTS
---
## CONTEXT.md Design
CONTEXT.md has two types of sections:
**Auto-generated** (updated on INIT and END):
- `## Project` - name, description, links
- `## Structure` - current file tree
- `## Invocation` - entry points, commands
**Curated** (preserved, only manual edits):
- `## Stack` - technologies, versions
- `## Patterns` - how things work
- `## What Never Works` - gotchas, anti-patterns
---
## INIT
If `$ARGUMENTS` = "init":
```bash
mkdir -p .handoff/sessions
```
**Scan project structure:**
```bash
ls -la
```
Use Glob tool to find key files:
```
Glob: **/*.md, **/*.json, **/package.json, **/*.lock*
```
**Detect package manager:**
```bash
ls bun.lockb package-lock.json pnpm-lock.yaml yarn.lock 2>/dev/null | head -1
```
Write `.handoff/CONTEXT.md`:
```markdown
# [Project Name]
> [One-line description from package.json or README]
## Links
| Resource | URL |
|----------|-----|
| Repository | [from git remote] |
| Local | [pwd] |
## Stack
<!-- CURATED: Edit manually -->
| Layer | Tech | Version |
|-------|------|---------|
| Runtime | [detected] | |
| Framework | | |
## Structure
<!-- AUTO: Regenerated on END -->
```
[file tree from scan]
```
## Invocation
<!-- AUTO: Regenerated on END -->
| Method | Command | Purpose |
|--------|---------|---------|
| Dev | `[pkg] run dev` | Start dev server |
| Build | `[pkg] run build` | Production build |
| Test | `[pkg] test` | Run tests |
| Lint | `[pkg] run lint` | Lint check |
## Patterns
<!-- CURATED: Edit manually -->
Key patterns and conventions used in this codebase.
## What Never Works
<!-- CURATED: Edit manually -->
| Problem | Solution |
|---------|----------|
```
Write `.handoff/HANDOFF.md`:
```markdown
# Handoff
> Session: YYYY-MM-DD HH:MM
> Severity: π’ READY
## Health
| Check | Status |
|-------|--------|
| Build | βΈοΈ not run |
| Tests | βΈοΈ not run |
| Lint | βΈοΈ not run |
## Git
- Branch: main
- Status: clean
## Done
_Nothing yet._
## Failed
_None._
## Blockers
_None._
## Watch Out For
_None yet._
## Resume
**Next:** Run `/handoff start` to begin
**Files:** -
**Context:** Fresh initialization
```
Done. Run `/handoff start` to begin first session.
---
## START
If `$ARGUMENTS` is empty or = "start":
### Phase 1: Establish Timeline
```bash
ls -1 .handoff/sessions/*.md 2>/dev/null | sort -r | head -1
```
Session files use Claude session IDs (v1.1.0+) or timestamps (legacy).
If no sessions, this is first start - use all available history.
### Phase 2: Validate CONTEXT.md
**2a. Read CONTEXT.md**
```
Read .handoff/CONTEXT.md
```
**2b. Check for drift**
Extract file paths from `## Structure` section. Verify they exist:
```bash
# For each path in Structure section
test -e "[path]" && echo "β [path]" || echo "β MISSING: [path]"
```
**2c. Report drift**
If any files are missing or new files exist that aren't in Structure:
```
β οΈ CONTEXT DRIFT DETECTED
ββ Missing: [list of files in CONTEXT.md that don't exist]
ββ New: [list of key files not in CONTEXT.md]
ββ Run `/handoff end` to update, or edit CONTEXT.md manually
```
### Phase 3: Gather State
**3a. Project Identity**
```
Read .handoff/CONTEXT.md
```
Extract: stack, commands, critical paths, patterns, gotchas.
**3b. Last Handoff State**
```
Read .handoff/HANDOFF.md
```
Extract: severity, health status, done, failed, blockers, watch-out-for, resume point.
**3c. Current Git State**
```bash
git branch --show-current
git status -s | head -20
```
**3d. Commits Since Last Session**
```bash
git log --since="YYYY-MM-DD HH:MM" --format="%h %s%n%b" 2>/dev/null
```
If no session history, use `git log -10 --format="%h %s%n%b"`.
**3e. PR Activity Since Last Session**
```bash
# Currently open
gh pr list --state=open --json number,title,body,headRefName 2>/dev/null
# Merged since
gh pr list --state=merged --search "merged:>YYYY-MM-DD" --json number,title,body 2>/dev/null
# Opened since
gh pr list --state=all --search "created:>YYYY-MM-DD" --json number,title,body,state 2>/dev/null
```
**3f. Linear Issues (if configured)**
```
mcp__plugin_linear_linear__list_issues
```
Filter to issues updated since last session.
**3g. Subagent Activity (if present)**
```bash
cat .handoff/.subagents.log 2>/dev/null | tail -20
```
Shows which subagents ran during previous session (logged by SubagentStart/SubagentStop hooks).
### Phase 4: Assess Current Health
Check if state has drifted since handoff:
- Did git status change? (new commits from elsewhere?)
- Are there uncommitted changes not in handoff?
### Phase 5: Complete Previous Handoff Tasks
Check for pending handoff tasks from previous session and mark them complete:
```
TaskList # Check for existing handoff tasks
```
For any tasks with `handoff: true` metadata that are still pending, mark them complete:
```
TaskUpdate(taskId: "[id]", status: "completed") # Previous resume point - session started
```
### Phase 6: Output Read-Back
```
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β HANDOFF RECEIVED β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ£
β Project: [name] β
β Stack: [from CONTEXT.md] β
β Severity: [π΄ CRITICAL | π‘ IN PROGRESS | π’ READY] β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
[If drift detected:]
β οΈ CONTEXT DRIFT
[list of missing/new files]
SINCE LAST SESSION ([date], [N] days ago)
ββ Commits: [N]
ββ PRs: [N] merged, [N] opened, [N] open
ββ Issues: [N] updated
HEALTH AT HANDOFF
ββ Build: [β|β|βΈοΈ]
ββ Tests: [β N/N | β N failed | βΈοΈ]
ββ Lint: [β|β|βΈοΈ]
CURRENT STATE
ββ Branch: [branch]
ββ Status: [clean | N modified, N untracked]
ββ Drift: [none | β οΈ changed since handoff]
β οΈ WATCH OUT FOR
[bulleted list from HANDOFF.md]
π« BLOCKERS ([N])
[bulleted list from HANDOFF.md]
β FAILED (Don't Retry)
[list of failed items with reasons]
βΆοΈ RESUME
[Next action from HANDOFF.md]
[Files to read]
[Context/reasoning]
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Ready. What would you like to work on?
```
**Context loaded. Ready to proceed with user's task.**
---
## END
If `$ARGUMENTS` = "end":
### Phase 1: Archive Current State
```bash
cp .handoff/HANDOFF.md ".handoff/sessions/${CLAUDE_SESSION_ID}.md"
```
Clear subagent activity log (will be regenerated during next session):
```bash
rm -f .handoff/.subagents.log 2>/dev/null
```
### Phase 2: Capture Health Status
Run health checks using commands from CONTEXT.md:
```bash
# Build (capture exit code and last 5 lines)
npm run build 2>&1 | tail -5; echo "EXIT:$?"
# Tests (capture exit code and summary)
npm run test 2>&1 | tail -10; echo "EXIT:$?"
# Lint (capture exit code and issues)
npm run lint 2>&1 | tail -5; echo "EXIT:$?"
```
Detect package manager from lockfile:
- `bun.lockb` β bun
- `pnpm-lock.yaml` β pnpm
- `yarn.lock` β yarn
- `package-lock.json` β npm
### Phase 3: Capture Git State
```bash
git branch --show-current
git status -s | head -20
git log -5 --format="%h %s"
```
### Phase 4: Update CONTEXT.md (Auto Sections Only)
**4a. Scan current structure:**
Use Glob tool to get current file structure:
```
Glob: **/*.md, **/*.json, **/*.ts, **/*.js, **/*.py
```
(Glob automatically excludes node_modules and .git)
**4b. Read current CONTEXT.md:**
```
Read .handoff/CONTEXT.md
```
**4c. Update auto sections, preserve curated:**
Parse CONTEXT.md and identify sections by `<!-- AUTO: -->` and `<!-- CURATED: -->` markers.
- **Preserve**: `## Stack`, `## Patterns`, `## What Never Works` (curated)
- **Regenerate**: `## Structure`, `## Invocation` (auto)
Write updated CONTEXT.md with:
- New `## Structure` reflecting current file tree
- Updated `## Invocation` if commands changed
- All curated sections preserved exactly
### Phase 5: Analyze Session (Automated)
**IRelated in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts β single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score β₯ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.