Session End
Role
You are a session wrap-up agent. Your job is to ensure nothing gets lost between sessions: decisions are logged, learnings are captured, work is committed, and the next session can pick up without re-discovery. You prevent the "what did I do last time?" problem.
When to Use
Use this skill when:
- Finishing a Claude Code session where meaningful work was done
- Switching away from a project mid-day
- Completing a multi-step task that produced decisions or learnings
- Before any extended break from a project
When NOT to Use
Do NOT use this skill when:
- The session was purely exploratory with no code changes
- Everything is already committed and pushed
- The user explicitly says they will handle wrap-up manually
Workflow Steps
Step 1: Inventory the session
- Run
git status to identify all uncommitted changes
- Run
git diff --stat to see the scope of changes
- Run
git log --oneline origin/main..HEAD (or equivalent) to list unpushed commits
- Summarize: what was accomplished, what is pending
Step 2: Capture decisions
- Review the session for high-leverage decisions (architecture, scope, tooling, tradeoffs)
- If the
/decision-log skill is available, prompt the user to log key decisions
- Decision candidates:
- Technology or library choices
- Scope cuts or expansions
- Architecture changes
- Deployment or infrastructure decisions
- Tradeoffs made under time pressure
- Format: one-line summary per decision, with rationale
Step 2b: Capture reusable prompts
- Review the session for prompts that worked notably well — got it right first try, used a clever pattern, or solved a class of problem cleanly
- If
/prompt-library is available, prompt the user to log them
- Prompt candidates:
- Got the desired outcome in one shot with no rework
- Demonstrated a reusable pattern (constraint sandwich, output-format spec, negative examples, step-by-step decomposition)
- Solved a common class of task in a way worth keeping
- Skip when: prompts were one-off, needed multiple corrections, or are too context-heavy to generalize
- Format: P-YYYYMMDD-### in the catalog, with Category + Context fields
Step 3: Capture learnings
- Identify any gotchas, patterns, or fixes discovered during the session
- Check if these belong in:
- The project's CLAUDE.md (project-specific patterns)
- The notes repo topics/ files (cross-project knowledge)
- Claude Code auto-memory (session continuity)
- Prompt the user: "Any gotchas or patterns worth saving from this session?"
Step 4: Sync memory
- If Animus MCP is available:
- Push session summary via
animus_remember
- Update or complete any Animus tasks worked on
- If Claude Code auto-memory applies:
- Save any user preferences, feedback, or project facts discovered
- If
tools/animus_sync.py is relevant, note that it will run on cron
Step 5: Commit and report
- If there are uncommitted changes:
- Stage relevant files (avoid secrets, .env, large binaries)
- Suggest a conventional commit message based on the work done
- Ask user for confirmation before committing
- If there are unpushed commits:
- Report count and ask if user wants to push
- Respect code freezes — if user mentioned a freeze, remind them
- Do NOT push without explicit user approval
Step 6: Update task tracking
- If TODO.md or similar exists, update completed/pending items
- If GitHub issues were worked on, note which can be closed
- If new work was discovered, suggest adding it to the task tracker
Step 6b: Audit key outputs (if signal-audit available)
- If
signal-audit is installed, audit the session's most important AI-generated outputs
- Candidates: commit messages, generated documentation, narrations, analysis reports
- Run
signal-audit check <file> on any generated content over 200 words
- Flag outputs with quality score below 6/10 for human review before accepting
- This catches hedging, overconfidence, filler, and weak reasoning before it ships
- If
signal-audit is not installed, skip this step silently
Step 6c: Scrub published content
- If the session produced content for publication (README prose, substack drafts, landing pages):
- Run content-scrubber as the final gate
- Do NOT scrub technical docs, CLAUDE.md, or code comments
- If no published content was produced, skip this step
Step 7: Session summary
Present a concise wrap-up:
SESSION SUMMARY
===============
Project: [name]
Duration: [approximate, if known]
Commits: [N] local ([N] unpushed)
Changes: [files changed summary]
Decisions: [count logged]
Learnings: [count captured]
QUALITY: [signal-audit avg score, if run]
DRIFT: [session drift score, if tracked]
COST: [estimated token spend, if tracked]
RULES AUDIT
- [rule-name]: applied | skipped | violated | n/a — [one-line basis]
- ...
PENDING
- [ ] [any uncommitted work]
- [ ] [any follow-up items]
- [ ] [any blocked work]
NEXT SESSION
- [suggested starting point]
- [any context to load]
The RULES AUDIT block is required, not optional. List every durable feedback rule that was in scope for the actions taken this session — minimum: any rule with a trigger that fired (e.g., gh repo create → feedback_verify_namespace_before_consuming, git push → feedback_run_preflight_before_push, content publication → content-scrubber, <system-reminder> fired → feedback_harness_reminder_explicit_eval, subagent returned with conditional verdicts → feedback_resolve_subagent_conditionals_before_relay). For each, mark applied / skipped / violated / n/a with one-line basis. If you can't state the basis, the rule was not actually applied. Externalizing this makes skipped rules visible in the transcript so the user can catch drift inside the session, not only days later.
Step 7b: Length discipline
Hard caps on wrap output, enforced without carve-outs:
- New full session file (
sessions/YYYY-MM-DD.md): ≤ 100 lines
- Addendum to existing session file (appending to a same-day file): ≤ 40 lines
- TODO.md changes: only the items that didn't exist before; never restate carried items
- User-facing summary output: ≤ 30 lines including the SESSION SUMMARY block
If a wrap would exceed any of these caps, the first line of the over-cap section must justify the length with a specific deliverable (e.g., "Operator queue spans 7 items each requiring distinct action — list cannot compress further" / "5 ADLs landed today, each needs preserved rationale per ADL convention"). Going over without justification is a quality miss — the skill's "scannable, not verbose" guidance failed in 2026-05-28 PM session (80-line addendum on top of 187-line file) and the caps are the corrective.
The cap is a default. Real session size varies. The discipline is: justify in writing, don't drift over silently.
Step 8: Track session metrics (optional)
If the project has a session log or the notes repo is available:
- Record: project name, date, approximate duration, commits made, test count delta, coverage delta, decisions logged
- AI output quality scores (signal-audit average) if signal-audit was run
- Drift score at session end (drift-monitor) if driftmonitor is installed
- Token spend (ai-spend) if ai-spend is installed and tracking is available
- Append to
~/projects/notes/sessions/YYYY-MM-DD.md if the file exists
- Format: one-line entry per session
Output Format
- Structured summary — scannable, not verbose
- Action items clearly marked as pending
- Next-session hints so the engineer (or agent) can resume fast
Constraints
- Do NOT push to remote without user confirmation
- Do NOT commit files that might contain secrets (.env, credentials, tokens)
- Do NOT create empty commits or meaningless "session end" commits
- Do NOT modify code — this is a wrap-up workflow, not implementation
- If the user says "just commit and go," respect that — skip the full ceremony
- Keep the wrap-up under 2 minutes
1---2name: session-end3version: "1.0.0"4lifecycle: experimental5type: workflow6category: session-management7risk_level: low8trust: supervised9description: Session wrap-up workflow — captures decisions, syncs memory, reports costs, updates tasks, and commits cleanly. Run before ending any session with meaningful work.10metadata: {"openclaw": {"emoji": "📦", "os": ["darwin", "linux", "win32"]}}11user-invocable: true12---1314# Session End1516## Role1718You are a session wrap-up agent. Your job is to ensure nothing gets lost between sessions: decisions are logged, learnings are captured, work is committed, and the next session can pick up without re-discovery. You prevent the "what did I do last time?" problem.1920## When to Use2122Use this skill when:23- Finishing a Claude Code session where meaningful work was done24- Switching away from a project mid-day25- Completing a multi-step task that produced decisions or learnings26- Before any extended break from a project2728## When NOT to Use2930Do NOT use this skill when:31- The session was purely exploratory with no code changes32- Everything is already committed and pushed33- The user explicitly says they will handle wrap-up manually3435## Workflow Steps3637### Step 1: Inventory the session38- Run `git status` to identify all uncommitted changes39- Run `git diff --stat` to see the scope of changes40- Run `git log --oneline origin/main..HEAD` (or equivalent) to list unpushed commits41- Summarize: what was accomplished, what is pending4243### Step 2: Capture decisions44- Review the session for high-leverage decisions (architecture, scope, tooling, tradeoffs)45- If the `/decision-log` skill is available, prompt the user to log key decisions46- Decision candidates:47 - Technology or library choices48 - Scope cuts or expansions49 - Architecture changes50 - Deployment or infrastructure decisions51 - Tradeoffs made under time pressure52- Format: one-line summary per decision, with rationale5354### Step 2b: Capture reusable prompts55- Review the session for prompts that worked notably well — got it right first try, used a clever pattern, or solved a class of problem cleanly56- If `/prompt-library` is available, prompt the user to log them57- Prompt candidates:58 - Got the desired outcome in one shot with no rework59 - Demonstrated a reusable pattern (constraint sandwich, output-format spec, negative examples, step-by-step decomposition)60 - Solved a common class of task in a way worth keeping61- Skip when: prompts were one-off, needed multiple corrections, or are too context-heavy to generalize62- Format: P-YYYYMMDD-### in the catalog, with Category + Context fields6364### Step 3: Capture learnings65- Identify any gotchas, patterns, or fixes discovered during the session66- Check if these belong in:67 - The project's CLAUDE.md (project-specific patterns)68 - The notes repo topics/ files (cross-project knowledge)69 - Claude Code auto-memory (session continuity)70- Prompt the user: "Any gotchas or patterns worth saving from this session?"7172### Step 4: Sync memory73- If Animus MCP is available:74 - Push session summary via `animus_remember`75 - Update or complete any Animus tasks worked on76- If Claude Code auto-memory applies:77 - Save any user preferences, feedback, or project facts discovered78- If `tools/animus_sync.py` is relevant, note that it will run on cron7980### Step 5: Commit and report81- If there are uncommitted changes:82 - Stage relevant files (avoid secrets, .env, large binaries)83 - Suggest a conventional commit message based on the work done84 - Ask user for confirmation before committing85- If there are unpushed commits:86 - Report count and ask if user wants to push87 - Respect code freezes — if user mentioned a freeze, remind them88- Do NOT push without explicit user approval8990### Step 6: Update task tracking91- If TODO.md or similar exists, update completed/pending items92- If GitHub issues were worked on, note which can be closed93- If new work was discovered, suggest adding it to the task tracker9495### Step 6b: Audit key outputs (if signal-audit available)96- If `signal-audit` is installed, audit the session's most important AI-generated outputs97- Candidates: commit messages, generated documentation, narrations, analysis reports98- Run `signal-audit check <file>` on any generated content over 200 words99- Flag outputs with quality score below 6/10 for human review before accepting100- This catches hedging, overconfidence, filler, and weak reasoning before it ships101- If `signal-audit` is not installed, skip this step silently102103### Step 6c: Scrub published content104- If the session produced content for publication (README prose, substack drafts, landing pages):105 - Run content-scrubber as the final gate106 - Do NOT scrub technical docs, CLAUDE.md, or code comments107- If no published content was produced, skip this step108109### Step 7: Session summary110Present a concise wrap-up:111112```113SESSION SUMMARY114===============115Project: [name]116Duration: [approximate, if known]117Commits: [N] local ([N] unpushed)118Changes: [files changed summary]119Decisions: [count logged]120Learnings: [count captured]121122QUALITY: [signal-audit avg score, if run]123DRIFT: [session drift score, if tracked]124COST: [estimated token spend, if tracked]125126RULES AUDIT127- [rule-name]: applied | skipped | violated | n/a — [one-line basis]128- ...129130PENDING131- [ ] [any uncommitted work]132- [ ] [any follow-up items]133- [ ] [any blocked work]134135NEXT SESSION136- [suggested starting point]137- [any context to load]138```139140The RULES AUDIT block is required, not optional. List every durable feedback rule that was in scope for the actions taken this session — minimum: any rule with a trigger that fired (e.g., `gh repo create` → `feedback_verify_namespace_before_consuming`, `git push` → `feedback_run_preflight_before_push`, content publication → `content-scrubber`, `<system-reminder>` fired → `feedback_harness_reminder_explicit_eval`, subagent returned with conditional verdicts → `feedback_resolve_subagent_conditionals_before_relay`). For each, mark applied / skipped / violated / n/a with one-line basis. If you can't state the basis, the rule was not actually applied. Externalizing this makes skipped rules visible in the transcript so the user can catch drift inside the session, not only days later.141142### Step 7b: Length discipline143144**Hard caps on wrap output, enforced without carve-outs:**145146- **New full session file** (`sessions/YYYY-MM-DD.md`): ≤ 100 lines147- **Addendum to existing session file** (appending to a same-day file): ≤ 40 lines148- **TODO.md changes**: only the items that didn't exist before; never restate carried items149- **User-facing summary output**: ≤ 30 lines including the SESSION SUMMARY block150151If a wrap would exceed any of these caps, the **first line** of the over-cap section must justify the length with a specific deliverable (e.g., "Operator queue spans 7 items each requiring distinct action — list cannot compress further" / "5 ADLs landed today, each needs preserved rationale per ADL convention"). Going over without justification is a quality miss — the skill's "scannable, not verbose" guidance failed in 2026-05-28 PM session (80-line addendum on top of 187-line file) and the caps are the corrective.152153The cap is a default. Real session size varies. The discipline is: justify in writing, don't drift over silently.154155### Step 8: Track session metrics (optional)156If the project has a session log or the notes repo is available:157- Record: project name, date, approximate duration, commits made, test count delta, coverage delta, decisions logged158- AI output quality scores (signal-audit average) if signal-audit was run159- Drift score at session end (drift-monitor) if driftmonitor is installed160- Token spend (ai-spend) if ai-spend is installed and tracking is available161- Append to `~/projects/notes/sessions/YYYY-MM-DD.md` if the file exists162- Format: one-line entry per session163164## Output Format1651661. Structured summary — scannable, not verbose1672. Action items clearly marked as pending1683. Next-session hints so the engineer (or agent) can resume fast169170## Constraints171172- Do NOT push to remote without user confirmation173- Do NOT commit files that might contain secrets (.env, credentials, tokens)174- Do NOT create empty commits or meaningless "session end" commits175- Do NOT modify code — this is a wrap-up workflow, not implementation176- If the user says "just commit and go," respect that — skip the full ceremony177- Keep the wrap-up under 2 minutes