一键导入
ctx-wrap-up
End-of-session context persistence ceremony. Use when wrapping up a session to capture learnings, decisions, conventions, and tasks.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
End-of-session context persistence ceremony. Use when wrapping up a session to capture learnings, decisions, conventions, and tasks.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
EXPERIMENTAL (discardable). Hand a loose intent spec (.context/specs/intent-<slug>.md) off to spec-kit's /speckit-specify with a prose synopsis. Optional and graceful — warns and continues if spec-kit is not installed; the intent spec stands either way. Third step of the experimental chain.
EXPERIMENTAL (discardable). Stress-test a plan through adversarial interview, then write a debated brief to .context/briefs/<TS>-<slug>.md. First step of the experimental spec-kit delegation chain: /ctx-experimental-plan → /ctx-experimental-spec → /ctx-experimental-handoff.
EXPERIMENTAL (discardable). Turn a debated brief into a LOOSE intent spec at .context/specs/intent-<slug>.md — deliberately not pre-shaped into spec-kit's template. Second step of the experimental chain: /ctx-experimental-plan → /ctx-experimental-spec → /ctx-experimental-handoff.
Run a disciplined "dream" triage pass over the gitignored ideas/ folder — classify each idea against the codebase and specs, and emit gated, provenance-bearing disposition proposals into the dreams/ notebook for human review. NEVER writes canonical memory and NEVER acts on a proposal. Use when invoked headlessly by the scheduler (cron `claude -p`) or when the user says "run the dream" / "dream over my ideas". The human reviews via /ctx-serendipity.
The human review "garden walk" over ctx-dream proposals. Reads pending proposals from the dreams/ notebook and walks the human through accept / reject / amend / skip, one at a time, substance-forward. Mechanical dispositions apply instantly; generative ones (merge, promote) are done here by reading the full source. Use when the user says "serendipity round", "review my dreams", "walk the garden", or "what did the dream find?". The dream proposes; serendipity disposes.
Record architectural decision. Use when a trade-off is resolved or a non-obvious design choice is made that future sessions need to know.
| name | ctx-wrap-up |
| description | End-of-session context persistence ceremony. Use when wrapping up a session to capture learnings, decisions, conventions, and tasks. |
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.
/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 written