If you use maintenance/shell.php in production, then a message like the following will appear in Logstash (e. g. on the fatalmonitor board):
[14d509596bbbbff107cdb5e6] [no req] ErrorException from line 228 of /srv/mediawiki/php-1.34.0-wmf.13/vendor/psy/psysh/src/ConfigPaths.php: PHP Notice: Writing to /home/lucaswerkmeister-wmde/.config/psysh is not allowed.
This is because we use sudo to run the PHP script as the www-data user, but the environment isn’t reset, so it still tries to write to the calling user’s home directory, which isn’t writable to www-data.
.config/psysh would mostly be used to store command history, which won't be available because of this issue.
We could use shared configuration and command history for all users, but that's probably unhelpful.