Skip to content
Development
Skill

/close

End session with verification, commits, and documentation

From plugin
session-orchestrator
5252 skills14 agents2 commands10 hooks
+1

Claude Code

$ npx -y skills add Kanevry/session-orchestrator --skill close --agent claude-code

SKILL.md

close.SKILL.md
name: close
description: End session with verification, commits, and documentation
user-invocable: true
disable-model-invocation: true
model: inherit

Close Session

Invocation

The user invokes `/close` (arguments: **$ARGUMENTS** — none are interpreted; anything passed is context only) to end the current session. Run the STATE.md pre-check below, then hand off to `skills/session-end/SKILL.md`. Do NOT skip any verification step — evidence before assertions.

The user wants to end the current session.

**Pre-check before invoking session-end (#1661).** Run, from the project root:

node "${CLAUDE_PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-$PLUGIN_ROOT}}/scripts/close-precheck.mjs" --repo-root "$(git rev-parse --show-toplevel 2>/dev/null || pwd)"

It prints one JSON object (exit 0 for every verdict). It reads `<state-dir>/STATE.md` for the current platform (`.claude/`, `.codex/`, `.cursor/`, `.pi/`) and decides **whose** it is before it looks at `status`: STATE.md `session-id` (#1368) against this process's native id (`readProcessLocalSessionIds()`). Never decide ownership from the session lock: it records the pid of the short-lived hook process, and in a shared checkout it can name a peer. After `/clear` the tab runs under a NEW native id, so the STATE.md of the work before `/clear` reads as foreign — measured 2026-10-17 in three sessions. A STATE.md without `session-id` (before #1368) or a process without a native id (`ownership: legacy` / `unprovable`) never reaches session-end on its status alone (#1718): where the status would hand off, the verdict is `ownership-unproven`. An optional `--confirm-own <confirmToken>` (16 lowercase hex, from that verdict) re-runs the pre-check for the unchanged file. Act on `verdict`:

1. **`run-session-end`** — own STATE.md, or one confirmed with `--confirm-own` (`ownership: confirmed`), `status: active` or `paused`: invoke the session-end skill. 2. **`complete-missing-record`** — own or confirmed STATE.md `status: completed`, but `.orchestrator/metrics/sessions.jsonl` holds no completed record for it (#429: `completed` alone does not prove the Phase 3.7 writer ran; an abandoned backfill stub is no completion). Warn: "STATE.md completed ohne passenden Abschluss im Ledger — session-end wird zur Vervollständigung ausgeführt (#429)." and invoke the session-end skill. (The SessionEnd hook's `backfillCompletedFromStateMd` heals the same gap on a later teardown; this branch covers a `/close` re-run before that.) 3. **`already-finalized`** — a matching completed record exists (a legacy record without `status` counts): "Previous session was already finalized by session-end. Start a new session with `/session`, or inspect `<state-dir>/STATE.md` to review the prior close. (Note: if this is unexpected after an Express Path session, `skills/go/SKILL.md` should have auto-invoked /close — check that STATE.md `## Deviations` contains an `Express path:` entry.)" Stop. 4. **`foreign`** — STATE.md belongs to session `stateSessionId`, not to this one, whatever its `status`. Never invoke session-end on it and never edit it: an `active`/`paused` one is a peer's live session, a `completed` one an earlier tab or a peer. Inform: "STATE.md gehört Session `<stateSessionId>` (status `<status>`), nicht dieser — kein eigener Plan zum Abschließen." With `status: active` or `paused` add: "Ist das der Plan dieses Tabs von vor einem `/clear`, kann ihn dieser Prozess nicht als eigenen belegen; er bleibt offen, der SessionEnd-Hook füllt den Ledger nach." Stop. 5. **`ownership-unproven`** — nobody can prove this STATE.md is this session's (`ownership` `legacy`: no `session-id`; or `unprovable`: this process has no native id, as on Cursor, Pi, Codex without a thread id); session-end would run `wouldRun`. Never invoke session-end on this result and never edit the file. Inform with the facts from the JSON: "STATE.md `<statePath>` ist keiner Session nachweisbar zugeordnet (ownership `<ownership>`, session `<session>`, session-id `<stateSessionId>`, started_at `<startedAt>`, status `<status>`); session-end würde `<wouldRun>` ausführen." — the `session-id` part only when `stateSessionId` is present: without a native id (`unprovable`) a STATE.md that names another session's id comes back here, and the operator must see that. Confirm ONLY when (a) the operator explicitly answers that this is this session's plan — ask via `AskUserQuestion` on Claude Code (a numbered list on Codex/Cursor/Pi, per `.claude/rules/ask-via-tool.md`), the question naming path, session, `session-id` (when present), started_at and status; or (b) first-person evidence: this session's OWN tool call that wrote exactly this STATE.md is visible in its current context (for example its own wave-executor initialised it in this conversation). A compaction summary, a handover file, memory notes or the STATE.md content itself are NOT first-person evidence, and neither is anything inferred from the `session` label, `started_at` or the session lock, which are repo-wide. With a native id (Claude Code, Codex with a thread id) a `legacy` file is usually an older or foreign file — writers stamp `session-id` whenever this process's own lock exists at write time, so an own legacy file arises only when the STATE.md was written without an own lock; expect (b) to apply rarely there. A Lead-led or headless session without (b) never confirms: it stops and reports. On confirmation, re-run the pre-check with `--confirm-own <confirmToken>` and act on the NEW verdict per items 1/2. If it again returns `ownership-unproven` with `reason` (the file changed), show the new facts and decide again; never reuse an old token. Otherwise the plan stays untouched: it belongs to another or an earlier session; start an own `/session`, or inspect the file. Stop. 6. **`no-state`** — read Session Config `persistence`. `false`: "Session completed (persistence is off — STATE.md was never created). Use `/session` to start a new session." Otherwise: "No act

Read more
@kanevry
Ships withsession-orchestrator

Your coding agents get an agreed plan, a check after each round of changes and a handover to the next session. A free, MIT-licensed workflow plugin for people running Claude Code, Codex CLI, Cursor IDE or Pi on a git repository.

5252 skills14 agents1 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
52
Star history of Kanevry/session-orchestrator on GitHub, a chart by star-history.com

Other skills on session-orchestrator.

autopilot

autopilot

Use this skill when running an autonomous session-orchestration loop. Chains session-start → session-plan → wave-executor →…

bootstrap

bootstrap

Use this skill when scaffolding the minimum repository structure required by session-orchestrator. Invoked automatically by the…

brainstorm

brainstorm

Use when you have a feature idea but the scope or UX is still ambiguous — runs a lightweight Socratic design dialogue (3-5 AUQ…

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills10d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc12d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react1d252k
@facebook@facebookInstall Skill

Questions about close.

Which coding agents can use close?
close installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.