Addons Never get recognized

I tried setting up an addon by creating a bootstrap.php in /path/to/cockpit/addons/myAddonName

First I tried an example from another thread for the bootstrap.php

<?php

$app->on('app.layout.contentbefore', function(){

    echo 'Hello world!';
    // Obviously, this was useless. Let's discover the whole structure of cockpit instead:
    echo '<pre>' . print_r($this, true) . '</pre>';

});

this did not work. I then tried it with an even simpler script that only calls die(“Hello World”) which did not work either. I came to the conclusion the addons do not get loaded for some reason.
The internal modules Finder and Updater seem finde but placing my addon in the modules folder did not work either.

Do I need to configure Cockpit in a certain way to be able to use addons.
What is going wrong?

I figured it out. If cockpit is not running in debug mode (on localhost or debug => false in config), then it caches plugins. You need to delete storage/cache/modules.cache.php in order to scan for new plugins