agentleFS
adrijshikharadrijshikhar/catalyst/skills/handoff/SKILL.md

handoff

Skill0 starsChanged 3 months agoMITView on GitHub

Use when writing any handoff or task brief, including an inline brief for Codex or another agent that the user will paste themselves. An inline-only, read-only, or do-not-launch request still needs this skill to preserve the acceptance checklist and return contract. Also use when ending a session, approaching compaction, switching context, resuming a prior handoff, recovering degraded context, or delegating to native subagents. Triggers include "prepare an inline handoff", "handoff this to Codex", "brief a subagent", "handoff", "resume", and "reground". Five modes cover WRITE, READ, RECOVER, REGROUND, and BRIEF. Use this skill liberally for decisions worth preserving and isolated tasks worth delegating.

195 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use which-skill, wait-what and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • risadamsSkill

    which-skill

    Router over this pack's skills and flows. Ask it "which skill fits X" when you don't remember what's available.

    Also in 5 projects that use this

  • AWSSkill

    wait-what

    Stop. That last message did not land: re-pitch it.

    Also in 51 projects that use this

  • AWSSkill

    to-questionnaire

    Turn a decision you can't fully answer into a questionnaire for someone else to fill in.

    Also in 41 projects that use this

  • loulanyueSkill

    setup-ts-deep-modules

    Wire dependency-cruiser into a TypeScript repo so each package is a deep module — implementation hidden in subfolders, reachable only through its entry-point files. User-invoked.

    Also in 15 projects that use this

  • RoentekSkill

    writing-beats

    Writing, exploit — assemble raw material into a journey of beats, grounding each term before a beat leans on it.

    Also in 20 projects that use this

  • RoentekSkill

    writing-fragments

    Writing, explore — mine raw fragments, no structure yet.

    Also in 20 projects that use this

  • +5 more from aws
  • +1 more from Roentek

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 3 are distinctive, and 6 are very specific to this project.

  • 0

    Common

    Most of the 167 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If verification was requested, include its status and any unresolved coverage before the Resume prompt.

    line 87
  2. Distinctive:

    ALWAYS print the Resume prompt verbatim at the end of the confirmation.

    line 89
  3. Very specific:

    Only the exact value jev enables verification.

    line 112
  4. Very specific:

    When enabled, load the separately installed verify-handoff skill and give it the current draft and captured evidence.

    line 117
  5. Very specific:

    If the optional skill is unavailable or fails, append Verification not performed: <reason> to state.open_risks, preserve existing risks, …

    line 124
  6. Very specific:

    Read files_read_first. Do not read PROJECT_STATE.md (canonical .catalyst/, legacy .claude/) unless the brief says to or you need a …

    line 140
  7. Very specific:

    Do not prepend to PROJECT_STATE.md — recovery is re-assembly, not fresh signal.

    line 152
  8. Distinctive:

    Read-only mid-session re-injection for when recall is drifting: a file you have notes on gets re-read, a decision is re-litigated without …

    line 159
  9. Very specific:

    If a recipient needs narrative rationale, reference the exact PROJECT_STATE.md entry.

    line 199

“Common” is measured: kept by at least 6 in 10 of the 167 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Handoff

A handoff is a state packet the next session or subagent can act on without re-explanation. /compact loses the details that matter; subagent task descriptions either over-share (context bleed) or under-share (questions the subagent cannot ask). A handoff keeps only what matters, in the structure the consumer needs. Patterns follow Anthropic's Harness Engineering for Long-Running Agentic Applications: context resets over compaction, structured artifact handoffs, pre-coding contracts, generator ≠ evaluator.

Two files per checkpoint

FilePurposeLifetimeLoaded
<store>/<key>.json (legacy slot <store>/HANDOFF.json)Ephemeral brief — minimum payload to resume; points at durable artifactsOverwritten on every WRITE for that keyStart of the next session for that key
<main>/.catalyst/PROJECT_STATE.mdPersistent narrative — decisions, why, rejected paths, surprisesPrepended forever, newest first; one file per repo, never split per featureOn demand, when a brief points at it

Feature key resolution

PrioritySourcePathWhen
1/handoff <name><store>/<name>.jsonExplicit override
2git branch --show-current (sanitized /→-, cap 80)<store>/<branch>.jsonDefault
3Not in a git repo, or detached HEAD<store>/HANDOFF.jsonLegacy single-slot fallback

