Plugin Registration Survives Directory Removal (Gotcha)
Observed: goose 1.60.x, 2026-11-20 (found 2026-11-24).
Gotcha
When goose runs in a project that has <project>/.agents/plugins/<name>/,
it records the plugin in the global ~/.config/goose/config.yaml:
plugins:
/tmp/hooktest/.agents/plugins/always-block:
enabled: true
Deleting the plugin directory does not remove this entry. The official
docs describe discovery (~/.agents/plugins/, <project>/.agents/plugins/)
and disabling (disabledPlugins in settings.json), not this persisted map.
Evidence
- A throwaway test plugin
always-block(blocks every shell command containingBLOCKME) was created in/tmp/hooktest, exercised with one headlessgoose runfrom that directory at ~11:07, thenrm -rf /tmp/hooktest. No tool call editedconfig.yaml. config.yaml.bak.pre-kgm-wrapper(11-19 23:13): 0hooktestlines.config.yaml.bak.pre-corp(11-20 11:07:01) and every later copy: 1.- The stale entry stayed
enabled: truefor 4 days. Harmless while the path is missing; if the path is recreated, the plugin loads again in every session.
Teardown for hook / plugin tests
A test’s teardown removes every side effect, not only its files:
- Remove the test directory (
rm -rf /tmp/<test>). - Remove the plugin’s entry from
~/.config/goose/config.yamlplugins:(back up the file first). Check:grep -n '<test path>' ~/.config/goose/config.yamlprints nothing. - Untested option: run the test
goose runwith a throwawayHOMEso the registration lands in a disposable config. Verify before relying on it.