Get the FREE Ultimate OpenClaw Setup Guide →

context-resume

npx machina-cli add skill NorthShoreAutomation/trellis/context-resume --openclaw
Files (1)
SKILL.md
3.1 KB

User Input

$ARGUMENTS

You MUST consider the user input before proceeding (if not empty).

Instructions

1. Find Handoff Document

Look for the handoff file:

  1. If $ARGUMENTS contains a file path, use that
  2. Otherwise check for handoff.md in the project root
  3. If not found, tell the user: "No handoff.md found. Use /trellis:context-handoff at the end of a session to generate one."

Read the handoff document fully before proceeding.

2. Validate Git State

Compare the handoff's Git State section against current reality:

git branch --show-current
git log --oneline -5
git status --short

Check for drift:

CheckHowMatchDrift
BranchCompare current branch to handoff's branchOn correct branch"Handoff says feat/X but you're on main"
Last commitCompare git log -1 --format=%h to handoff's last commit hashSame commit"N new commits since handoff" — show them
Uncommitted changesCompare git status --short to handoff's uncommitted summaryConsistent"Handoff expected uncommitted changes but tree is clean" (or vice versa)

If branch doesn't match: Ask the user whether to switch (git checkout <branch>) or continue on the current branch.

If new commits exist: Show them with git log --oneline <handoff-hash>..HEAD so the user knows what changed.

3. Present Orientation

Display a compact summary:

RESUMING: <goal from handoff, one line>
BRANCH:   <current branch> <match/drift indicator>
LAST:     <last commit hash + message>

COMPLETED:
• <completed item 1>
• <completed item 2>

IN PROGRESS:
• <in-progress item — current state>

REMAINING:
• [ ] <next task>
• [ ] <task after that>

If the handoff has Decisions, Dead Ends, or Discoveries sections, include a brief note:

CONTEXT:
• <N> decisions documented (key: <most important one>)
• <N> dead ends to avoid
• <N> discoveries noted

4. Suggest First Action

Read the handoff's Resume Instructions section and present the specific first steps.

If drift was detected, prepend a recovery step:

  • Branch mismatch: "First, switch to the correct branch"
  • New commits: "Review the N new commits before continuing — they may affect your plan"
  • Missing uncommitted changes: "Expected in-progress changes are gone — check if they were committed or lost"

5. Wait for User

Do not start working automatically. Present the orientation and wait for the user to confirm or redirect.

Notes

  • This is read-only — no modifications to files, git, or project state (except branch checkout if user approves)
  • Pairs with /trellis:context-handoff which generates the handoff document
  • If the handoff document is stale (>48 hours old based on the Generated timestamp), warn the user that significant drift is likely

Source

git clone https://github.com/NorthShoreAutomation/trellis/blob/main/skills/context-resume/SKILL.mdView on GitHub

Overview

This skill reattaches you to a prior session by locating a handoff.md and aligning your current project state with it. It reads the handoff, validates Git state (branch, last commit, uncommitted changes), and provides a concise orientation before you approve the next steps.

How This Skill Works

It first locates the handoff.md using an explicit path or the project root. It then compares the current Git state to the handoff's reported branch, last commit, and uncommitted changes and flags drift. Finally it presents a clear orientation and the suggested first action, awaiting your confirmation to resume.

When to Use It

  • Starting a new Claude Code session with an existing handoff.md in the project.
  • You say 'resume', 'read handoff', or 'pick up where we left off'.
  • Continuing work from a previous Claude Code session.
  • You provide a handoff path via ARGUMENTS to resume from a specific location.
  • You want a drift check before resuming to ensure alignment with the recorded plan.

Quick Start

  1. Step 1: Locate handoff.md via ARGUMENTS or project root.
  2. Step 2: Validate current Git state against the handoff (branch, last commit, uncommitted changes).
  3. Step 3: Present orientation and await your confirmation to resume.

Best Practices

  • Read the handoff document in full before taking any action.
  • Run the Git-state checks and compare them to the handoff details for drift.
  • Do not modify project state unless you have explicit user approval.
  • If drift is detected, present the recovery steps and obtain confirmation to proceed.
  • Use the handoff's Resume Instructions as the first actionable steps after orientation.

Example Use Cases

  • A new session starts and the handoff.md shows branch feat/new-feature and last commit abc123; you review and resume with the proper branch context.
  • User asks to resume after a pause; the system detects drift and offers to switch branches before continuing.
  • ARGUMENTS contains a path to handoff.md; the agent loads it and presents an orientation without changing state.
  • Handoff includes completed items and an in-progress task; you confirm the next action to pick up where left off.
  • Handoff is older than 48 hours; the system warns about potential drift and suggests refreshing the handoff.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers