Handoff

From bdfinst/agentic-dev-team · View interactive version

Handoff is an AI agent skill from the GitHub repository bdfinst/agentic-dev-team. Compress or split off context for another session to pick up. Use to compress conversation history when context utilization approaches 40% (continue mode), or to split off a distinguishable out-of-scope side-task to an independent session (fork mode) — write a structured artifact for the other sessi

How to use this skill

Skill file

Handoff

One skill, two modes, for getting structured context to another session instead of replaying history:

Both modes apply the same Three Gates (below) to decide what to keep, compress, and discard — that logic is written once and shared by both modes.

Mode Selection

Keyed off whether a stated purpose exists for an independent/fresh session:

| Signal | Mode |

| --- | --- |

| No stated purpose — continuing the current task past the ceiling | Continue (default, unchanged behavior) |

| A stated purpose for a distinguishable, out-of-scope side-task | Fork |

| Ambiguous — unclear whether this is the same task or a split-off | Ask: "Continue this task in a fresh window, or split off unrelated work to an independent session?" |

Constraints

The Three Gates

Apply in order to all context older than the last 3-5 turns, in both modes:

1. Forget Gate -- Discard

2. Input Gate -- Preserve

3. Output Gate -- Keep Verbatim

Redaction

Before writing any output in either mode, redact secrets, API keys, tokens, and PII from the content. Fork-mode output leaves the repo-adjacent trust boundary (an OS temp dir another session reads), so redaction is mandatory there. Continue-mode output stays under .claude/memory/ inside the repo, but apply the same redaction pass for consistency — a secret that shouldn't be in conversation history shouldn't be in a committed-adjacent file either.

Continue Mode

Compress conversation history to keep context utilization below 40% while continuing the same task in a fresh window.

When to Summarize

/handoff is manual: nothing forces or blocks on it. Reach for it when a

deliberate, structured summary beats the harness's generic compaction:

.claude/memory/ file rather than replayed history;

count above about 40, degraded output quality) and want to choose what

survives;

The harness compacts on its own at the percentage /dev-team:setup configures

(default 40%); a /handoff summary written first is the structured

alternative to that generic summary.

Measuring utilization: utilization = (input + cache_read + cache_creation) / model_context_window, from the most recent assistant-message usage in the session transcript.

Why 40%, not a higher number: see Context Loading Protocol → Why 40%.

Writing Summaries

Write the summary using the Task Summary template in references/summary-templates.md.

Phase Progress Files

Each phase produces a progress file that onboards the next phase's agent without replaying history. Write the progress file using the appropriate phase template (Research, Plan, or Implementation) from references/summary-templates.md.

Using Summaries in New Conversations

  1. Read the most recent summary from .claude/memory/
  2. Load only Key Context for Continuation into active context
  3. Load referenced files on demand, not upfront
  4. Do NOT reload full conversation history -- the summary replaces it

Cleanup (Time-Based)

  1. Archive summaries older than 30 days to .claude/memory/archive/
  2. Delete archived summaries older than 90 days
  3. Consolidate multiple summaries for the same task into one

Fork Mode

Split off a distinguishable, out-of-scope side-task into an independent session — a sibling running in parallel, or a child (e.g. a prototype session) that later hands learnings back — without diluting or compacting the current session.

Requires a Stated Purpose

Fork mode always needs a one-line purpose describing the side-task. If the user hasn't stated one, ask for it before writing anything — an unpurposed fork artifact can't be scoped correctly by the Forget/Input/Output gates above.

Writing the Fork Artifact

Use the Fork Handoff template in references/summary-templates.md, which adds these sections beyond the Task Summary:

Cleanup (Event-Based, Never Time-Based)

Fork-mode artifacts are deleted on consumption, not on a schedule:

Never apply the continue-mode 30/90-day time-based cleanup to fork-mode output — an unconsumed fork artifact should persist until it's actually picked up, and a consumed one should not linger waiting for a sweep.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.