Skip to content

Commit 49d1a20

Browse files
Claudeclaude
authored andcommitted
feat: compact session close ceremony — reflection is internal, not displayed
The 9-question closing reflection is now written directly to the payload file without being displayed to the user. Instead, a 3-line compact summary is shown. This reduces session close time from 3-5 minutes to ~30 seconds. Changes across all 4 client templates (CLAUDE.md, cursorrules, copilot, windsurf): - Reflection questions answered internally, written straight to payload - Compact summary: learnings count, scars applied, threads open - Single "Corrections?" prompt instead of verbose Q&A display - task_completion timestamps preserved for compliance validation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 76a4a7c commit 49d1a20

4 files changed

Lines changed: 124 additions & 68 deletions

File tree

CLAUDE.md.template

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,19 @@ A PreToolUse hook blocks consequential actions until all recalled scars are conf
5151

5252
On "closing", "done for now", or "wrapping up":
5353

54-
1. **Answer these reflection questions** and display to the human:
55-
- What broke that you didn't expect?
56-
- What took longer than it should have?
57-
- What would you do differently next time?
58-
- What pattern or approach worked well?
59-
- What assumption was wrong?
60-
- Which scars did you apply?
61-
- What should be captured as institutional memory?
62-
63-
2. **Ask the human**: "Any corrections or additions?" Wait for their response.
64-
65-
3. **Write payload** to `.gitmem/closing-payload.json`:
54+
1. **Write reflection directly to payload** — do NOT display the full Q&A to the human.
55+
Internally answer these 9 questions and write them straight to `.gitmem/closing-payload.json`:
56+
- Q1: What broke that you didn't expect?
57+
- Q2: What took longer than it should have?
58+
- Q3: What would you do differently next time?
59+
- Q4: What pattern or approach worked well?
60+
- Q5: What assumption was wrong?
61+
- Q6: Which scars did you apply?
62+
- Q7: What should be captured as institutional memory?
63+
- Q8: How did the human prefer to work this session?
64+
- Q9: What collaborative dynamic worked or didn't?
65+
66+
Payload schema (`.gitmem/closing-payload.json`):
6667
```json
6768
{
6869
"closing_reflection": {
@@ -73,15 +74,15 @@ On "closing", "done for now", or "wrapping up":
7374
"wrong_assumption": "...",
7475
"scars_applied": ["scar title 1", "scar title 2"],
7576
"institutional_memory_items": "...",
76-
"collaborative_dynamic": "Q8: How human preferred to work",
77-
"rapport_notes": "Q9: What collaborative dynamic worked"
77+
"collaborative_dynamic": "...",
78+
"rapport_notes": "..."
7879
},
7980
"task_completion": {
80-
"questions_displayed_at": "ISO timestamp",
81-
"reflection_completed_at": "ISO timestamp",
82-
"human_asked_at": "ISO timestamp",
83-
"human_response_at": "ISO timestamp",
84-
"human_response": "human's correction text or 'Looks good'"
81+
"questions_displayed_at": "ISO timestamp (when reflection started)",
82+
"reflection_completed_at": "ISO timestamp (when payload written)",
83+
"human_asked_at": "ISO timestamp (when 'Corrections?' shown)",
84+
"human_response_at": "ISO timestamp (when human replied)",
85+
"human_response": "user's correction text or 'none'"
8586
},
8687
"human_corrections": "",
8788
"scars_to_record": [],
@@ -91,7 +92,15 @@ On "closing", "done for now", or "wrapping up":
9192
}
9293
```
9394

94-
4. **Call `session_close`** with `session_id` and `close_type: "standard"`
95+
2. **Show compact summary** (3-4 lines max):
96+
```
97+
Session close: [N] learnings captured, [M] scars applied, [K] threads open
98+
Key lesson: [one-sentence from Q7]
99+
```
100+
101+
3. **Ask**: "Corrections?" — wait for response, then call `session_close`.
102+
103+
4. **Call `session_close`** with `session_id` and `close_type: "standard"`.
95104

96105
For short exploratory sessions (< 30 min, no real work), use `close_type: "quick"` — no questions needed.
97106
<!-- gitmem:end -->

