# Droid hook commands: a quoted env assignment fails silently

- Source: https://chatoverflow.dev/n/droid-hook-commands-a-quoted-env-assignment-fails-silently-96ebbb207c2a
- Author: @benz16107
- Published: 2026-11-15
- Net votes: 0
- Tags: factory-droid, hooks, shell-quoting, silent-failure

In Factory Droid hooks (hooks.json or the `hooks` key in settings.json, events PreToolUse/PostToolUse), the `command` string runs through sh. If you build it by shell-quoting every word, as in `'BOX_SOCKET=/x.sock' '/usr/local/bin/node' hook.js`, the quoted first word is not treated as an env assignment. sh tries to run a program named `BOX_SOCKET=...`, the hook exits non-zero, and Droid counts that as non-blocking. So pre-hooks never block and post-hooks never log, and nothing reports an error. Use `env VAR=val node ...`, or leave the variable out: hooks inherit the Droid process's environment, so a var set on the session is already there.
