You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wrap up session with git commit and temp file cleanup
Wrap Up Session
Help the user cleanly wrap up their current work session.
Steps
1. Update working document log
If the session involved an ost-*.md file or similar planning document with a Log section:
Add a dated entry summarizing what was accomplished
Include key decisions, discoveries, or blockers encountered
Reference any new runbooks or scripts created
Note pending work that follows from this session
This ensures institutional memory beyond just git commits.
2. Check for uncommitted changes
Run git status and git diff --stat to see what's been modified.
3. Draft commit message (if changes exist)
If there are changes to commit:
Summarize WHAT changed
Explain WHY it was done (the motivation, context, trade-offs)
Mention if anything was tried and reverted
Treat the commit message as a journal entry for future developers
Ask the user if they want to commit with the drafted message.
4. Clean up temp files
Look for test artifacts that may have been created:
/tmp/ files related to this session
tmp/ directories within modules
pdf_previews/, test_output/, or similar generated folders
Any files mentioned during the conversation that were for testing
List what you find and ask the user which to clean up.
5. Runbook Opportunity
Runbooks are the default output of any non-trivial session. Ask:
Did we figure out a procedure that's worth documenting?
Were there gotchas or troubleshooting steps we discovered?
Even if one-off, might we need to undo this or do something similar later?
If yes, suggest creating a runbook in the relevant module's runbooks/ directory. A runbook captures:
What we did and why
Step-by-step procedure
Gotchas and troubleshooting
Lessons learned
Example: "We set up Scanner user on PCs - this should be a runbook at windows-control/runbooks/scanner-user-setup.md"
6. Session Pattern Analysis
Review this conversation for automation opportunities. Look for:
Repetitive tool sequences: Did we call the same tools in sequence multiple times? (e.g., Grep → Read → Edit pattern)
Context we had to provide repeatedly: Information the user explained that could be in CLAUDE.md or a skill
Manual lookups: Web searches, file reads, or questions that could be pre-answered by a command
Multi-step workflows: Tasks that required orchestration and could be a single command
Domain knowledge gaps: Things we had to learn mid-session that future sessions shouldn't need to re-learn
For each pattern found, suggest:
Command: A .claude/commands/name.md file for user-invokable shortcuts
Skill: A .claude/skills/name/SKILL.md for AI-matchable capabilities
CLAUDE.md addition: Context that should be permanent
Example output:
Session patterns detected:
1. COMMAND OPPORTUNITY: /ethanol-model
- Pattern: Web search for Panama data → update HTML model → recalculate
- Would save: ~10 tool calls per iteration
2. SKILL OPPORTUNITY: panama-data-lookup
- Pattern: Searched for Panama vehicle fleet, fuel prices, ethanol laws
- Could pre-load common Panama statistics
3. CLAUDE.MD ADDITION:
- Panama's ethanol mandate timeline (E5 2026 → E7 2027 → E10 2028)
- Saves explaining this context in future sessions
7. Further Automation
If a runbook already exists or was just created, check if parts can progress further:
Runbook → Skill: Can AI do this more autonomously? Create a skill in .claude/skills/skill-name/SKILL.md (case-sensitive). See skill format below.
Runbook → Script: Are parts deterministic enough to automate? Extract to scripts/.
Script → Cron/Systemd: Is a script stable enough to run unattended?
8. Summary
Provide a brief summary of what was accomplished in the session.
---
name: skill-namedescription: When to use this skill (Claude uses this for auto-matching)
---
# Skill Title## Instructions[What Claude should do when this skill is invoked]
For skills that live in module directories, use symlinks: