agentleFS
cukascukas/remembrall/skills/replay/SKILL.md

replay

Skill6 starsChanged 8 months agoMITView on GitHub

Resume work from a previous session with state verification and git patch restore. Reads the handoff, verifies files and git state, restores patches, and presents a structured briefing.

5 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions5 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 5

    1. entireio/skills★ 239same name
    2. tuo-lei/vibe-replay★ 39same name
    3. amajorai/replay.md★ 1same name
    4. sanjaibalajee/skills★ 1same name
    5. icarloscornejo/doer★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository5 other files it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

16 rules. 0 are common, 13 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 13

    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. Distinctive:

    Own session file found: Use it directly.

    line 52
  2. Distinctive:

    No exact hash match, one fallback dir: Use that directory and repeat the own-session check there.

    line 53
  3. Distinctive:

    Multiple including own: Use own session's handoff, mention others exist.

    line 56
  4. Distinctive:

    If no frontmatter (legacy handoff), skip verification steps and proceed with markdown-only mode.

    line 62
  5. Distinctive:

    Check if it exists on disk

    line 88
  6. Very specific:

    If commit is available, check git diff $COMMIT -- $FILE to see if modified since handoff

    line 89
  7. Distinctive:

    Clean apply: Ask user: "Apply saved changes from previous session?

    line 97
  8. Very specific:

    If yes: Run git apply "$PATCH_PATH" then rm -f "$PATCH_PATH"

    line 98
  9. Distinctive:

    Delete only the consumed handoff file — leave other sessions' files alone

    line 144
  10. Distinctive:

    Delete consumed patch file only after successful git apply

    line 145
  11. Distinctive:

    NEVER force-apply patches — if git apply --check fails, warn and skip

    line 146
  12. Distinctive:

    Verify file state before modifying anything

    line 147
  13. Distinctive:

    If the handoff mentions blockers, address those first

    line 150
  14. Very specific:

    If this instance later needs to hand off, use /handoff — it will write a fresh one

    line 152
  15. Distinctive:

    If a "Do NOT Do" section exists, follow it strictly — it documents dead ends and completed work that must not be revisited

    line 154
  16. Distinctive:

    If a "Next Step" section exists, that is the ONLY thing to propose — not a re-exploration of the entire task

    line 155

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

Replay From Handoff

Pick up work from a previous session with full state verification and git patch restore.

Lifecycle

The handoff file is a single-use baton. Read it, verify state, restore patches, delete it.