<store> is <main>/.catalyst/handoffs/ where <main> is the main worktree (parent of git rev-parse --git-common-dir; the current directory outside Git). Print it with bash "$SCR/handoff-dir.sh" or python3 "$SCR/handoff_paths.py". Every linked worktree shares one store keyed by branch. Detect "in a repo?" with git rev-parse --git-dir, never [ -d .git ]. Everything Catalyst writes lives under <main>/.catalyst/: briefs in handoffs/, task files in tasks/, the narrative PROJECT_STATE.md, knobs in config.json. Nothing new is written under .claude/. Legacy locations (.claude/handoffs/<key>.json, .claude/PROJECT_STATE.md, .claude/catalyst.json) are read when the canonical file is absent; old files are never moved or deleted, and inventory lists both locations.

Before any write: python3 "$SCR/handoff_paths.py" --init (add --tasks for task files). It creates only the selected store and, in Git, ensures .catalyst/ is in the main worktree's .gitignore. If it fails, stop and report. READ, REGROUND, list and the hooks are read-only.

Sticky session key: the first WRITE's key is reused by later WRITE/RECOVER calls in the session. If the branch changes, surface it: "Branch switched. Future handoffs will target <new-key>.json. Confirm?" BRIEF uses a task name, never the sticky key, and never writes a checkpoint or the narrative.

Five modes

ModeTriggerPersists?Consumer
WRITEEnding a session, context limit, before /clear or /compact, "handoff" / /handoff<store>/<key>.json (validated) + prepend .catalyst/PROJECT_STATE.mdNext session
READFresh session with brief(s) present, user wants to resumeNoneCurrent session
RECOVERContext degraded mid-session — re-reads, contradictions, forgotten decisionsOverwrites the brief; no narrative entryCurrent session, post-/clear
REGROUNDRecall drifting mid-sessionNone (read-only re-injection)Current session
BRIEFDelegate a selected task to a subagent or external agentNative: tool argument. External: task file by defaultTask recipient

To fork a braided session, WRITE once per thread with explicit keys: /catalyst:handoff <key-a>, then /catalyst:handoff <key-b>. Skip automatic checkpoint suggestions for trivial sessions; always honor an explicit task-handoff request, however small.

Brief schema and helper scripts

The brief is typed JSON validated against brief.schema.json (canonical path bundled alongside this skill at <plugin-root>/skills/handoff/brief.schema.json, mirrored at $SCR/brief.schema.json, or inspect via python3 "$SCR/handoff_paths.py" --schema): schema_version "1", key, timestamp (shell-provided ISO-8601 Z), mode (WRITE | RECOVER), resume {done_when, resume_by, optional prompt, history_pointer}, state {branch, next_acceptance_check, worktree {root, is_linked, git_common_dir}, optional head_sha, diff_summary, tests (list of {cmd, result: "pass" | "fail"}), commands, decisions, rejected_paths, open_risks}, files_read_first and files_skip (lists of {path, why}). In tests, result is strictly "pass" or "fail" (never freeform text or descriptions; place context or details in cmd). Optional fields with nothing to say are omitted, never null or "none"; unknown fields are rejected. A worked example is in references/example-brief.md.

Helper-script location (read this first). The scripts (handoff-dir.sh, handoff-validate.py, handoff-render.py, handoff_paths.py, handoff-list.py, handoff-prune.py) ship inside the plugin, NOT in the user's project. Resolve them once per mode and reuse $SCR:

SCR="${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}/scripts"   # when the host supplies a plugin root

If neither variable exists, resolve the plugin root from this loaded skills/handoff/SKILL.md (two directories above its directory) and use its absolute scripts path. NEVER write a bare relative scripts/handoff-render.py into a resume prompt or run it from the user's repo — it does not exist there. The durable resume entry point is the slash command /catalyst:handoff resume, which re-enters this skill and resolves $SCR again.


Mode: WRITE

  1. Key — apply the ladder; sticky within the session.
  2. Gather state — run in parallel where supported: git branch --show-current, git status --short, git diff --stat, git log --oneline -10, git rev-parse HEAD (→ state.head_sha), and git rev-parse --path-format=absolute --git-common-dir (→ state.worktree.git_common_dir; never --absolute-git-dir, which returns the worktree-private dir in a linked worktree and fires a false REPO MISMATCH). From the transcript note tests run (tests: list of {cmd, result: "pass" | "fail"} — result must be strictly "pass" or "fail", put details in cmd), commands that advanced the work, decisions the next session depends on, rejected paths, open risks and the next concrete acceptance check.
  3. Build, optionally verify, and validate — build the typed object, apply the optional verification step below, then write it to a temp file. Run python3 "$SCR/handoff-validate.py" <tmp>.json, fix every reported field until it prints handoff-validate: OK, then move it to <store>/<key>.json (store from handoff_paths.py --init).
  4. Narrative — prepend an entry to <main>/.catalyst/PROJECT_STATE.md, directly below the header and above earlier entries. Create the header first if the file is new, and verify the first line is still # Project state afterwards. If a legacy .claude/PROJECT_STATE.md exists and the canonical file does not, create the canonical file with the header plus one line Earlier entries: .claude/PROJECT_STATE.md — do not move or edit the legacy file.
