Agent skill
wrap-up
End-of-session routine — commit, memory review, self-improvement. Run before closing terminal.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/wrap-up
SKILL.md
Session Wrap-Up
Run three phases in order before ending the session. Auto-apply all changes without asking. Present a consolidated report at the end.
When to run: Before closing terminal, ending a work session, or when you're done for the day. Runs BEFORE the automatic Stop hooks (evaluate-session.sh) fire.
Phase 1: Ship It
1.1 Commit check:
- Run
git status— if uncommitted changes exist:- Stage relevant files (NOT
.env*, credentials, or generated files) - Commit with descriptive message following
<type>: <description>convention - Push to remote
- Stage relevant files (NOT
1.2 File placement check:
- If any files were created this session, verify they follow naming conventions from
.claude/rules/conventions.md - Auto-fix misplaced files (e.g., docs in src/, skills without SKILL.md)
1.3 Task cleanup:
- If beads tasks were worked on:
bd update <id> --append-notes "session wrap-up: <status>" - If task is complete:
bd close <id> - If task has remaining work: note what's left in the update
1.4 Worktree check:
- If the current worktree's feature branch is fully merged, remind user to clean up:
Worktree cleanup available: git worktree remove ~/worktrees/property-tracker/<name>
Phase 2: Remember It
Review what was learned during the session. Use this decision framework:
| Knowledge Type | Destination | Example |
|---|---|---|
| Permanent project convention | CLAUDE.md or .claude/rules/ |
"Always use writeProcedure for mutations" |
| Scoped to specific file types | .claude/rules/<topic>.md with relevant path context |
"Drizzle v0.45 requires .returning()" |
| Pattern Claude discovered | Auto memory (~/.claude/projects/.../memory/) |
"This API returns 403 without User-Agent" |
| Personal/ephemeral context | CLAUDE.local.md (not committed) |
"Currently debugging the billing webhook" |
| Duplicates existing content | Skip — or add @import reference |
Already in anti-patterns.md |
Actions:
- Check if any debugging insights, user corrections, or conventions should persist
- If something belongs in auto memory, update
MEMORY.md(keep under 200 lines) - If a CLAUDE.md rule is needed, add it to the appropriate scoped file
- Staleness check: Scan MEMORY.md for references to PRs, branches, files, or features that may be stale. Look for:
- PR references — check if merged/closed with
gh pr view <num> --json state - Branch references — check if branch still exists with
git branch -a | grep <name> - "IN PROGRESS" items — verify if actually still in progress or completed
- File paths — spot-check 2-3 referenced paths still exist
- Mark stale entries for cleanup or update them
- PR references — check if merged/closed with
- If nothing worth persisting: say "No new learnings to persist"
Phase 3: Review & Apply
Analyze the conversation for self-improvement findings. If the session was short or routine, say "Nothing to improve" and skip to the report.
Focus areas (in priority order):
- Mistakes & near-misses — What went wrong? What took multiple attempts? What did the user have to correct? (Most valuable — don't skip this)
- Friction — Repeated manual steps that should be automatic
- Skill gaps — Things Claude struggled with or got wrong
- Automation candidates — Repetitive patterns that could become skills or hooks
For each finding, auto-apply:
| Finding Type | Action |
|---|---|
| Convention Claude didn't know | Add to appropriate .claude/rules/ file |
| Recurring manual step | Note as skill/hook candidate in ~/.claude/projects/.../memory/ |
| Debugging insight | Save to auto memory |
| User preference discovered | Add to auto memory |
Conflict check: Before adding any new rule or instinct, search existing rules and instincts for contradictions. If "always do X" already exists and you're about to add "never do X in context Y", explicitly note the scoping difference.
Report format:
## Wrap-Up Report
### Ship It
- [x] Committed: <commit hash> "<message>"
- [x] Pushed to origin/<branch>
- [ ] No beads tasks active
### Remember It
- [x] Added "<insight>" to auto memory
- [ ] No CLAUDE.md updates needed
### Review & Apply
Applied:
1. ✅ Near-miss: <description> → [destination] Added <what>
2. ✅ Friction: <description> → [destination] Added <what>
No action needed:
3. Already documented in anti-patterns.md
### Session Stats
- Duration: ~Xh
- Files modified: N
- Commits: M
Important Notes
- This skill runs BEFORE the Stop hook. The Stop hook (
evaluate-session.sh) will separately extract instincts from tool usage — that's complementary, not duplicative. - Do NOT auto-commit to main/develop. Only commit to the current feature branch.
- If there are failing tests, do NOT wrap up — fix tests first or note them as blockers.
- Keep the report concise. The value is in the actions taken, not the report itself.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?