agentleFS
wilstowilsto/claude-code-starter-kit/.claude/skills/session-wrap/SKILL.md

session-wrap

Skill0 starsChanged 8 months agoMITView on GitHub

End-of-session structured wrap-up: capture learnings, update scratchpad with next steps, check for uncommitted changes, ask if polaris needs updating. Complements post-commit-lessons.js (per-commit) — this runs once at session end. Triggers: "end session", "wrap up", "closing session", "fin de session", "session terminée".

13 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

10 rules. 0 are common, 4 are distinctive, and 6 are very specific to this project.

  • 0

    Common

    Most of the 10 edited versions we read keep these.

  • 4

    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. Very specific:

    If any staged or unstaged changes exist → suggest /commit before wrapping:

    line 26
  2. Distinctive:

    Wait for user response before continuing.

    line 29
  3. Very specific:

    Look through the conversation for messages prefixed with [LEARN]

    line 34
  4. Very specific:

    Look in scratchpad for any [LEARN] entries added during the session

    line 35
  5. Distinctive:

    Read current memory/scratchpad.md.

    line 53
  6. Distinctive:

    Ask: "What's the next step for next session?

    line 55
  7. Distinctive:

    Ask: "Did any priorities or goals shift today?

    line 69
  8. Very specific:

    If yes → run /polaris to update interactively

    line 71
  9. Very specific:

    If any source files were modified this session and /commit step 6 (spec-update) wasn't already run:

    line 76
  10. Very specific:

    Fix: Run /session-wrap even for short sessions.

    line 98

“Common” is measured: kept by at least 6 in 10 of the 10 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 Wrap — End-of-Session Protocol

Purpose

Structured close of a working session. Ensures nothing is lost across /compact or session restart. Runs once per session at the end — not per commit (that's handled by post-commit-lessons.js).

Application

Step 1 — Uncommitted changes check

git status --short

If any staged or unstaged changes exist → suggest /commit before wrapping:

"You have uncommitted changes. Run /commit first to preserve this work?"

Wait for user response before continuing.

Step 2 — Learnings capture

Scan the current session for any [LEARN] items:

  • Look through the conversation for messages prefixed with [LEARN]
  • Look in scratchpad for any [LEARN] entries added during the session

For each [LEARN] found:

  1. Present it to the user: "Found a learning: [text]. Add to memory/patterns.md?"
  2. On approval, append to memory/patterns.md under the Learnings section using the format:
### [Category] Rule description
- **Mistake**: what went wrong
- **Correction**: what to do instead
- **Project**: [project name]
- **Date**: YYYY-MM-DD

Categories: Navigation, Editing, Testing, Git, Quality, Context, Architecture, Performance

Step 3 — Scratchpad: next steps

Read current memory/scratchpad.md.

Ask: "What's the next step for next session? I'll add it to the scratchpad."

Append to scratchpad (append-only, never overwrite):

### HH:MM — Session wrap [YYYY-MM-DD]
- Done: [summary of what was completed this session]
- Next: [immediate next step for next session]
- Decision: [any key decision made, if applicable]
---

Step 4 — Polaris check

Ask: "Did any priorities or goals shift today? Update polaris.md?" (1 line answer)

  • If yes → run /polaris to update interactively
  • If no → skip

Step 5 — Spec check (conditional)

If any source files were modified this session and /commit step 6 (spec-update) wasn't already run:

"Code changed but spec update may be missing. Run /spec-update now?"

Advisory — user decides.

Step 6 — Closing summary

Output a brief session summary:

Session closed [YYYY-MM-DD HH:MM]
Done: [2-3 bullet points of what was accomplished]
Committed: [yes/no — last commit hash if yes]
Learnings captured: [N items]
Next: [one-liner from scratchpad]

Common Pitfalls

Pitfall 1: Skipping the wrap on short sessions

Symptom: "I'll remember." → next session starts with no context. Fix: Run /session-wrap even for short sessions. The 2-minute investment prevents a 10-minute re-orientation.

Pitfall 2: Running before committing

Symptom: Uncommitted changes exist at wrap time. Fix: Step 1 always checks — it blocks until user commits or explicitly skips.

References

  • memory/scratchpad.md — running work log, last 30 lines re-injected by session-context.js
  • memory/patterns.md — learnings storage (append only)
  • memory/polaris.md — strategic context (north star, goals, values)
  • /polaris skill — interactive polaris update
  • /spec-update skill — post-change documentation
  • post-commit-lessons.js hook — per-commit lesson reminder (complementary, not duplicate)

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.