ctx-wrap-up
End-of-session context persistence ceremony. Use when wrapping up a session to capture learnings, decisions, conventions, and tasks.
Best use case
ctx-wrap-up is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
End-of-session context persistence ceremony. Use when wrapping up a session to capture learnings, decisions, conventions, and tasks.
Teams using ctx-wrap-up should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/ctx-wrap-up/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How ctx-wrap-up Compares
| Feature / Agent | ctx-wrap-up | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
End-of-session context persistence ceremony. Use when wrapping up a session to capture learnings, decisions, conventions, and tasks.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
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.
## Before Starting
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."
## When to Use
- At the end of a session, before the user quits
- When the user says "let's wrap up", "save context", "end of
session"
- When the `check-persistence` hook suggests it
## When NOT to Use
- Nothing meaningful happened (only read files, quick lookup)
- The user already persisted everything manually with `ctx add`
- Mid-session when the user is still in flow: use `/ctx-reflect`
instead for mid-session checkpoints
## Process
### Phase 1: Gather signal
Do this **silently**: do not narrate the steps:
1. Check what changed in the working tree:
```bash
git diff --stat
```
2. Check commits made this session:
```bash
git log --oneline @{upstream}..HEAD 2>/dev/null || git log --oneline -5
```
3. Scan the conversation history for:
- Architectural choices or design trade-offs discussed
- Gotchas, bugs, or unexpected behavior encountered
- Patterns established or conventions agreed upon
- Follow-up work identified but not yet started
- Tasks completed or progressed
### Phase 2: Propose candidates
Think step-by-step about what is worth persisting. For each
potential candidate, ask yourself:
- Is this project-specific or general knowledge? (Only persist
project-specific insights)
- Would a future session benefit from knowing this?
- Is this already captured in the context files?
- Is this substantial enough to record, or is it trivial?
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?
```
### Phase 3: Persist approved candidates
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 add learning "Title" --session-id ID --branch BR --commit HASH --context "..." --lesson "..." --application "..."` |
| Decision | `ctx add decision "Title" --session-id ID --branch BR --commit HASH --context "..." --rationale "..." --consequence "..."` |
| Convention | `ctx add convention "Description"` |
| Task (new) | `ctx add task "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.
### Phase 3.5: Suppress post-wrap-up nudges
After persisting, mark the session as wrapped up so checkpoint
nudges are suppressed for the remainder of the session:
```bash
ctx system mark-wrapped-up
```
### Phase 4: Commit (optional)
After persisting, check for uncommitted changes:
```bash
git status --short
```
If there are uncommitted changes, offer:
> There are uncommitted changes. Want me to run `/ctx-commit`
> to commit with context capture?
Do not auto-commit. The user decides.
## Candidate Quality Guide
### Good candidates
- "PyMdownx `details` extension wraps content in `<details>`
tags, breaking `<pre><code>` rendering in MkDocs": specific
gotcha, actionable for future sessions
- "Decision: use file-based cooldown tokens instead of env vars
because hooks run in subprocesses": real trade-off with
rationale
- "Convention: all skill descriptions use imperative mood":
codifies a pattern for consistency
### Weak candidates (do not propose)
- "Go has good error handling": general knowledge, not
project-specific
- "We edited main.go": obvious from the diff, not an insight
- "Tests should pass before committing": too generic to be
useful
- Anything already present in LEARNINGS.md or DECISIONS.md
## Relationship to /ctx-reflect
`/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.
## Quality Checklist
Before presenting candidates, verify:
- [ ] Signal was gathered (git diff, git log, conversation scan)
- [ ] Every candidate has complete fields (not just a title)
- [ ] Candidates are project-specific, not general knowledge
- [ ] No duplicates with existing context files
- [ ] Empty categories are omitted, not shown as "(none)"
- [ ] User is asked before anything is persisted
After persisting, verify:
- [ ] Each `ctx add` command succeeded
- [ ] Uncommitted changes were surfaced (if any)
- [ ] User was offered `/ctx-commit` (if applicable)Related Skills
ctx-verify
Verify before claiming completion. Use before saying work is done, tests pass, or builds succeed.
ctx-skill-creator
Create, improve, test, and deploy skills. Full skill lifecycle from intent to working skill file.
ctx-sanitize-permissions
Audit tool permissions for dangerous or overly broad entries. Use to ensure safe agent configuration.
ctx-recall
Browse session history. Use when referencing past discussions or finding context from previous work.
ctx-prompt
Apply, list, and manage saved prompt templates from .context/prompts/. Use when the user asks to apply, list, or create a reusable template like code-review or refactor.
ctx-journal-normalize
Normalize journal source markdown for clean rendering. Use after journal site shows rendering issues: fence nesting, metadata formatting, broken lists.
ctx-import-plans
Import plan files into project specs directory. Use to convert external plans into project-tracked specs.
ctx-compact
Archive completed tasks and trim context. Use when context files are growing large.
ctx-check-links
Audit docs for dead links. Use before releases, after restructuring docs, or when running a documentation audit.
ctx-add-task
Add a task. Use when follow-up work is identified or when breaking down complex work into subtasks.
ctx-add-learning
Record a learning. Use when discovering gotchas, bugs, or unexpected behavior that future sessions should know about.
ctx-add-decision
Record architectural decision. Use when a trade-off is resolved or a non-obvious design choice is made that future sessions need to know.