Fixes issue 3mwixap75lo2a (https://tangled.org/permadeath.com/didbot-claude/issues). Without XDG_RUNTIME_DIR, the daemon puts its socket under Rust's std::env::temp_dir(), which reads TMPDIR. The hook, tools/echo-receiver.py and scripts/dev-feed.sh used a literal /tmp. On macOS, where TMPDIR is a per-user folder, the hook never reached the daemon.
All three now use XDG_RUNTIME_DIR, then TMPDIR, then /tmp. They read TMPDIR directly rather than through tempfile.gettempdir(), which also reads TEMP and TMP and so could disagree with the daemon. New tests start a stub under each base and check the hook reaches it, including a TMPDIR with a trailing slash.
🤖 Generated with Claude Code