# Project state — narrative log

Accretes over the life of the project. Each handoff prepends a new dated section above earlier entries.
Read sections selectively. The brief at `<store>/<key>.json` is the entry point; this file is the reference.
## <ISO date> — [<key>] <short title>

### What was done
<2-5 bullets>

### Decisions (with rationale)
- **<decision>** — <why>. Rejected: <alternatives>.

### Surprises / lessons
<bullets or omit>

### Pointers
- <path>:<line-range> — <what's there>

Step 5 — Confirm

If verification was requested, include its status and any unresolved coverage before the Resume prompt. Never describe a skipped or failed verification as successful.

ALWAYS print the Resume prompt verbatim at the end of the confirmation. The user should never need to open the brief file to find the paste-and-go text.

Handoff written (key: <key>, tier: <1|2|3>):
  <store>/<key>.json         (validated JSON)
  .catalyst/PROJECT_STATE.md (+<n> lines prepended)

Next session — run `/catalyst:handoff resume` (or paste the Resume prompt):

> resume handoff '<key>': run `/catalyst:handoff resume` (READ mode), then continue. next acceptance check: <one-line check verbatim from the brief>.

The resume prompt MUST route through /catalyst:handoff resume — never a bare python3 scripts/handoff-render.py <key>. The helper scripts live in the plugin, not the user's project, so a relative script path fails everywhere except the Catalyst repo itself. The slash command re-enters this skill, which resolves $SCR and renders the brief.

Optional verification (WRITE only)

A direct request to verify with Jev or to skip verification wins for this WRITE; do not persist that override. Otherwise read the existing project configuration:

bash "$SCR/catalyst-config.sh" get handoff.verification off

Only the exact value jev enables verification. off, missing configuration, or a reader failure leaves it disabled. Report an unknown value and continue without verification. No automatic tool discovery or external call occurs when disabled. READ, RECOVER, REGROUND, and BRIEF do not run this step.

When enabled, load the separately installed verify-handoff skill and give it the current draft and captured evidence. Run its verification stage once for this draft; if that skill already owns this WRITE, let its stage run here without invoking it again. It returns revised claims, risks, and status to this workflow; this workflow alone validates and publishes one checkpoint and one narrative entry, both using the revised claims.

If the optional skill is unavailable or fails, append Verification not performed: <reason> to state.open_risks, preserve existing risks, and continue WRITE with that status in the confirmation. The optional skill handles unavailable Jev the same way. Do not install a skill, MCP server, or credentials, call Jev directly as a fallback, or retry in a loop. Verification is advisory and never bypasses schema validation or project data-sharing rules.


Mode: READ

Auto-resume (hook-driven): a session opened via /clear or /compact gets the brief's load-bearing fields auto-rendered by SessionStart-handoff-read.sh; startup/resume get a one-line announce. /catalyst:handoff resume gives the full render any time.

  1. Resolve $SCR, then inventory with python3 "$SCR/handoff-list.py" --json (canonical + legacy stores, including HANDOFF.json). For a duplicate key the canonical file wins unless the user names the legacy path.
  2. Multiple briefs: surface ALL of them, name the current-branch match as the primary suggestion, list the others with mtime + key, and wait for the user. Never silently choose.
  3. python3 "$SCR/handoff-render.py" <key> and follow its output. Heed every !! line before continuing, in the order printed: REPO MISMATCH > BRANCH MISMATCH > STALE > MISSING, plus Commits since brief written: N. If the brief was written in another (linked) worktree, say so and offer to cd there rather than resuming in the wrong tree. When handoff.verification is jev and commits have landed since the brief was written (Commits since brief written: N), Catalyst can semantically evaluate whether landed commits conflict with locked decisions or the next acceptance check: prepare the verification payload via python3 "$SCR/handoff-render.py" --prepare-drift-verify <key>, call jev_verify, and render the annotated status with python3 "$SCR/handoff-render.py" <key> --drift-json '<result-json>' (or --drift-status "<summary>").
  4. Read files_read_first. Do not read PROJECT_STATE.md (canonical .catalyst/, legacy .claude/) unless the brief says to or you need a decision's rationale.
  5. Confirm: "Resumed from <key>. Next acceptance check: <quote from brief>. Starting now." The key becomes the sticky session key.