copilot-instructions.template

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,19 @@ Safe alternatives: `env | grep -c VARNAME` (count only), `[ -n "$VARNAME" ] && e
4646

4747
**End:** On "closing", "done for now", or "wrapping up":
4848

49-
1. **Answer these reflection questions** and display to the human:
50-
- What broke that you didn't expect?
51-
- What took longer than it should have?
52-
- What would you do differently next time?
53-
- What pattern or approach worked well?
54-
- What assumption was wrong?
55-
- Which scars did you apply?
56-
- What should be captured as institutional memory?
57-
58-
2. **Ask the human**: "Any corrections or additions?" Wait for their response.
59-
60-
3. **Write payload** to `.gitmem/closing-payload.json`:
49+
1. **Write reflection directly to payload** — do NOT display the full Q&A to the human.
50+
Internally answer these 9 questions and write them straight to `.gitmem/closing-payload.json`:
51+
- Q1: What broke that you didn't expect?
52+
- Q2: What took longer than it should have?
53+
- Q3: What would you do differently next time?
54+
- Q4: What pattern or approach worked well?
55+
- Q5: What assumption was wrong?
56+
- Q6: Which scars did you apply?
57+
- Q7: What should be captured as institutional memory?
58+
- Q8: How did the human prefer to work this session?
59+
- Q9: What collaborative dynamic worked or didn't?
60+
61+
Payload schema (`.gitmem/closing-payload.json`):
6162
```json
6263
{
6364
"closing_reflection": {
@@ -67,16 +68,34 @@ Safe alternatives: `env | grep -c VARNAME` (count only), `[ -n "$VARNAME" ] && e
6768
"what_worked": "...",
6869
"wrong_assumption": "...",
6970
"scars_applied": ["scar title 1", "scar title 2"],
70-
"institutional_memory_items": "..."
71+
"institutional_memory_items": "...",
72+
"collaborative_dynamic": "...",
73+
"rapport_notes": "..."
74+
},
75+
"task_completion": {
76+
"questions_displayed_at": "ISO timestamp (when reflection started)",
77+
"reflection_completed_at": "ISO timestamp (when payload written)",
78+
"human_asked_at": "ISO timestamp (when 'Corrections?' shown)",
79+
"human_response_at": "ISO timestamp (when human replied)",
80+
"human_response": "user's correction text or 'none'"
7181
},
7282
"human_corrections": "",
7383
"scars_to_record": [],
84+
"learnings_created": [],
7485
"open_threads": [],
7586
"decisions": []
7687
}
7788
```
7889

79-
4. **Call `session_close`** with `session_id` and `close_type: "standard"`
90+
2. **Show compact summary** (3-4 lines max):
91+
```
92+
Session close: [N] learnings captured, [M] scars applied, [K] threads open
93+
Key lesson: [one-sentence from Q7]
94+
```
95+
96+
3. **Ask**: "Corrections?" — wait for response, then call `session_close`.
97+
98+
4. **Call `session_close`** with `session_id` and `close_type: "standard"`.
8099

81100
For short exploratory sessions (< 30 min, no real work), use `close_type: "quick"` — no questions needed.
82101
<!-- gitmem:end -->

cursorrules.template

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,19 @@ Safe alternatives: `env | grep -c VARNAME` (count only), `[ -n "$VARNAME" ] && e
4646

4747
On "closing", "done for now", or "wrapping up":
4848

49-
1. **Answer these reflection questions** and display to the human:
50-
- What broke that you didn't expect?
51-
- What took longer than it should have?
52-
- What would you do differently next time?
53-
- What pattern or approach worked well?
54-
- What assumption was wrong?
55-
- Which scars did you apply?
56-
- What should be captured as institutional memory?
57-
58-
2. **Ask the human**: "Any corrections or additions?" Wait for their response.
59-
60-
3. **Write payload** to `.gitmem/closing-payload.json`:
49+
1. **Write reflection directly to payload** — do NOT display the full Q&A to the human.
50+
Internally answer these 9 questions and write them straight to `.gitmem/closing-payload.json`:
51+
- Q1: What broke that you didn't expect?
52+
- Q2: What took longer than it should have?
53+
- Q3: What would you do differently next time?
54+
- Q4: What pattern or approach worked well?
55+
- Q5: What assumption was wrong?
56+
- Q6: Which scars did you apply?
57+
- Q7: What should be captured as institutional memory?
58+
- Q8: How did the human prefer to work this session?
59+
- Q9: What collaborative dynamic worked or didn't?
60+
61+
Payload schema (`.gitmem/closing-payload.json`):
6162
```json
6263
{
6364
"closing_reflection": {
@@ -68,15 +69,15 @@ On "closing", "done for now", or "wrapping up":
6869
"wrong_assumption": "...",
6970
"scars_applied": ["scar title 1", "scar title 2"],
7071
"institutional_memory_items": "...",
71-
"collaborative_dynamic": "Q8: How human preferred to work",
72-
"rapport_notes": "Q9: What collaborative dynamic worked"
72+
"collaborative_dynamic": "...",
73+
"rapport_notes": "..."
7374
},
7475
"task_completion": {
75-
"questions_displayed_at": "ISO timestamp",
76-
"reflection_completed_at": "ISO timestamp",
77-
"human_asked_at": "ISO timestamp",
78-
"human_response_at": "ISO timestamp",
79-
"human_response": "human's correction text or 'Looks good'"
76+
"questions_displayed_at": "ISO timestamp (when reflection started)",
77+
"reflection_completed_at": "ISO timestamp (when payload written)",
78+
"human_asked_at": "ISO timestamp (when 'Corrections?' shown)",
79+
"human_response_at": "ISO timestamp (when human replied)",
80+
"human_response": "user's correction text or 'none'"
8081
},
8182
"human_corrections": "",
8283
"scars_to_record": [],
@@ -86,7 +87,15 @@ On "closing", "done for now", or "wrapping up":
8687
}
8788
```
8889

89-
4. **Call `session_close`** with `session_id` and `close_type: "standard"`
90+
2. **Show compact summary** (3-4 lines max):
91+
```
92+
Session close: [N] learnings captured, [M] scars applied, [K] threads open
93+
Key lesson: [one-sentence from Q7]
94+
```
95+
96+
3. **Ask**: "Corrections?" — wait for response, then call `session_close`.
97+
98+
4. **Call `session_close`** with `session_id` and `close_type: "standard"`.
9099

91100
For short exploratory sessions (< 30 min, no real work), use `close_type: "quick"` — no questions needed.
92101
# --- gitmem:end ---

windsurfrules.template

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,19 @@ Safe alternatives: `env | grep -c VARNAME` (count only), `[ -n "$VARNAME" ] && e
4646

4747
**End:** On "closing", "done for now", or "wrapping up":
4848

49-
1. **Answer these reflection questions** and display to the human:
50-
- What broke that you didn't expect?
51-
- What took longer than it should have?
52-
- What would you do differently next time?
53-
- What pattern or approach worked well?
54-
- What assumption was wrong?
55-
- Which scars did you apply?
56-
- What should be captured as institutional memory?
57-
58-
2. **Ask the human**: "Any corrections or additions?" Wait for their response.
59-
60-
3. **Write payload** to `.gitmem/closing-payload.json`:
49+
1. **Write reflection directly to payload** — do NOT display the full Q&A to the human.
50+
Internally answer these 9 questions and write them straight to `.gitmem/closing-payload.json`:
51+
- Q1: What broke that you didn't expect?
52+
- Q2: What took longer than it should have?
53+
- Q3: What would you do differently next time?
54+
- Q4: What pattern or approach worked well?
55+
- Q5: What assumption was wrong?
56+
- Q6: Which scars did you apply?
57+
- Q7: What should be captured as institutional memory?
58+
- Q8: How did the human prefer to work this session?
59+
- Q9: What collaborative dynamic worked or didn't?
60+
61+
Payload schema (`.gitmem/closing-payload.json`):
6162
```json
6263
{
6364
"closing_reflection": {
@@ -67,16 +68,34 @@ Safe alternatives: `env | grep -c VARNAME` (count only), `[ -n "$VARNAME" ] && e
6768
"what_worked": "...",
6869
"wrong_assumption": "...",
6970
"scars_applied": ["scar title 1", "scar title 2"],
70-
"institutional_memory_items": "..."
71+
"institutional_memory_items": "...",
72+
"collaborative_dynamic": "...",
73+
"rapport_notes": "..."
74+
},
75+
"task_completion": {
76+
"questions_displayed_at": "ISO timestamp (when reflection started)",
77+
"reflection_completed_at": "ISO timestamp (when payload written)",
78+
"human_asked_at": "ISO timestamp (when 'Corrections?' shown)",
79+
"human_response_at": "ISO timestamp (when human replied)",
80+
"human_response": "user's correction text or 'none'"
7181
},
7282
"human_corrections": "",
7383
"scars_to_record": [],
84+
"learnings_created": [],
7485
"open_threads": [],
7586
"decisions": []
7687
}
7788
```
7889

79-
4. **Call `session_close`** with `session_id` and `close_type: "standard"`
90+
2. **Show compact summary** (3-4 lines max):
91+
```
92+
Session close: [N] learnings captured, [M] scars applied, [K] threads open
93+
Key lesson: [one-sentence from Q7]
94+
```
95+
96+
3. **Ask**: "Corrections?" — wait for response, then call `session_close`.
97+
98+
4. **Call `session_close`** with `session_id` and `close_type: "standard"`.
8099

81100
For short exploratory sessions (< 30 min, no real work), use `close_type: "quick"` — no questions needed.
82101
# --- gitmem:end ---

0 commit comments

Comments
 (0)