| name | end-session |
| description | End-of-day session wrap-up. Runs housekeeping, pushes branches, runs tests, refreshes STATE, offers autonomous session. |
| disable-model-invocation | false |
| user-invocable | true |
End session — day wrap-up
Run when the user ends a work session ("done for today", "let's stop", "wrap up").
Steps
-
Skip-housework check: if $(git rev-parse --git-common-dir)/celebrate-last-sha exists and git log $(cat $(git rev-parse --git-common-dir)/celebrate-last-sha)..HEAD --oneline is empty, skip steps 1–2 and 11 (nothing new since last celebrate).
-
Housekeeping — run /housekeeping (git sync, healthcheck, eager fix-now repairs, ticket creation).
-
Reflect on the session — summarize work done. git log --since="6am" --oneline as starting point.
-
Log session metrics — run ~/.claude/skills/end-session/log-agent-metrics with: <session_id> session <total_tokens> <tool_uses> <duration_ms> <model> <project>. Estimate tokens from conversation length if exact count unavailable.
-
Push all branches — no local-only work overnight. git branch → ensure each non-main branch is pushed to origin.
-
Commit WIP if needed — uncommitted work gets wip: prefix, committed to the current branch, and pushed.
-
Handoff notes — for in-progress tickets with unpushed context, add a comment to the ticket: what's done, what's next, blockers.
-
Exit worktree — if in a worktree:
a. Preflight from inside the worktree: scripts/worktree-exit-preflight.sh (refuses on any uncommitted/untracked state; closes the ExitWorktree gap, ticket 0174). If it blocks, finish step 5/6 (commit WIP, handoff notes) and re-run.
b. Call ExitWorktree to return to the main working tree. All remaining steps run on main.
-
Hygiene sweep:
git worktree list → remove any stale worktrees (git worktree prune)
git branch -a → delete stale remote branches
- Check for orphan tickets and stale merge requests
-
Full test suite — make check on main. New failures → open ticket. Known failures → confirm ticket still open.
-
Refresh STATE.md on a throwaway branch:
a. git checkout -b housekeeping-state-YYYY-MM-DD main
b. Run python3 "$HARNESS_DIR/scripts/refresh-STATE.py" to regenerate ## Status and bump Last updated:. Then hand-edit remaining sections (blockers, next actions, milestones) — no changelog.
c. Prune: delete items checked off before this session.
d. Commit, merge to main via fast-forward, delete branch.
-
Memory consolidation — run /dream <project> where <project> is the current project directory name. This delegates to the autonomous consolidation skill (includes staleness check, dedup, and Park reflection).