From session-flow
Get a session to a clean stopping point before the machine may go away — everything durable, everything linked, nothing stranded on local disk. Sweep every repo and worktree touched for uncommitted, unpushed, or PR-less work, push it durable, put follow-ups and context in PR/issue bodies a cold agent could resume from, prune only what is provably safe, then give a free-and-clear verdict. Use when: 'clean stop', 'get to a clean stopping point', 'safe to shut down', 'wrap up before I lose this machine', 'make everything durable', 'stopping for the day', 'is anything stranded', 'leave it clean'. Makes durable freely; gates destructive cleanup.
How this skill is triggered — by the user, by Claude, or both
Slash command
/session-flow:clean-stopThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Before a machine may disappear — end of day, a spot instance about to
Before a machine may disappear — end of day, a spot instance about to reclaim, a container about to be torn down, or just walking away — in-flight work is easy to strand: a commit that never pushed, a branch with no PR, a plan that lives only in a local file, a worktree nobody will find again. This skill sweeps everything touched this session to a durable, linked resting state and reports whether it is genuinely safe to shut down.
Where /session-flow:keep-going recovers a session AFTER an interruption,
clean-stop is its go/stop mirror — it makes the interruption safe BEFOREHAND,
so there is nothing to recover. It supersedes a local /session-flow:handoff
when the machine itself may go away: a handoff file is a machine-local
save-point, and a save-point that dies with the disk is no save-point.
clean-stop leaves the resumable state where it survives the machine — in the
PR and issue bodies on the remote.
git status hides but which dies with the disk just
the same. Act only on the gaps. Running
clean-stop when a branch is already pushed and its PR already describes the
work must NOT re-push, open a duplicate PR, or re-file issues — the sweep
converges on what is missing, not on redoing what is done.<REDACTED: API key>), never the
value. This scrub is a hard gate: the breadcrumbs land on a remote shared
with others and pass no human review first, so nothing outbound is written
before it runs. Then link the work: every pushed non-default branch gets
a PR — a branch that is the repo's default (main / master / trunk, or
whatever git symbolic-ref refs/remotes/origin/HEAD resolves to) carries
no PR and needs none once pushed. Every follow-up gets filed as an issue
LINKED to that PR; dependencies, remaining tasks, and the context needed to
continue live in the PR and issue bodies — never only in a local file. The
acceptance bar is a cold agent: someone who finds the PR or issue with no
memory of this session should have everything needed to offer to continue.
Every remote artifact is created unattended, so the issue-linkage decision
is made up front, never left for an interactive prompt: use the closing
keyword when the branch or context names an issue, otherwise an explicit
no-linkage reason. For an orphan branch — a hotfix, refactor, or drift
sweep with no issue in its name — drive a direct gh pr create supplying
that no-linkage reason, the guaranteed non-interactive path. Route through
an installed pull-request or work-item capability only when it can run
unattended with that decision passed in; if it would stop to ask, use the
direct git / gh path carrying the same decision instead.git status hides ignored files, but git worktree remove deletes
them — so before removing a worktree, inspect its ignored content
explicitly (git status --ignored) and preserve or surface anything not
reproducible: a local .env, credentials, generated handoff data, or files
a bootstrap copied in. Anything still holding unmerged commits, dirty state,
irreplaceable ignored files, or a running job is NOT pruned — it becomes a
named item in the verdict..env, to a tidy-up is the exact
failure this skill exists to prevent.If the sweep finds everything already durable and linked — nothing uncommitted, nothing unpushed, every non-default branch that carries session work has a PR (work committed straight to the default branch is durable once pushed and needs none), nothing strandable left only on local disk — including non-reproducible ignored state a plain status hides — say so and give the free-and-clear verdict directly. A clean session is a valid, common outcome; do not manufacture work to look thorough.
/session-flow:handoff and why it
supersedes it when the machine may go away.git / gh; it does not reimplement them.npx claudepluginhub melodic-software/claude-code-plugins --plugin session-flowCreates, edits, and verifies skills using a test-driven development approach with pressure scenarios and subagents.