docs(session-handoff): pwsh/powershell choice + restart-after-edit caveat [v0.3.2]

Two findings from live-hook e2e smoke 2026-05-25 on this Windows machine:

(1) README snippet was pwsh-only — PS 7 Core isn't on stock Windows. PS 5.1
(`powershell`) is always present and the hook script runs cleanly under both.
README now leads with `powershell` and notes the `pwsh` swap for PS 7+ users.

(2) Missing caveat that hooks load at Claude Code session start — mid-session
edits to ~/.claude/settings.json don't activate the hook until CC restart.
Without this note user would think the hook is broken after applying the
snippet (standalone smoke would pass but live in-session wouldn't fire).
Added explicit restart instruction + verification recipe.

Also: dist/session-handoff.skill now tracked (was missing since promotion —
inconsistent with other dist/*.skill artifacts that ship in repo).

PATCH bump 0.3.1 → 0.3.2 (docs-only, no behavioral change in hook or skill).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-25 00:24:23 +03:00
parent e5839bd072
commit 790f1f41b8
3 changed files with 7 additions and 3 deletions

BIN
dist/session-handoff.skill vendored Normal file

Binary file not shown.

View File

@@ -1,6 +1,6 @@
--- ---
name: session-handoff name: session-handoff
version: 0.3.1 version: 0.3.2
description: "Sliding handoff between CC sessions via .tasks/NEXT_SESSION.md. Read on session start: orient agent, ask user before action. Write on session-end phrase or substantive commit. Session-end phrases: «завершаем сессию», «сворачиваемся», «закругляемся», «wrap up session», «end session», «we're done for now». Trigger-line in CLAUDE.md: `session handoff: read on start, write on end`. Skip task-zone phrases: «закрываем эту таску», «pause», «отбой», «разбегаемся»." description: "Sliding handoff between CC sessions via .tasks/NEXT_SESSION.md. Read on session start: orient agent, ask user before action. Write on session-end phrase or substantive commit. Session-end phrases: «завершаем сессию», «сворачиваемся», «закругляемся», «wrap up session», «end session», «we're done for now». Trigger-line in CLAUDE.md: `session handoff: read on start, write on end`. Skip task-zone phrases: «закрываем эту таску», «pause», «отбой», «разбегаемся»."
--- ---

View File

@@ -8,7 +8,7 @@ Opt-in PostToolUse hook that detects substantive `git commit` invocations and si
## Enable on Windows (PowerShell) ## Enable on Windows (PowerShell)
Add to `~/.claude/settings.json`: Add to `~/.claude/settings.json`. Use `powershell` for stock Windows (PS 5.1, always present); use `pwsh` if you have PowerShell 7+ installed. The hook script runs cleanly under both.
```jsonc ```jsonc
{ {
@@ -19,7 +19,7 @@ Add to `~/.claude/settings.json`:
"hooks": [ "hooks": [
{ {
"type": "command", "type": "command",
"command": "pwsh -NoProfile -ExecutionPolicy Bypass -File \"$env:USERPROFILE\\.claude\\skills\\session-handoff\\hooks\\commit-detector.ps1\"" "command": "powershell -NoProfile -ExecutionPolicy Bypass -File \"$env:USERPROFILE\\.claude\\skills\\session-handoff\\hooks\\commit-detector.ps1\""
} }
] ]
} }
@@ -28,8 +28,12 @@ Add to `~/.claude/settings.json`:
} }
``` ```
Swap `powershell` for `pwsh` if you prefer PS 7+. To check which you have: `Get-Command pwsh -ErrorAction SilentlyContinue` (empty → PS 7 not installed → use `powershell`).
If `hooks.PostToolUse` already exists — append the matcher block to the array. Don't overwrite existing entries. If `hooks.PostToolUse` already exists — append the matcher block to the array. Don't overwrite existing entries.
**Restart Claude Code after editing `settings.json`** — hooks are loaded at session start. A running session won't pick up the new hook until it's restarted (close + reopen the CC instance). Verify the hook is active by making a substantive commit and checking for a `Substantive commit detected on ...` system reminder in the next turn.
## Enable on Linux / macOS (bash) ## Enable on Linux / macOS (bash)
```jsonc ```jsonc