write-commands: add some debug helpers.