Wrap-Up — Session End
Execute all steps. Present findings to the user before committing anything.
Step 1: Review Deliverables
Scan what happened this session:
- Run
git status and git diff --stat to see all changes
- List every file created or modified, grouped by location:
context/ — context files updated
.claude/skills/ — skills created or modified
- Source code — implementation work
- Docs repo — documentation created/updated (if workflow-enabled)
- Other locations — flag for review
- File placement check: Verify outputs follow naming conventions:
- Skills use
{category}-{function} naming
- Daily memory uses
YYYY-MM-DD.md format (main sessions) or YYYY-MM-DD_{session-name}.md (sandbox sessions)
- If anything is in the wrong place, flag it
Step 2: Detect Sandbox Environment
- Check if you're running inside an agentsandbox:
- Check if the
AGENTSANDBOX_SESSION env var is set
- OR check if
/workspace/CLAUDE.md exists (container indicator)
- OR check if the current branch starts with
asb/ (git symbolic-ref --short HEAD)
- If any is true, you are in a sandbox session
- If in a sandbox session, determine the session name:
- From
$AGENTSANDBOX_SESSION env var (preferred)
- Or from hostname: strip
asb- prefix from $HOSTNAME
- Or from branch name: strip
asb/{source}- prefix
Step 3: Update Daily Memory
- Choose the correct filename:
- Main session:
context/memory/{YYYY-MM-DD}.md
- Sandbox session:
context/memory/{YYYY-MM-DD}_{session-name}.md
- Example:
context/memory/2026-03-21_ux-study-test.md
- This keeps sandbox memory separate from main — no merge conflicts
- For full history context in a sandbox, read from
.context-main/memory/ (read-only mount of main's context)
- Update the session section with:
- Goal: What the user wanted to accomplish
- Work Done: Bullet points of what was accomplished
- Decisions: Key decisions made and why
- Learnings: Things discovered about the codebase, tools, or patterns
- Open Items: Unfinished work, blockers, things to pick up next
Step 4: Documentation Check (if workflow-enabled)
- Read
workflow.json to check if this is a workflow-enabled project
- If yes, review the session for documentation gaps:
Decisions → ADRs:
- Were any architectural or technical decisions made this session?
- If yes, does an ADR already exist for this decision?
- If no ADR exists, suggest: "Decision about [topic] — want me to create an ADR?"
New features → PRDs/Design Docs:
- Was a new feature discussed or started?
- Does it have a PRD or design doc?
- If not, suggest: "New feature [name] — want a PRD or design doc?"
Architecture changes → C4 Diagrams:
- Were new components, services, or integrations added?
- Do the C4 diagrams in the docs repo reflect these changes?
- If not, suggest: "Architecture changed — C4 diagrams may need updating"
Incidents → Post-Mortems:
- Was a production incident investigated or resolved?
- If yes, suggest a post-mortem
Research → Spike Reports:
- Was research or option comparison done?
- If yes, suggest capturing it as a spike report
Present documentation suggestions as a checklist — the user picks what to do:
### Documentation Suggestions
- [ ] Create ADR for [decision about X]
- [ ] Update C4 container diagram (new service added)
- [ ] Create spike report for [research topic]
Step 5: Distill to Long-Term Memory
- Review today's session notes. Ask yourself:
- Any lessons learned that future-me should know?
- Any decisions that affect how we work going forward?
- Any user preferences discovered?
- If yes, update
context/MEMORY.md with the distilled insight
- If any context files (SOUL.md, USER.md) should be updated based on
what you learned, suggest the changes to the user
Step 6: Collect Feedback (Optional)
- Ask the user briefly:
- "Anything I should do differently next time?"
- "Any preferences to remember?"
- If they provide feedback, update the relevant context file
Step 7: Commit (If Requested)
- Only if the user asks to commit:
- Stage relevant files
- Draft a clean commit message (no AI mentions, no Co-Authored-By)
- Show the message for approval before committing
- If changes span multiple repos (project + docs), handle each repo separately
Step 8: Cost Summary
- Check if
~/.claude/metrics/costs.jsonl exists. If it does, calculate today's total spend:jq -s '[.[] | select(.timestamp | startswith("'"$(date -u +%Y-%m-%d)"'"))] | {total_eur: (map(.estimated_cost_eur) | add), input_tokens: (map(.input_tokens) | add), output_tokens: (map(.output_tokens) | add), responses: length}' ~/.claude/metrics/costs.jsonl
- Present the cost summary to the user:
### Today's Usage
- Responses: N
- Tokens: Xk input / Yk output
- Estimated cost: €X.XX
Step 9: Summary
- Present a brief session summary:
- What was accomplished
- What's left for next time
- Any context files that were updated
- Any documentation suggestions that were deferred (so we remember next session)
- Today's cost (from step 16)
1---2name: meta-wrap-up3description: End-of-session checklist that reviews deliverables, updates daily memory, distills learnings, checks for documentation gaps, and optionally commits work. Use when the user says "wrap up", "close session", "end session", "wrap things up", "we're done", "that's it for today", "session done", or invokes /meta-wrap-up. Run at the end of any working session or after completing a major deliverable. Does NOT trigger for regular development work.4---5
6# Wrap-Up — Session End
7
8Execute all steps. Present findings to the user before committing anything.
9
10## Step 1: Review Deliverables
11
12Scan what happened this session:
13
141. Run `git status` and `git diff --stat` to see all changes
152. List every file created or modified, grouped by location:
16 - `context/` — context files updated
17 - `.claude/skills/` — skills created or modified
18 - Source code — implementation work
19 - Docs repo — documentation created/updated (if workflow-enabled)
20 - Other locations — flag for review
213. **File placement check:** Verify outputs follow naming conventions:
22 - Skills use `{category}-{function}` naming
23 - Daily memory uses `YYYY-MM-DD.md` format (main sessions) or `YYYY-MM-DD_{session-name}.md` (sandbox sessions)
24 - If anything is in the wrong place, flag it
25
26## Step 2: Detect Sandbox Environment
27
284. Check if you're running inside an agentsandbox:
29 - Check if the `AGENTSANDBOX_SESSION` env var is set
30 - OR check if `/workspace/CLAUDE.md` exists (container indicator)
31 - OR check if the current branch starts with `asb/` (`git symbolic-ref --short HEAD`)
32 - If any is true, you are in a **sandbox session**
335. If in a sandbox session, determine the session name:
34 - From `$AGENTSANDBOX_SESSION` env var (preferred)
35 - Or from hostname: strip `asb-` prefix from `$HOSTNAME`
36 - Or from branch name: strip `asb/{source}-` prefix
37
38## Step 3: Update Daily Memory
39
406. Choose the correct filename:
41 - **Main session**: `context/memory/{YYYY-MM-DD}.md`
42 - **Sandbox session**: `context/memory/{YYYY-MM-DD}_{session-name}.md`
43 - Example: `context/memory/2026-03-21_ux-study-test.md`
44 - This keeps sandbox memory separate from main — no merge conflicts
457. For **full history context** in a sandbox, read from `.context-main/memory/` (read-only mount of main's context)
468. Update the session section with:
47 - **Goal**: What the user wanted to accomplish
48 - **Work Done**: Bullet points of what was accomplished
49 - **Decisions**: Key decisions made and why
50 - **Learnings**: Things discovered about the codebase, tools, or patterns
51 - **Open Items**: Unfinished work, blockers, things to pick up next
52
53## Step 4: Documentation Check (if workflow-enabled)
54
559. Read `workflow.json` to check if this is a workflow-enabled project
5610. If yes, review the session for documentation gaps:
57
58 **Decisions → ADRs:**
59 - Were any architectural or technical decisions made this session?
60 - If yes, does an ADR already exist for this decision?
61 - If no ADR exists, suggest: "Decision about [topic] — want me to create an ADR?"
62
63 **New features → PRDs/Design Docs:**
64 - Was a new feature discussed or started?
65 - Does it have a PRD or design doc?
66 - If not, suggest: "New feature [name] — want a PRD or design doc?"
67
68 **Architecture changes → C4 Diagrams:**
69 - Were new components, services, or integrations added?
70 - Do the C4 diagrams in the docs repo reflect these changes?
71 - If not, suggest: "Architecture changed — C4 diagrams may need updating"
72
73 **Incidents → Post-Mortems:**
74 - Was a production incident investigated or resolved?
75 - If yes, suggest a post-mortem
76
77 **Research → Spike Reports:**
78 - Was research or option comparison done?
79 - If yes, suggest capturing it as a spike report
80
81Present documentation suggestions as a checklist — the user picks what to do:
82```
83### Documentation Suggestions
84- [ ] Create ADR for [decision about X]
85- [ ] Update C4 container diagram (new service added)
86- [ ] Create spike report for [research topic]
87```
88
89## Step 5: Distill to Long-Term Memory
90
9110. Review today's session notes. Ask yourself:
92 - Any lessons learned that future-me should know?
93 - Any decisions that affect how we work going forward?
94 - Any user preferences discovered?
9511. If yes, update `context/MEMORY.md` with the distilled insight
9612. If any context files (SOUL.md, USER.md) should be updated based on
97 what you learned, suggest the changes to the user
98
99## Step 6: Collect Feedback (Optional)
100
10113. Ask the user briefly:
102 - "Anything I should do differently next time?"
103 - "Any preferences to remember?"
10414. If they provide feedback, update the relevant context file
105
106## Step 7: Commit (If Requested)
107
10815. Only if the user asks to commit:
109 - Stage relevant files
110 - Draft a clean commit message (no AI mentions, no Co-Authored-By)
111 - Show the message for approval before committing
112 - If changes span multiple repos (project + docs), handle each repo separately
113
114## Step 8: Cost Summary
115
11616. Check if `~/.claude/metrics/costs.jsonl` exists. If it does, calculate today's total spend:
117 ```bash
118 jq -s '[.[] | select(.timestamp | startswith("'"$(date -u +%Y-%m-%d)"'"))] | {total_eur: (map(.estimated_cost_eur) | add), input_tokens: (map(.input_tokens) | add), output_tokens: (map(.output_tokens) | add), responses: length}' ~/.claude/metrics/costs.jsonl
119 ```
12017. Present the cost summary to the user:
121 ```
122 ### Today's Usage
123 - Responses: N
124 - Tokens: Xk input / Yk output
125 - Estimated cost: €X.XX
126 ```
127
128## Step 9: Summary
129
13018. Present a brief session summary:
131 - What was accomplished
132 - What's left for next time
133 - Any context files that were updated
134 - Any documentation suggestions that were deferred (so we remember next session)
135 - Today's cost (from step 16)