/ctx:ctx-wrap-upfrom ctx
End-of-session ceremony that captures learnings, decisions, conventions, and tasks from the working tree and conversation history, persists approved items via `ctx add`, and delegates final handover to `/ctx-handover`.
Ships in ctx. 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.
None: SKILL.md is the whole skill.
Guide end-of-session context persistence. Gather signal from the
session, propose candidates worth persisting, and persist approved
items via ctx add.
This is a ceremony skill: invoke it explicitly as /ctx-wrap-up
at session end, not conversationally. It pairs with /ctx-remember
at session start.
Check that the context directory exists. If it does not, tell the user:
"No context directory found. Run ctx init to set up context
tracking, then there will be something to wrap up."
/ctx-wrap-up owns the user-facing session-end trigger and
always delegates to /ctx-handover as its final step.
The handover is the former agent's note to the next agent
(or human): what happened, and what should come next. It
writes .context/handovers/<TS>-<slug>.md (timestamped so
multiple agent runs never overwrite). Without this final
step, /ctx-remember has nothing to read at the start of
the next session and recall degenerates into probabilistic
reconstruction from canonical files plus journal.
If .context/kb/ exists, this project additionally uses the
editorial pipeline. After the capture phase but before the
final /ctx-handover delegation:
.context/ingest/closeouts/.
These are per-pass audit artifacts from /ctx-kb-ingest,
/ctx-kb-ask, etc. that have not yet been folded into a
handover..context/kb/outstanding-questions.md (rows whose Status
is open).When .context/kb/ does NOT exist, skip this section
entirely; the wrap-up proceeds with the standard capture
checklist and still ends with /ctx-handover.
check-persistence hook suggests itctx add/ctx-reflect
instead for mid-session checkpointsDo this silently: do not narrate the steps:
git diff --stat
git log --oneline @{upstream}..HEAD 2>/dev/null || git log --oneline -5
Think step-by-step about what is worth persisting. For each potential candidate, ask yourself:
Present candidates in a structured list, grouped by type. Skip categories with no candidates: do not show empty sections.
## Session Wrap-Up
### Learnings (N candidates)
1. **Title of learning**
- Context: What prompted this
- Lesson: The key insight
- Application: How to apply it going forward
### Decisions (N candidates)
1. **Title of decision**
- Context: What prompted this
- Rationale: Why this choice
- Consequence: What changes as a result
### Conventions (N candidates)
1. **Convention description**
### Tasks (N candidates)
1. **Task description** (new | completed | updated)
Persist all? Or select which to keep?
Wait for the user to approve, select, or modify candidates. Wait for the user to approve each item before persisting: candidates proposed by the agent may be incomplete or mischaracterized, and the user is the final authority on what belongs in their context.
For each approved candidate, run the appropriate command:
| Type | Command |
|---|---|
| Learning | ctx learning add "Title" --session-id ID --branch BR --commit HASH --context "..." --lesson "..." --application "..." |
| Decision | ctx decision add "Title" --session-id ID --branch BR --commit HASH --context "..." --rationale "..." --consequence "..." |
| Convention | ctx convention add "Description" |
| Task (new) | ctx task add "Description" --session-id ID --branch BR --commit HASH |
| Task (done) | Edit TASKS.md to mark complete |
Report the result of each command. If any fail, report the error and continue with the remaining items.
After persisting, mark the session as wrapped up so checkpoint nudges are suppressed for the remainder of the session:
ctx system mark-wrapped-up
After persisting, check for uncommitted changes:
git status --short
When git status --short reports any modified or untracked
files, surface them and offer /ctx-commit:
There are uncommitted changes (
<count>files). Run/ctx-committo commit with context capture?
Do not auto-commit; the user decides. But always run the
git status check and always surface non-empty output. Do
not skip this phase silently when the working tree is dirty.
Run:
ctx system check-knowledge --report
When it prints findings, surface them as a closing suggestion:
a foldable root → run /ctx-digest next session; a heavy
page → split the theme or extract it to tooling. Prints nothing
when every root is within limits — then say nothing.
Never fold inline here. The human is closing the laptop to go
live their life; running a semantic pass at wrap-up is against
their interest (spec: progressive-disclosure ### Triggers). This
phase suggests for next session; it does not act.
Before handing over, sweep this session — and any others that have grown since their last import — into the journal so the next session can read it:
ctx journal import --all -y
This is growth-aware and idempotent: it imports the live
session as far as it has progressed today and self-heals on the
next run, so running it mid-wrap-up is safe and needs no flags
beyond -y. Treat it as non-blocking — if it errors, note
the error and continue to the handover anyway; a failed import
must never block the handover. (A SessionEnd hook runs the
same sweep automatically; this ceremony step is belt-and-
suspenders.) Enrichment is a separate LLM pass
(/ctx-journal-enrich-all) and is not part of wrap-up.
/ctx-handover (mandatory)/ctx-wrap-up always ends here. Drafting the handover reuses
the signal gathered in Phase 1 and the candidates approved in
Phase 3:
<TS>-<slug>.md). Drawn from the
conversation; confirm with the user.--summary (required, past tense): one paragraph
naming what was done this session, drawn from the approved
candidates and the git-log scan. Concrete, not vague.--next (required, future tense): one paragraph
naming the specific first action the next agent should
take. Pull from the highest-priority pending task in
TASKS.md or the open thread the session was on.--highlights: draft a bullet list of notable
artifacts produced this session (commits, decisions,
specs, files created). Always present a draft. Pass an
empty string only after the user has explicitly said
there is nothing to highlight.--open-questions: draft a bullet list of things
that remain undecided. Pull from any candidate the user
did not turn into a decision, any deferred ingest pass,
any TODO discovered in the session. Always present a
draft. Pass an empty string only after the user has
explicitly confirmed there is nothing open.Surface the drafted values to the user for one final confirmation, then delegate:
/ctx-handover "<title>" --summary "<...>" --next "<...>" \
[--highlights "<...>"] [--open-questions "<...>"]
The /ctx-handover skill performs the pre-write gates,
writes .context/handovers/<TS>-<slug>.md, and (when
.context/kb/ exists) folds postdated closeouts into the
## Folded Closeouts section and archives them. See
/ctx-handover for the full input contract and CLI
flag reference.
If /ctx-handover refuses (missing .context/handovers/,
empty placeholder values, etc.), surface the refusal to the
user. Do not declare the wrap-up complete until the handover
landed.
details extension wraps content in <details>
tags, breaking <pre><code> rendering in MkDocs": specific
gotcha, actionable for future sessions/ctx-reflect is for mid-session checkpoints at natural
breakpoints. /ctx-wrap-up is for end-of-session: it's more
thorough, covers the full session arc, and includes the commit
offer. If the user already ran /ctx-reflect recently, avoid
proposing the same candidates again.
Before presenting candidates, verify:
After persisting, verify:
ctx add command succeeded/ctx-commit (if applicable)/ctx-handover was invoked and the resulting
.context/handovers/<TS>-<slug>.md was writtenWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
session-wrap-up, context-persistence, knowledge-base, handover
npx claudepluginhub activememory/ctx --plugin ctx54 skills in this plugin
/ctx-agentLoad full context packet. Use at session start or when context seems stale or incomplete./ctx-architectureBuild and maintain architecture maps. Use to create or refresh ARCHITECTURE.md and DETAILED_DESIGN.md. Supports principal mode for deeper analysis: vision, future direction, bottlenecks, implementation alternatives, gaps, upstream proposals, and intervention points./ctx-architecture-enrichEnrich architecture artifacts with code intelligence data. Takes existing /ctx-architecture output as baseline, verifies and quantifies with GitNexus MCP (blast radius, execution flows, domain clustering, registration sites). Run after /ctx-architecture, not instead of it./ctx-architecture-failure-analysisAdversarial failure analysis for codebases. Generates falsifiable incident hypotheses: race conditions, ordering assumptions, cache staleness, error swallowing, ownership gaps, idempotency failures, and scaling cliffs. Produces DANGER-ZONES.md with evidence-backed, ranked findings./ctx-archiveArchive completed tasks. Use when TASKS.md has many completed items cluttering the view./ctx-blogGenerate blog post draft. Use when documenting project progress, sharing learnings, or writing about development experience.Other plugins' skills for the same job