context-end · git:20260829.174856f · 2026-08-29 · sha256 3adeccfb8afa19bc
context-end git:20260829.174856fA
Immutable. This exact content is served forever at /api/v1/blob/3adeccfb8afa19bc.
--- name: context-end description: Close a workspace session by reviewing a proposed summary, recording approved outcomes, updating state and decisions, and checking repository safety. Use only when the user explicitly asks to end, close, or hand off the current session. --- # End a workspace session ## Execution root (required) Before reading or writing repository content or running a lifecycle command, establish the exact repository working directory supplied by the host for this invocation. Accept that directory as the lifecycle execution root only when it contains both `AGENTS.md` and `scripts/contextos.sh`. Do not substitute the process or tool working directory, an agent/private workspace, the skill install location, or any parent or ancestor discovered by searching upward. If the host-supplied directory is unavailable or either marker is absent, stop and report the problem without creating a payload or running the kernel. Under the v0.12 full-template wrapper path this is the colocated `KernelRoot`, `ContextRoot`, and nominal `WorkingRoot`. A separate application repository is not a supported lifecycle execution root. Anchor every repository read and write under that exact root. Run `scripts/contextos.sh` and repository validation with their working directory explicitly set to that root (or use absolute paths beneath it); this includes all `.context-os/inputs/`, proposal, receipt, state, session, and routing paths. Leave durable, reviewable state for the next session. ## Procedure ### 1. Draft before writing Determine today's local date and time. Extract completed work, durable decisions and rationale, meaningful rejected alternatives, priority or thread changes, blockers, open work, and next actions. Present the draft and obtain confirmation before creating a proposal. ### 2. Build the deterministic proposal Create a reviewed JSON payload under `.context-os/inputs/` with: - `what_happened`: approved factual strings; - `decisions`: durable objects containing `decision`, `rationale`, and optional `rejected_alternatives`; - `next_time`: approved open-work strings; and - optional complete desired Markdown for `current_markdown`, `blockers_markdown`, or `weekly_priorities_markdown`, only when that state materially changed. Run `bash scripts/contextos.sh propose end --input <payload.json>`. The kernel owns session append behavior, decision rows, dates, exact paths, the single `Last Updated` line, and same-day history. Present every returned diff and its proposal digest. The digest binds the exact content but does not authenticate a human approver; rely on the host permission boundary for explicit confirmation. ### 3. Apply only the approved proposal After explicit approval of that exact diff, run: ```text bash scripts/contextos.sh apply <proposal> --confirm <digest> --runtime <active-runtime> ``` The kernel must refuse altered proposals, changed targets, path escapes, or a concurrent apply. Never bypass those checks or edit lifecycle state directly. ### 4. Check repository state If this is a git repository, inspect recent commits for parallel work touching the same files, show uncommitted files, and show the count of unpushed commits when an upstream exists. Flag conflicts and wait for direction. Never commit, push, discard, or reconcile without explicit approval. Outside git, skip this. ### 5. Confirm the handoff Report the receipt path, what was logged, changed state files, and the top next action. Mention any conflict or repository work still awaiting a decision.