End session - create summary, commit changes with conventional commits
How this command is triggered — by the user, by Claude, or both
Slash command
/sessions-workflow-bundle:session-endhaikuThis command is limited to the following tools:
The summary Claude sees in its command listing — used to decide when to auto-load this command
# /session-end Save session to memory, then commit all changes. ## Context - Working directory: !`pwd` - Changed files: !`git diff --name-status HEAD` - Current branch: !`git branch --show-current 2>/dev/null || echo "main"` - Recent commits: !`git log --format='%s' -5 2>/dev/null || echo "No git history"` --- ## Your Task Execute these steps **in order**: ### Step 1: Write Session Entry to Memory Compute memory dir: 1. Create the directory if it doesn't exist: 2. Infer session topic from the changed files (look at first 3 changed files, infer the main work area). 3. Append ...
Save session to memory, then commit all changes.
pwdgit diff --name-status HEADgit branch --show-current 2>/dev/null || echo "main"git log --format='%s' -5 2>/dev/null || echo "No git history"Execute these steps in order:
Compute memory dir:
~/.claude/projects/$(pwd | sed 's|/|-|g')/memory/
Create the directory if it doesn't exist:
mkdir -p ~/.claude/projects/$(pwd | sed 's|/|-|g')/memory/
Infer session topic from the changed files (look at first 3 changed files, infer the main work area).
Append to sessions.md in the memory dir (create if missing):
## [DATE] - [topic]
**Accomplished**: [2-3 bullets of what was done]
**Decisions**: [key decisions made, or "none"]
**Next**: [1-3 specific next steps]
**Files**: [main files changed]
Keep each entry ≤100 words.
If stable new insights were gained (new patterns, gotchas, architectural decisions): update MEMORY.md in the memory dir. Keep MEMORY.md under 200 lines total.
From the recent commits context:
feat:, fix:, docs:, chore:, refactor:, test:, style:, perf:Use what the repo already uses.
⚠️ IMPORTANT — Atomic Commits
Each commit should represent one logical unit of work. Do NOT commit all changes together if they touch unrelated features or concerns.
Before staging:
git statusgit add [file] to stage specific files, not git add . if changes are mixedConventional commits are required:
type(scope): descriptionfeat, fix, docs, style, refactor, test, chore, perffix(auth): resolve session timeout race conditionfeat(api): add user pagination to endpointsdocs: update README with setup instructionsThis repo uses conventional commits — follow the pattern from recent commits above.
Stage related changes (atomically):
# Option A: Stage specific files for one logical commit
git add [file1] [file2] ...
# Option B: Only use if all changes are one logical unit
git add .
Create commit message in the detected style:
Conventional:
type(scope): subject
- key change 1
- key change 2
- key change 3
Types: feat, fix, docs, style, refactor, test, chore, perf
Informal:
Add session workflow redesigngit commit -m "[message]"
git log --oneline -1
✅ Memory updated: ~/.claude/.../memory/sessions.md
✅ Committed: [hash] [message]
Next session: [next steps from the entry written above]
~/.claude/projects/.../memory/ only✅ Memory updated: ~/.claude/.../memory/sessions.md
ℹ️ No code changes to commit
Next session: [next steps]
✅ Memory updated: ~/.claude/.../memory/sessions.md
⚠️ Not in git repository — memory saved but not committed
⚠️ Could not write to memory dir — check permissions
✅ Committed: [hash] [message]
npx claudepluginhub karchtho/my-claude-marketplace --plugin sessions-workflow-bundle