/session-flow:clean-stop [--unattended]from session-flow
Sweeps every repo and worktree touched this session for uncommitted, unpushed, or PR-less work, pushes it, and reports whether it's safe to shut down. Use before ending a session or stopping for the day.
Ships in session-flow. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Before a machine may disappear (end of day, a reclaimed spot instance, a torn-down container, walking away), sweep everything touched this session to a durable, linked resting state and report whether it is genuinely safe to shut down.
/session-flow:keep-going recovers a session after an interruption; clean-stop
makes the interruption safe beforehand. It supersedes a local
/session-flow:handoff when the machine itself may go away: a handoff file dies
with the disk, so clean-stop leaves the resumable state in the PR and issue
bodies on the remote.
--unattended is the only argument: the caller declares that nobody is present. It only gates the
/export step (dropped: an unattended run neither suggests nor runs a user-only built-in); remote artifacts are always created
without prompting, as step 3 states. Take it out wherever it appears; other text is context for the
sweep. The bare word unattended is not this flag: stop and name --unattended.
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.~/.claude tree and are
retention-swept besides (pointer:
All settings § cleanupPeriodDays).
When the session is worth keeping:
Native suggestions are on unless native_suggestions resolves off: the team docs/conventions/session-flow.yaml value wins over the per-user value ${user_config.native_suggestions} (a literal unexpanded token means unset); with none set they are on. A value other than on or off is named and that layer dropped: a valid higher layer still wins, otherwise on, never a lower layer's value. When off, skip the sentence below and write nothing in its place, not even a note that it was skipped or why.
If /export is available in your session (gate basis: Verification record: /export below) and native suggestions are on (native_suggestions, Configuration), suggest that the person run it for a durable conversation copy at <memory_dir>/exports/<YYYYMMDDTHHMMSSZ>-<topic>.txt after verifying the memory root's self-ignore guard (a .gitignore containing *; create it and announce it when absent). This skill never invokes /export itself. --unattended: make no suggestion and write Withheld suggestion (unattended): /export in the output.
That destination is machine-local, so when the machine may go away, also
surface copying the export off the machine as a "preserve off the machine" item.<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, open the PR with the forge's own tooling,
passing that no-linkage reason, the title, and the body non-interactively:
the guaranteed non-interactive path. Route through
/source-control:pull-request create (if enabled) or a
work-item capability only when it can run unattended with that decision
passed in; if it would stop to ask, use git and the forge's own tooling
carrying the same decision instead.git status --ignored) and preserve or surface anything not
reproducible: a local .env, credentials, generated handoff data, or files
a bootstrap copied in. When checking what plain git status lists and
what git worktree remove refuses or deletes, read
git-status --ignored
and git-worktree remove
live. A worktree git worktree list --porcelain reports locked is
another session's claim unless the lock reason names this session; leave
it alone. Anything still holding unmerged commits, dirty state,
irreplaceable ignored files, a running job, or another session's lock 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.
/export/export to the person and never runs it: we treat it as an interactive built-in the Skill tool cannot invoke and a headless run cannot reach, and a command that is not available to the person is left out of the menu.export → session-flow:clean-stop entry of docs/native-surfaces.md in this plugin's marketplace repository holds the headless refusal, the invocation mode, and the trigger that reopens this decision./export can run headless or take a format or redaction flag, fetch the /export row of Commands § All commands live.git and the forge's or tracker's own tooling; it does not reimplement them.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub melodic-software/claude-code-plugins --plugin session-flow20 skills in this plugin
/audit-frictionAudit frictionAudit Claude Code sessions for permission and autonomy friction (denials, approval prompts, hook blocks, hand-offs), traced to cause in one decision brief. Use when the agent keeps asking or handing off, auto mode denies, or re-measuring after permission fixes./audit-sessionsAudit sessionsAudit every Claude Code session on this machine or behind a pull request for wasted time and tokens against a baseline, routing findings to fixes, plus score trends over time. Use when: 'audit my sessions', 'which sessions burned the most tokens', 'retro this PR', trends, or repeating corrections. Not for one session: /session-flow:retro./continue-in-backgroundContinue in backgroundHand the task to a fresh detached background agent (claude --bg or --cloud) that continues it now from a save-point. Use when the user is going AFK and explicitly asks to 'continue in the background'. Launches only on that request, never self-elected./find-handoffFind handoffRecover a lost handoff save-point or resume prompt after /clear, from the handoffs folder then recent transcripts, confirming before resuming. Use when: 'find my handoff', 'I lost the resume prompt'. A session that ended mid-work: /session-flow:keep-going./go-with-recommendationsGo with recommendationsAccept the agent's latest recommendations after re-grounding each in code/sources, surfacing changed or unconfirmable items; supports exceptions./handoffWrite a mid-session save-point for /clear-and-resume: a copy-paste resume prompt, plus a durable handoff file when the work needs one. Use when: 'handoff', 'checkpoint this', the session is heavy, or responses drift or loop. Background continuation: /session-flow:continue-in-background.Other plugins' skills for the same job