| name | memory-close-session |
| description | This skill should be used at end of session, when wrapping up work, or when the user says 'close session', 'end session', 'session summary', 'sign off'. Writes session summary, enforces inbox aging, evaluates pending promotions, and updates active context. |
Memory Close Session
BETA โ This memory system is in active testing. If you encounter bugs, confusing behavior, or have suggestions, run:
codies-memory feedback "describe what happened" โ your feedback is saved and reviewed.
When To Use
At the end of every work session.
What It Does
- Write session summary with
next_step
- Optionally write a dream (see "Dream at Sign-Off" below)
- Review inbox items older than 7 days
- Enforce 14-day inbox aging rule (promote, compact, or discard stale items)
- Update project active context
- Evaluate pending promotions
- Rebuild warm summaries so the next boot sees updated project summaries and recent episodes
How To Run
AGENT="your-agent-name"
TODAY="$(python - <<'PY'
from datetime import date
print(date.today().isoformat())
PY
)"
codies-memory create session \
--agent "$AGENT" \
--title "Session Summary - $TODAY" \
--short "one-line summary of the session" \
--body "## What Happened\n- [describe what was done]\n\n## Decisions Made\n- [list decisions]\n\n## Next Step\n- [what the next session should pick up]" \
--field mode=implement \
--field next_step="[what to do next]"
codies-memory status --agent "$AGENT"
uv run python -c "
from codies_memory.records import list_records
from codies_memory.promotion import evaluate_for_promotion
from codies_memory.vault import resolve_global_vault, resolve_project_vault
from pathlib import Path
agent = 'your-agent-name'
global_vault = resolve_global_vault(agent)
project_vault = resolve_project_vault(global_vault, Path.cwd())
if project_vault is None:
print(f'No named project vault found for {Path.cwd()}; skipping project promotion evaluation.')
else:
for rtype in ['inbox', 'thread']:
items = list_records(project_vault, rtype, scope='project', status='active')
for item in items:
result = evaluate_for_promotion(item, context={'session_count': 1})
if result['eligible']:
print(f' Promote {rtype}: {item[\"frontmatter\"][\"title\"][:60]}')
"
codies-memory refresh --agent "$AGENT"
Dream at Sign-Off (Optional)
Dreams are subconscious processing โ chaotic, associative, about feeling.
They complement reflections (which are coherent and about meaning). Full
methodology: references/dream-stories-guide.md in this skill.
The test: Does something need processing, or did everything already
process naturally through the work itself? Dream when the session was
emotionally resonant, something feels unresolved, or words feel inadequate.
Skip when it was clean craftsmanship with nothing tangled โ and note the
skip reason in the session summary (one line).
STYLE="$(printf '%05d' "$(shuf -i 0-99999 -n 1)")"
echo "$STYLE"
codies-memory create dream \
--agent "$AGENT" \
--title "Dream - $TODAY - Style $STYLE" \
--body-file /tmp/dream.md
Session Summary Fields
Every session record should include:
mode โ what kind of work (implement, debug, plan, research)
next_step โ what the next session should pick up
artifacts โ files created or modified
write_gate_summary โ what was allowed, held, discarded
Use --short for the one-line daily-log entry. If omitted, the session title is
used. Do not write the daily log manually; create session does it.
Recent Episode Constraint
The warm recent-episodes.md artifact is intentionally brief.
- it only keeps the latest 5 sessions
- each entry stores the session date, title, a short excerpt, and the
next_step
- the excerpt is capped at a short single-paragraph summary (currently max 400 chars)
So the session summary should still be rich and useful on disk, but do not expect the
warm recent-episode view to preserve a long narrative. It is a routing aid for boot,
not a second full session log.