Commit Graph

3 Commits

Author SHA1 Message Date
29d5e9ffa8 fix(session-inbox-monitor): force UTF-8 on Stop-hook delivery + writer guide v0.2.1
Closes session-inbox-monitor-stophook-utf8-fix. Cyrillic message bodies arrived
as mojibake when force-delivered via the Stop-hook block reason.

Root cause: ~/.claude/hooks/stop-dispatcher.ps1 reads bodies with -Encoding UTF8
(fine) but did NOT set [Console]::OutputEncoding, so ConvertTo-Json to stdout
under a harness-spawned redirected pipe (WinPS 5.1) emitted in OEM cp866.

Fix applied to the machine-local hook (not in git): set
[Console]::OutputEncoding/$OutputEncoding = UTF8 at the top. In-situ RED->GREEN
verified through the real Stop-hook path: a Cyrillic pangram that previously came
back as mojibake now delivers clean; no-loop holds.

Repo changes: SKILL.md Failure modes documents the encoding contract for inbox
writers (no-BOM UTF-8 LF; WriteAllText, not Set-Content -Encoding utf8 which BOMs
under 5.1); bump 0.2.0 -> 0.2.1 PATCH. stop-dispatcher.ps1 multi-machine
propagation is the workshop setup's concern (notified).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 11:06:00 +03:00
c3e1ce7b40 feat(session-inbox-monitor): SessionStart hook + fill SKILL body v0.2.0
Core content task of the session-inbox-monitor line. Two deliverables:

1. SessionStart hook `skills/session-inbox-monitor/hooks/inbox-monitor.ps1`
   (versioned for multi-machine rollout; deployed to ~/.claude/hooks/ and
   registered in ~/.claude/settings.json SessionStart):
   - sweep: Get-CimInstance | Stop-Process orphaned monitors of THIS inbox,
     matched by sentinel CLAUDE_INBOX_MONITOR + inbox path (a /clear leaves
     the poll process alive -> re-raise without sweep stacks duplicates);
   - inject: hookSpecificOutput.additionalContext with the exact persistent
     Monitor command (Monitor tool, not background Bash);
   - opt-in gate: fires only on .claude-inbox/ dir or CLAUDE.md trigger line.
   ASCII-only (em-dash -> mojibake under WinPS 5.1 without BOM, fixed).

2. SKILL.md body filled (When to use / Inputs / Steps / Deployment /
   Failure modes / Side effects / What NOT to do); bump 0.1.0 -> 0.2.0 MINOR.

Headless: no hook-level signal exists (verified via claude-code-guide) ->
agent-side best-effort skip, default errs toward raising (false-skip in
interactive loses the feature; false-raise in headless is a harmless no-op).

Live-verified: inject -> valid JSON; sweep -> killed a planted orphan (PASS);
real Monitor tool spawns a bash process carrying the sentinel (sweep will
find real orphans); settings.json stays valid. Sweep over-match edge and
multi-session-per-project limit documented honestly in Failure modes.

Closes [session-inbox-monitor-sessionstart-hook].

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 10:48:50 +03:00
cf08fdeea7 feat(skills): add session-inbox-monitor v0.1.0 (promoted from .workshop/.brainstorm/session-inbox-monitor.md) 2026-06-17 10:28:47 +03:00