agentleFS
godilleygodilley/agent-tiers/skills/session-handoff/SKILL.md

session-handoff

Skill1 starsChanged 23 days agoMITView on GitHub

The RESUME_SESSION.md handoff discipline for surviving /compact and fresh/cleared contexts - what to keep in it, when to update it (as you work, not batched), and how the SessionStart hook re-injects it. Use when checkpointing before a compact, or when a resumed session needs to re-derive state.

139 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use ascii-diagram, research-fleet 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.
  • SethGammonSkill

    ascii-diagram

    Generate perfectly aligned ASCII diagrams — architecture, flow, sequence, box-and-arrow. Uses a programmatic character-grid approach so alignment is guaranteed by math, not token prediction. Includes post-render verification.

    Also in 4 projects that use this

  • SethGammonSkill

    research-fleet

    Parallel research using Fleet wave mechanics. Spawns multiple scout agents, each investigating a different angle of the same question. Findings are compressed between waves. Produces a unified research brief from multiple independent perspectives.

    Also in 3 projects that use this

  • vicoa-aiSkill

    live-preview

    Start a local app in the current user project, expose it through a tunnel, and return preview details in structured Markdown. Use when the user asks for a preview URL, public URL, shareable localhost, mobile/web preview, or tunnel setup.

    Also in 4 projects that use this

  • botlearn-aiSkill

    doc-gen

    Also in 4 projects that use this

  • flyingobsidianSkill

    terminology

    Read a codebase, find terminology, create/update definitions into a markdown document.

    Also in 3 projects that use this

  • Dizzy-TenSkill

    bug-diagnosis

    Diagnose bugs and product issues without modifying code. Use when the user explicitly invokes $bug-diagnosis or asks for diagnosis, root-cause analysis, issue classification, or fix strategy for code bugs, failing tests, configuration/dependency problems, deployment issues, performance regressions, data anomalies, or frontend/user-experience problems described through screenshots, annotations, logs, errors, or natural-language reports. Prioritize analysis and recommendations only; do not edit files.

    Also in 3 projects that use this

  • +1 more from SethGammon

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 117 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Update it as you work, not batched - every checkpoint, before any /compact.

    line 20
  2. Distinctive:

    Never rely on the compaction summary to carry a rule or a decision - write it to disk.

    line 40
  3. Very specific:

    Before compacting: commit pending work (stage specific paths, not -A), refresh RESUME_SESSION.md (▶ NEXT) + any durable facts, close out …

    line 43
  4. Very specific:

    Put the paste in a fenced code block so it copies clean.

    line 61

“Common” is measured: kept by at least 6 in 10 of the 117 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

Session handoff - surviving /compact and fresh contexts

Compaction (auto or manual) drops conversation-only state; only disk-backed context returns. Keep a top-of-context handoff file so a fresh/compacted session resumes instantly without re-deriving state.

RESUME_SESSION.md (repo root)

A pointer, not a second reference doc - keep it light. Hold:

  • HEAD + version, branch, deployed-vs-unverified state.
  • Files changed this chunk, key decisions, and what failed (so you don't repeat it).
  • A ▶ NEXT pointer: the exact next step.

Update it as you work, not batched - every checkpoint, before any /compact.

Auto-injection

The kit ships a SessionStart hook (scripts/resume-inject.sh) that re-injects $CLAUDE_PROJECT_DIR/RESUME_SESSION.md on startup / compact / resume / clear (guarded - silent when the file is absent). Every injected body is capped so the whole inject stays under the host's 10000-character inline limit (over that, the host saves it to a file and the model sees only a ~2000-byte preview), which leaves about 5-8 KB for the handoff: past the cap it injects the head, cut at a whole line, plus one line naming the file to Read for the rest. A headless claude -p run started in the project directory reports as a startup too, so it also gets the body. It's wired ONCE, so you do NOT need per-project wiring; just keep the file current.

  • Standalone CLI: the plugin's own hook provides this.
  • Plugin-ignoring GUI (e.g. CodeMoss): scripts/install-flat.sh wires the same script into the global ~/.claude/settings.json SessionStart hook, so it covers every project.
  • A project wanting richer/own behaviour can drop its own .claude/hooks/load-resume.sh; the global hook detects it and stands down (no double-inject).

What goes where

  • Durable facts (architecture, build/test, conventions, gotchas) → project CLAUDE.md or auto-memory.
  • Transient working-state (this chunk's progress, the ▶ NEXT) → RESUME_SESSION.md.
  • Never rely on the compaction summary to carry a rule or a decision - write it to disk.

Checkpoint-before-compact ritual

Before compacting: commit pending work (stage specific paths, not -A), refresh RESUME_SESSION.md (▶ NEXT) + any durable facts, close out any doc whose plan is done or paused (see doc-lifecycle), then compact. After a compact: re-read CLAUDE.md + RESUME_SESSION.md before continuing; confirm no task state was lost.

Fresh-session paste (emit it automatically at every handoff)

Whenever EITHER party pushes toward a new/fresh/compacted session (a checkpoint, "let's take this fresh", a pre-compact, a "start a new session for X"), the Lead emits a copy-pasteable kickoff paste in chat IN ADDITION to refreshing RESUME_SESSION.md. RESUME is the state doc; the paste is the imperative kickoff that saves the human hand-writing one. Emit it unprompted - do not wait to be asked.

Shape (minimal, a strong starting point the human can trim, not an exhaustive spec):

  • Read-first pointers: RESUME_SESSION.md + the exact plan/spec files for the next task (not everything).
  • The imperative task: the ▶ NEXT step as "do X, then Y", with the acceptance/exit condition.
  • Rails: the gates that apply (irreversible-action, output-hygiene, "don't touch product code"), and a suggested Lead band for the work-class.
  • Watch-outs: unproven/def-v1 agents, PENDING-REFRESH defs, disclosure gates, known traps for this task.

Put the paste in a fenced code block so it copies clean. Keep it lean - it is a launch pad, not a second RESUME. The /agent-tiers:resume command refreshes RESUME and emits this paste together.

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.