sanitize_json() called `python3` unconditionally, but on ACG Windows boxes
the Microsoft Store python3 alias is disabled and `py` is the launcher
(feedback_python_windows). When `python3` was missing the function silently
returned empty, and the surrounding `result_safe='{"messages":[]}'` default
dropped every unread coord message — no error, no warning, no toast.
Now prefers identity.json's `.python.command` (set during machine onboarding,
matching the pattern other scripts already use), falls back to
`command -v python3 || command -v py || command -v python`, and if no Python
is available falls back to `tr -d '\000-\037'` so jq can still parse — lossy
on real \n/\t in string fields but keeps messages visible instead of dropping
them.
Problem: macOS hostname command returns 'Mikes-MacBook-Air.local' but
coord messages are addressed to 'Mikes-MacBook-Air/claude-main'. Hook
script was querying for wrong session ID, so messages never displayed.
Fix: Strip .local suffix using bash parameter expansion before building
session ID.
Result: Coord messages now display correctly on macOS machines.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The UserPromptSubmit hook requires .claude/current-mode to determine work mode
and gate coordination lock checks. This file is machine-local (gitignored) but
had no initialization logic for fresh clones, causing hooks to fail.
Changes:
- check-messages.sh: Added auto-creation logic with "general" as default
- CLAUDE.md: Documented auto-initialization behavior
- ONBOARDING.md: Added machine-local configuration section
- session-logs/2026-05-19-session.md: Documented investigation and fix
Impact:
- Fixes coordination hooks on all machines
- Prevents first-clone hook failures
- No manual setup required
- Backwards compatible
Resolves: "cood hook seems to be broken on all my machines"
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Hook was querying only to_session=HOSTNAME/claude-main, missing messages
addressed to the short alias (e.g. "howard"). Now reads identity.json for
the alias and queries both, merging results before display.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>