Records session facts (git log, diff --stat, deploys from transcript) by appending to docs/sessions/YYYY-MM-DD.md with a mandatory narrative placeholder. Never touches backlog.md or CLAUDE.md without explicit instruction. Commits only the session file. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1.8 KiB
1.8 KiB
| name | description |
|---|---|
| save-session | Save and record the current work session to docs/sessions/. Trigger ONLY on explicit "save session", "zapisz sesję", or "wrap up" — never invoke proactively between tasks. |
Trigger condition: user explicitly says "save session", "zapisz sesję", "wrap up", or equivalent. Never invoke proactively. Never invoke mid-task.
1. Determine Session Boundary
- Read the latest entry file in
docs/sessions/— use its last## Session HH:MMheading timestamp as the start boundary. - Fallback if no previous entry exists: 24 hours ago.
2. Collect Facts (deterministic only — no invention)
Run exactly:
# All commits since boundary
git --no-pager log --oneline <boundary>..HEAD
# Changed file summary
git --no-pager diff --stat <boundary>..HEAD
From the visible conversation transcript: deploys run and their outcomes, test results seen.
3. Write the Session Entry
APPEND to docs/sessions/YYYY-MM-DD.md (create the file if it doesn't exist for today).
Never overwrite existing content.
## Session HH:MM
### Commits
<output of git log --oneline>
### Files changed
<output of git diff --stat>
### Deploys
<list from transcript, or "None recorded">
### Narrative
> _user-provided summary_
The > _user-provided summary_ placeholder is mandatory. Never fill it in. The user supplies the narrative separately if desired.
4. What NOT to Touch
backlog.md— only on explicit "update backlog" instructionCLAUDE.md— only on explicit "update CLAUDE.md" instruction- Any other file not listed above
5. Commit
Stage and commit only the session file:
git add docs/sessions/YYYY-MM-DD.md
git commit -m "docs: session YYYY-MM-DD HH:MM"
No other files. No git add -A.