agentleFS
tammaitammai/bigin-skills/skills/session-handoff/SKILL.md

session-handoff

Skill1 starsChanged 39 days agoMITView on GitHub

Saves session state — tasks, decisions, uncommitted changes — to .claude/memory/SESSION.md and reloads it on resume. Triggers: 'save session', '/save-session', 'running out of tokens', 'continue this in a new session'.

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

8 rules. 0 are common, 8 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 117 edited versions we read keep these.

  • 8

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When user triggers save:

    line 45
  2. Distinctive:

    Run git status to check uncommitted changes

    line 48
  3. Distinctive:

    Run git diff --stat for summary

    line 49
  4. Distinctive:

    Call TaskList to get all tasks with status

    line 50
  5. Distinctive:

    If missing or status: complete, skip load

    line 119
  6. Distinctive:

    When user triggers complete:

    line 141
  7. Distinctive:

    Check git status — should be clean (no uncommitted changes)

    line 144
  8. Distinctive:

    Check TaskList — should have no in_progress tasks

    line 145

“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 — Session State Persistence

This skill is mechanical: save state to .claude/memory/SESSION.md or load it back. Do not deliberate — no thinking needed on any step here.

Saves and loads session state between Claude Code sessions, useful when approaching usage limits and needing to continue work later.


When This Triggers

Save session:

  • User says: "save session", "/save-session", "nearing limit", "running out of tokens"
  • Or explicitly: "pause here", "save my work", "handoff"

Load session:

  • Automatically at session start if SESSION.md exists with status: in-progress
  • User says: "load session", "resume session", "continue where we left off"

Complete session:

  • User says: "complete session", "session done"
  • Or after all tasks are completed and working tree is clean

Session File Location

.claude/memory/SESSION.md

Save Session Action

When user triggers save:

  1. Gather current state:
    • Run git status to check uncommitted changes
    • Run git diff --stat for summary
    • Call TaskList to get all tasks with status
    • Note current branch, recent commits
  2. Write .claude/memory/SESSION.md:

    ---
    session-id: <uuid>
    created: <ISO-timestamp>
    last-updated: <ISO-timestamp>
    status: in-progress
    ---
    
    # Session Handoff
    
    **Session saved:** <date-time>
    **Branch:** <branch-name>
    **Recent commits:** <latest commit hash: message>
    
    ## What We Were Working On
    
    <High-level summary of current task>
    
    ## Current State
    
    ### Tasks
    
    <Capture from TaskList with checkboxes and status>
    - [ ] Task 1 (in_progress)
    - [x] Task 2 (completed)
    - [ ] Task 3 (pending)
    
    ### Decisions Made
    
    <List key decisions with rationale>
    - **Decision 1:** <what and why>
    - **Decision 2:** <what and why>
    
    ### Uncommitted Changes
    ```
    
    <git diff --stat output>
    
    ```
    
    ### Next Steps
    1. <First next step>
    2. <Second next step>
    
    ## Context Notes
    <Any additional context for resumption>
  3. Return summary:
    Session saved to .claude/memory/SESSION.md
    Tasks: X total, Y in progress
    Uncommitted changes: <files modified>
    Resume: Next session will prompt to restore this session

Load Session Action

Triggered: At session start (if SESSION.md exists with status: in-progress)

  1. Check for SESSION.md:
    • Read .claude/memory/SESSION.md
    • If missing or status: complete, skip load
  2. Ask with one AskUserQuestion call — question: "Found a previous session from <date>: <one-line summary from SESSION.md>. What now?" — three options:
    • Resume session — restore tasks and context
    • Start fresh — archive the session and begin new
    • View full details — show the complete SESSION.md, then ask again
  3. If user resumes:
    • Display "What We Were Working On" section
    • Display "Current State" (tasks, decisions, uncommitted changes)
    • Display "Next Steps"
    • Offer to restore task list via TaskCreate for each pending task
  4. If user starts fresh:
    • Archive .claude/memory/SESSION.md to .claude/memory/SESSION.archive.<timestamp>.md
    • Remove active .claude/memory/SESSION.md
    • Confirm: "Previous session archived. Starting fresh."

Complete Session Action

When user triggers complete:

  1. Verify completion:
    • Check git status — should be clean (no uncommitted changes)
    • Check TaskList — should have no in_progress tasks
  2. Archive session:

    mv .claude/memory/SESSION.md .claude/memory/SESSION.archive.<timestamp>.md
  3. Confirm:
    Session completed and archived
    Archived to: .claude/memory/SESSION.archive.<timestamp>.md
    Ready for new session

If not complete:

  • Warn user: "Session has uncommitted changes or in-progress tasks. Complete those first, or say 'save session' to pause."

SESSION.md Structure

The session file uses YAML frontmatter for metadata and markdown for content:

---
session-id: uuid
created: ISO-8601 timestamp
last-updated: ISO-8601 timestamp
status: in-progress | complete
---

Content sections:

  • What We Were Working On — high-level summary
  • Current State — tasks, decisions, uncommitted changes
  • Next Steps — what to do when resuming
  • Context Notes — any additional context

Mid-workflow saves

When session-handoff is triggered partway through another multi-step skill (bigin-harness-setup, task-workflow, sprint-distill), no per-skill schema is needed — record the in-progress step in plain language under "Current State" (e.g. "bigin-harness-setup: Phase 4 of 8, CLAUDE.md and .claude/rules/ written, enforcement gates not yet generated"). On resume, the target skill re-derives its actual progress from what's already on disk (which files exist, PLAN.md's task table, etc.) rather than trusting a saved phase number — SESSION.md's job is pointing the user/agent back at where they left off, not being the source of truth for it.


Trigger Phrases

These are phrases, not slash commands — the plugin ships no commands/, so /load-session typed as a command is unknown. Typing /session-handoff invokes this skill directly.

ActionPhrasesDoes
Save"save session", "/save-session", "nearing limit", "handoff"Write current state to SESSION.md
Load"load session", "resume session", "continue where we left off"Read and display SESSION.md
Complete"complete session", "session done"Archive SESSION.md, mark complete
Auto-loadSession start if SESSION.md exists with status: in-progressAsk: resume or fresh?

Best Practices

  1. Save before hitting limit — Don't wait until tokens are exhausted
  2. Include decisions in Context Notes — Rationale is as important as outcome
  3. Keep Next Steps actionable — Specific tasks, not vague goals
  4. Complete sessions cleanly — Archive when done, don't leave stale sessions
  5. Verify on resume — Check git branch and uncommitted changes match expectation

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.