Skip to content

feat: add alive:end-session skill for explicit session closing#36

Open
0xmoostorm wants to merge 1 commit intoalivecontext:mainfrom
0xmoostorm:feat/end-session-skill
Open

feat: add alive:end-session skill for explicit session closing#36
0xmoostorm wants to merge 1 commit intoalivecontext:mainfrom
0xmoostorm:feat/end-session-skill

Conversation

@0xmoostorm
Copy link
Copy Markdown

Summary

  • Adds /alive:end-session — an explicit command to cleanly close a session
  • Routes unsaved stash, writes closing log entry, sets ended: timestamp on squirrel YAML
  • Updates save skill to delegate session exit to end-session instead of inlining the protocol
  • Registers as the 16th skill in CLAUDE.md

Problem

Sessions that end by closing the terminal, disconnecting, or just walking away never get their squirrel entry closed. The ended: field stays null forever. Over time these ghost squirrels accumulate — polluting session history, confusing system-cleanup, and causing fallback patterns in hooks (grep -rl 'ended: null') to pick up wrong sessions.

A SessionEnd hook was considered but rejected: it would break session resume, since the resume hook looks for ended: null to find active sessions. An explicit skill is the right design — the human decides when they're truly done.

Changes

File Change
plugins/alive/skills/end-session/SKILL.md New skill — full flow with stash check, closing log, squirrel update
plugins/alive/CLAUDE.md Register as 16th skill
plugins/alive/skills/save/SKILL.md "On Actual Session Exit" now delegates to end-session

Test plan

  • Start a session, stash some items, run /alive:end-session — verify stash routing prompt appears
  • Run /alive:end-session with no stash — verify it skips straight to closing
  • Check squirrel YAML after close — ended: should have ISO timestamp
  • Run /alive:end-session on an already-closed session — should print "session already closed"
  • Resume a session that was NOT end-sessioned — verify resume still works (regression check)

🤖 Generated with Claude Code

Sessions that end by closing the terminal or disconnecting never get
their squirrel entry closed — ended: stays null forever. These ghost
squirrels accumulate, pollute session history, and confuse hook
fallback patterns.

This adds /alive:end-session — an explicit "I'm done" command that:
- Checks for unsaved stash and offers to route it
- Writes a closing log entry to the active walnut
- Sets ended: timestamp on the squirrel YAML
- Updates transcript path

Also updates save skill to reference end-session for actual session
exit instead of inlining the closing protocol.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant