GITHUB-ISSUES-2026-03-22-session-end-hook.md
GITHUB-ISSUES-2026-03-22-session-end-hook.md
Section titled “GITHUB-ISSUES-2026-03-22-session-end-hook.md”Created: 2026-03-22 Purpose: Create bug issue for SessionEnd hook — documented but never built
Rules for Harley
Section titled “Rules for Harley”- Run
gh label listbefore creating any issues — never create a label that already exists - Run operations one at a time in the order listed
- Confirm each result (URL or success message) before moving to the next
- Do not modify operation content
- Report any failures to operator immediately
- Stop after all operations are complete — no other work
Operations
Section titled “Operations”Operation 1 — Create bug: SessionEnd hook documented but never built
Section titled “Operation 1 — Create bug: SessionEnd hook documented but never built”gh issue create --title "fix: session-end hook documented in README but never built" --label "bug" --body "## Problem
The v0.10.0 README describes automatic session-end behavior:
> When the builder exits, a hook fires that writes everything to ai-sessions/CURRENT-CODE.md
This hook does not exist. Nothing fires automatically when Harley exits. CURRENT-CODE.md is only updated if Harley manually invokes the session-end skill, which she rarely remembers to do.
Claude Code supports a \`SessionEnd\` hook event that fires on exit, sigint, or error. This is the correct mechanism — it was never configured.
## What exists on dev (v0.10.0)
- \`session-start\` skill in \`.claude/skills/\` — works, correct paths- No \`session-end\` skill in repo (was in v0.9.0 templates but removed during cleanup)- No \`SessionEnd\` hook configured in \`.claude/settings.json\`- No slash commands (removed in v0.10.0 cleanup — correct decision)
## What needs to be built
A \`SessionEnd\` hook in \`.claude/settings.json\` that fires automatically when Harley exits and:
1. Ensures all work is committed on the current branch2. Writes \`ai-sessions/CURRENT-CODE.md\` with real session state (branch, work done, open PRs, next steps)3. Writes an immutable log to \`ai-sessions/logs/\` with correct filename format4. Commits both files
## Acceptance criteria
- [ ] \`SessionEnd\` hook configured in \`.claude/settings.json\`- [ ] Hook fires automatically on \`/exit\`, sigint, and error- [ ] \`ai-sessions/CURRENT-CODE.md\` written with real content- [ ] Immutable log written to \`ai-sessions/logs/\`- [ ] Both files committed automatically- [ ] Works for all projects created with \`sc create\`, not just scaffolder
## References
- Claude Code hooks docs: \`SessionEnd\` fires on exit, sigint, or error- README section: 'session continuity' describes the intended behavior- The session-start skill (\`.claude/skills/session-start/\`) is the model for how this should work"