Steps

  1. Find handoff files — Search both personal and team directories. Check for own session's handoff first:

    REMEMBRALL_ROOT="${CLAUDE_PLUGIN_ROOT:-$(cat /tmp/remembrall-meta/plugin-root 2>/dev/null)}"
    source "${REMEMBRALL_ROOT}/hooks/lib.sh"
    CWD=$(pwd)
    HANDOFF_DIR=$(remembrall_handoff_dir "$CWD")
    TEAM_DIR=$(remembrall_team_handoff_dir "$CWD")
    FALLBACK_DIRS=""
    # Session ID: env var or published by hook
    OWN_SID="${CLAUDE_SESSION_ID:-$(remembrall_read_session_id "$CWD" 2>/dev/null)}"
    echo "Personal: $HANDOFF_DIR"
    echo "Team: $TEAM_DIR"
    echo "Own session: $OWN_SID"
    # Check own session first
    if [ -n "$OWN_SID" ] && [ -f "$HANDOFF_DIR/handoff-${OWN_SID}.md" ]; then
      echo "OWN SESSION HANDOFF: $HANDOFF_DIR/handoff-${OWN_SID}.md"
    fi
    # List all available
    ls -lt "$HANDOFF_DIR"/handoff-*.md "$TEAM_DIR"/handoff-*.md 2>/dev/null || echo "No handoffs found"
    # Fallback: hash lookup missed (path bug, symlink path, or running /replay from a parent dir)
    if ! compgen -G "$HANDOFF_DIR/handoff-*.md" >/dev/null; then
      FALLBACK_DIRS=$(remembrall_replay_fallback_dirs "$CWD" 2>/dev/null || true)
      if [ -n "$FALLBACK_DIRS" ]; then
        echo "Fallback dirs:"
        printf '%s\n' "$FALLBACK_DIRS"
        HANDOFF_DIR=$(printf '%s\n' "$FALLBACK_DIRS" | head -1)
        TEAM_DIR="$HANDOFF_DIR"
        if [ -n "$OWN_SID" ] && [ -f "$HANDOFF_DIR/handoff-${OWN_SID}.md" ]; then
          echo "OWN SESSION HANDOFF (fallback): $HANDOFF_DIR/handoff-${OWN_SID}.md"
        fi
        ls -lt "$HANDOFF_DIR"/handoff-*.md 2>/dev/null || true
      fi
    fi
    • 0 files: Tell the user: "No handoff found. Nothing to replay."
    • Own session file found: Use it directly.
    • No exact hash match, one fallback dir: Use that directory and repeat the own-session check there.
    • No exact hash match, multiple fallback dirs: List the newest handoff from each matching directory and ask the user which project/session to replay.
    • Only other sessions' files: List them with timestamps. Ask the user which one to replay before consuming — these belong to other Claude instances.
    • Multiple including own: Use own session's handoff, mention others exist.
  2. Read the handoff — Read the selected file's contents.
  3. Parse frontmatter — If the file starts with ---, extract structured fields:
    • status, branch, commit, patch, files, tasks, team, previous_session
    • If no frontmatter (legacy handoff), skip verification steps and proceed with markdown-only mode.
  4. Mark consumed file — Rename instead of delete (preserved for safety; auto-cleaned after 1 hour):
    mv "$HANDOFF_FILE" "${HANDOFF_FILE%.md}.consumed.md"
  5. Check chain history — If previous_session is present, note it for the briefing. Optionally check if the previous session's handoff still exists (it usually won't — consumed on resume). This gives the user awareness of how many sessions deep they are.
  6. Validate freshness — Check the created timestamp. If older than the configured retention period, warn the user it may be stale and ask if they want to continue.
  7. Verify git state (if frontmatter has branch/commit):
    CURRENT_BRANCH=$(git branch --show-current 2>/dev/null)
    CURRENT_COMMIT=$(git rev-parse --short HEAD 2>/dev/null)
    echo "Handoff: branch=$BRANCH commit=$COMMIT"
    echo "Current: branch=$CURRENT_BRANCH commit=$CURRENT_COMMIT"
    if [ "$CURRENT_COMMIT" != "$COMMIT" ]; then
      git log --oneline "$COMMIT..HEAD" 2>/dev/null || echo "Could not compare commits"
    fi
    • Branch mismatch: Warn user, ask if they want to switch.
    • Commit mismatch: Show what changed since handoff with git log --oneline.
    • Match: Confirm state is unchanged.
  8. Verify files — For each file in the frontmatter files list:
    • Check if it exists on disk
    • If commit is available, check git diff $COMMIT -- $FILE to see if modified since handoff
    • Summarize: "N files unchanged, N modified since handoff, N missing"
  9. Restore git patches (if patch field exists and the file is present):
    # Check if patch applies cleanly
    git apply --check "$PATCH_PATH" 2>&1
    • Clean apply: Ask user: "Apply saved changes from previous session? (X files, Y lines changed)"
    • If yes: Run git apply "$PATCH_PATH" then rm -f "$PATCH_PATH"
    • If conflicts: Show which files conflict, suggest manual review. Do NOT force-apply.
    • No patch file: Skip silently.
  10. Present structured briefing — Show a clear summary to the user:

    ## Session Replay
    
    **Task:** [from handoff]
    **Active Skill:** [skill and phase/step from handoff, or "none"]
    **Status:** [status] | branch: [match/mismatch] | commit: [match/N new commits]
    **Files:** [N unchanged, N modified, N missing since handoff]
    **Patches:** [applied / skipped / none]
    **Chain:** [session N → this session] or [first session] if no previous_session
    
    ### Completed
    - [items from handoff]
    
    ### Remaining (priority-ordered)
    1. [blockers first — anything marked as blocked, erroring, or prerequisite]
    2. [in-progress items — partially done work from previous session]
    3. [not-started items — new tasks that haven't been touched]
    
    ### Key Decisions (preserved from previous session)
    - [decisions]
    
    ### Open Questions
    - [unresolved items]
  11. Create task list with priority ordering — For each remaining item from the handoff, create a task. Order them by priority:

    1. Blockers — items flagged as blocked, failing, or prerequisite for other work
    2. In-progress — items partially completed in the previous session
    3. Not-started — items that haven't been touched yet

    Infer priority from context clues in the handoff:

    • Words like "blocked", "failing", "error", "prerequisite", "depends on", "must fix first" → blocker
    • Words like "started", "partial", "WIP", "halfway", "begun" → in-progress
    • Everything else → not-started
  12. Resume active skill — If the handoff specifies an Active Skill (e.g., /plan-guarded Phase 2 step 3), invoke that skill before proceeding. The skill will pick up from the documented phase/step. If no active skill, proceed normally.
  13. Ask to proceed — "Ready to continue with [next remaining item]?" Don't charge ahead — the user may have changed priorities.

Rules

  • Delete only the consumed handoff file — leave other sessions' files alone
  • Delete consumed patch file only after successful git apply
  • NEVER force-apply patches — if git apply --check fails, warn and skip
  • Verify file state before modifying anything
  • Respect decisions documented in the handoff — don't re-debate unless the user asks
  • Legacy handoffs (no YAML frontmatter) still work — just skip verification steps 7-9
  • If the handoff mentions blockers, address those first
  • The handoff may have been written by a different Claude model — don't critique the approach, just continue it
  • If this instance later needs to hand off, use /handoff — it will write a fresh one
  • Do NOT re-read or re-analyze files just because they appear in a "Files Modified" list — those are for reference only. Only read files needed for the specific Next Step.
  • If a "Do NOT Do" section exists, follow it strictly — it documents dead ends and completed work that must not be revisited
  • If a "Next Step" section exists, that is the ONLY thing to propose — not a re-exploration of the entire task

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.