Mode: RECOVER

The session is degraded: forgotten goals, re-reads, contradicted decisions, repeated rejected approaches.

  1. Key via the ladder. Render the existing brief (handoff-render.py <key>; canonical first, legacy fallback) and read the 2–3 newest PROJECT_STATE.md entries (.catalyst/ first, then legacy .claude/).
  2. git log --oneline -20 and git diff on the working branch.
  3. handoff_paths.py --init, rebuild the typed object from git + transcript, validate, write <store>/<key>.json. Keep the old copy when recovering from legacy storage.
  4. Do not prepend to PROJECT_STATE.md — recovery is re-assembly, not fresh signal.
  5. Say: "Recovery brief written at <store>/<key>.json. Run /clear, then paste this Resume prompt OR run /catalyst:handoff resume:" and print the renderer's Resume prompt verbatim beneath it.

Mode: REGROUND

Read-only mid-session re-injection for when recall is drifting: a file you have notes on gets re-read, a decision is re-litigated without new information, the acceptance check is being re-derived instead of repeated verbatim.

python3 "$SCR/handoff-render.py" --reground <key>            # or --reground --file <path>

It prints only the goal (done_when + next_acceptance_check), the first five locked decisions and files_read_first with reasons — no mismatch checks, no rejected paths, no resume prompt, no disk write. Read the block into the working context and continue.


Mode: BRIEF

Delegate the selected task while the originating session continues. “This” means the task just discussed; clarify only if its boundary is ambiguous. Route requests naming a subagent to native delivery, and requests naming a separate agent/session (for example Codex) to external delivery. No hook is needed. A request to prepare a brief only does not authorize dispatch.

Prepare the task (both paths)

Extract objective, full agreed requirements, in/out of scope, relevant decisions and rejected paths, source files with reasons, dependencies, acceptance checks and expected return. Carry the selected conversation context that exists nowhere else; reference existing files instead of copying them. Do not include unrelated chat, secrets, or whole project history. Preserve requirements even when the task is long.

Native subagent

  1. Build the BRIEF object using resume.done_when, resume.resume_by, state.next_acceptance_check, relevant state lists and files_read_first. Omit checkpoint identity. Include scope and return_instructions strings: define allowed edits and require changed files, actual check results and unresolved issues on return. Include the working directory in the task instructions; do not assume it is inherited.
  2. Render with python3 "$SCR/handoff-render.py" --brief <tmp>.json. The native limit is 30 lines by default. The renderer preserves all supplied decisions and reports section counts on overflow. Shorten wording, reference a supporting artifact or decompose the task; never drop requirements to pass the cap.
  3. For “handoff this to a subagent”, pass the rendered brief directly to the host's native agent-spawn tool. Select fresh/scoped context where supported. Use the host's workspace isolation for concurrent edits where available; if edits would overlap, arrange separation or sequence them before dispatch. Do not paste the whole conversation or narrative alongside the brief. If spawning is unavailable, report that and offer external delivery; do not claim dispatch occurred.
  4. Track the native task using the host's result mechanism. Continue independent parent work when possible. On return, inspect the result and relevant evidence; report completed, partial or blocked work accurately. Integrate only within the user's authorized scope.

External agent (file by default)

  1. For Git coding tasks, offer separate worktree + branch (recommended default) or current workspace. Honor an existing selection; otherwise wait for the choice before finalizing workspace instructions. Do not treat silence as selection. For read-only/non-Git tasks use the identified directory. Record base commit, source worktree and any required uncommitted changes: a new worktree starts from a commit, not the parent's dirty files.
  2. Read the bundled task template and fill it with the selected task. It must be executable without Catalyst installed. Keep every agreed requirement; external files have no 30-line cap. The task body specifies workspace setup, permitted actions, checks, completion ownership and integration boundaries. Leave ## Completion empty for the recipient.
  3. Run python3 "$SCR/handoff_paths.py" --init --tasks. Create a unique <task-slug>-<unique-suffix>.md under the returned directory using exclusive creation (Python Path.open("x", encoding="utf-8"), for example). Use a filename slug, never an unchecked path from chat. On collision choose another suffix; never overwrite. If initialization/write fails, report it; do not silently switch to inline. Keep the single task file in the main worktree so linked worktrees can access it.
  4. Print only the location and a short copyable launch prompt, substituting the real absolute file path:

    Read <absolute-task-file>. Execute its task, follow the workspace instructions, and update only its Completion section. Return a short prompt pointing to that section for the originating agent.

  5. The receiving agent preserves everything before ## Completion, records its status/checklist/evidence/integration instructions there and returns a small pointer message. No automatic cross-host notification, launch or merge. The user relays that message. The originating agent reads Completion, verifies the actual changes against the original checklist and reports readiness; completion text alone is not proof (when handoff.verification is jev, invoke the optional verify-task skill to gate completion using jev_gate). The task file is a manually updated result, not a live status monitor.

