Problem
The dealerdirect/phpcodesniffer-composer-installer version 0.4.4 (currently latest version) is probably breaking composer lifecycle.
Here is a link to composer issue: composer/composer#7298 (comment) where the Jordi Boggiano (the author of composer) and I have come to a conclusion that there may be a bug in this package.
Please, read the issue composer/composer#7298, mainly the comment composer/composer#7298 (comment), it contains all the details I was able to collect.
Expected behaviour
The composer update or composer require should not crash in the custom installer implemented by this package while trying to use autoloader that is not yet regenerated and is in a stale state (not updated yet).