trim_blocks removed the newline after the endif, so the touch and the gate call ran as one command and the ps-fails case never reached the gate. An inline expression keeps the line break. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm