v1.19.1 — Bash-heredoc fix for /whatsapp:access and configure writes
Routes WhatsApp's pairing and configuration file writes through a hardened Bash heredoc pattern instead of MCP Write. ClawCode 1.6.0+ refuses file-tool writes to access.json, config.json, approved/<senderId>.json, and recent-groups.json when the channel state-dir resolves to the global fallback ~/.claude/channels/whatsapp/ (the entire ~/.claude/ tree is on its protected-paths list). Before this release, those writes silently failed with exec-gate: write to protected path refused (channel-access-json) or (claude-home) — /whatsapp:access pair <code> and /whatsapp:configure audio both surfaced as "doesn't work" with no diagnostic. Now the skill instructions tell the agent to write via Bash, which is not subject to the file-tool classifier. Independent fix — no schema changes, no cross-plugin coordination needed. Pairs with ClawCode 1.7.1, which routes its own side identically.
Fixes
- Skills/access: all "Save
access.json" instructions (plus theapproved/<senderId>.jsonsave in thepairflow and therecent-groups.jsonrewrite inadd-group) route through a hardened heredoc pattern:rm -f tmp.$$ && umask 077 && cat > tmp.$$ << "JSON_EOF" && JSON.parse validate && chmod 600 && atomic mv || cleanup. Tightening over plain heredoc: pre-clears any stale tmp file (defends against symlink-plant on shared systems); per-invocation$$PID-suffix;umask 077so the freshly-created tmp starts at0o600immediately; explicitchmod 600belt-and-suspenders;JSON.parserejection BEFORE atomicmvso a truncated write can never clobber the existing file. After every save, the skill re-Readsaccess.jsonto surface the rare clobber-by-concurrent-server-write race to the user instead of silently pretending it succeeded. - Skills/configure: same hardened heredoc pattern for every "write it back" instruction (
audio language,audio model,audio quality,audio provider,audio off,chunk-mode,reply-to,ack,document,pair,pair off). - Skills/access + skills/configure:
Writeremoved fromallowed-toolsfront-matter. Even with the explicit "NOT Write" sections in the skill body, leavingWriteauthorized was a footgun if the agent ever forgot the rule. - Docs/search-export: minor wording cleanup.
Compatibility
- No schema changes, no MCP tool signature changes, no inbound notification payload changes. Existing
access.json/config.jsonformats unchanged; the only thing different is the agent's path for writing them. - Standalone claude-whatsapp users (no ClawCode installed): file-tool writes still work as before because there's no protected-paths defense to refuse them. The hardened heredoc pattern is a no-op safety improvement (atomicity + perms + JSON validation) in that case.
Full changelog: CHANGELOG.md.