Explicit inline override: only if the user asks for inline/full-message output, provide the complete task and return contract in the message, using the task template's ## Task, ## Workspace, ## Acceptance checklist and ## Return instructions headings. Do not create a task file or initialize storage for this path. The recipient returns a structured completion message instead. The workspace-choice rules still apply. Inline is a message the user relays: never launch, probe or install the other agent's CLI (codex exec, agy, and so on), never dispatch a native subagent in its place, and never run the task yourself — Catalyst prepares the brief; the user delivers it.

Cross-machine use: the user transfers the task file (and necessary artifacts). The recipient resolves the local repository and verifies the recorded base/dependencies; an inaccessible path is a blocker, not permission to invent missing context.

If a recipient needs narrative rationale, reference the exact PROJECT_STATE.md entry. BRIEF never writes or updates the narrative or a session checkpoint.

Evaluator / reviewer briefs (anti-self-grade + pre-coding contract). When the subagent's job is to grade or review an artifact:

  • Dispatch it as a separate Agent invocation with fresh context. Give it the contract (## Task with done_when + acceptance check) and the artifact path only — never the generator's transcript, reasoning, or chat history. Self-evaluation bias is measured and severe.
  • Agree "done" before the generator starts: the generator's brief states done_when and the acceptance check; the evaluator's brief quotes the same two lines verbatim. Neither side may redefine them mid-flight.
  • One evaluator pass is enough for binary tasks (tests pass or fail). Iterate only on genuinely subjective output, and cap iterations explicitly in the brief.

Store hygiene (list / prune)

The store accretes one brief per feature key. A merged branch leaves an orphan brief behind, and an orphan whose branch name later recurs would be resolved by tier 2 as if it were current.

python3 "$SCR/handoff-list.py"          # every brief: branch, liveness, age
python3 "$SCR/handoff-prune.py"         # propose orphans — deletes NOTHING
python3 "$SCR/handoff-prune.py" --apply # delete exactly what was proposed

A prune candidate is a brief whose recorded branch no longer exists locally and which is older than 30 days. The current branch's brief and the legacy HANDOFF.json slot are never candidates. Always show the user the dry-run list and get confirmation before running --apply — this deletes state that a future session may want.

Anti-patterns

  • Inlining file contents or the README into a brief. Point at paths and line ranges.
  • Writing only one of brief / narrative on WRITE. Both or neither (RECOVER writes only the brief).
  • Skipping rejected paths. Highest-ROI field: the next agent will otherwise redo them.
  • Vague next check. "Continue the work" is not verifiable; "pnpm test src/auth/ shows auth.spec.ts green" is.
  • Reading the whole narrative on resume, or auto-loading every brief. The brief is the entry point; always select one.
  • Silent key-switching, or tier 3 when tiers 1–2 are available.
  • BRIEF dumping PROJECT_STATE.md into a task, or a full external brief in chat without an explicit inline request.
  • Native BRIEF over the 30-line budget. Reference supporting artifacts or re-decompose; never silently truncate.
  • Generator grading itself, or no pre-coding contract. Fresh-context evaluator, done_when + acceptance check fixed in both briefs before work starts.

Bad next check: "notes": "worked on auth, some tests failing, continue tomorrow". Good: "next_acceptance_check": "pnpm test src/auth/auth.spec.ts passes 6/6" with rejected_paths: ["< operator (off-by-one)", "new Date() (alloc)"] — first action, success criterion and what not to redo, all validated before they reach disk.


Model evolution

Each component encodes an assumption about what the current model cannot do reliably alone: the pre-coding contract (self-defining "done"), anti-self-grade (self-evaluation bias), the native 30-line ceiling (compact dispatch context), manual external file transfer (no cross-host task transport yet), READ-time drift guards (moved files and stale state go unnoticed). SPLIT and PIPELINE were retired 2026-09-02 once native agent tooling absorbed orchestration.

"Every component in a harness encodes an assumption about what the model can't do on its own, and those assumptions are worth stress testing." — Anthropic

Review annually or when a new flagship model lands; strip scaffolding that no longer earns its complexity and record removals in PROJECT_STATE.md.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.