Group of 2 Under the hood
Claude Code now detects when plugin hook modules haven't changed and skips rebuilding them
What
The loader that builds plugin function-hooks now compares the incoming set of hook modules against what's already loaded:
- If nothing changed, it short-circuits and logs "hooks modules unchanged, kept as loaded" instead of tearing everything down and rebuilding it.
- If only some modules changed, it logs which ones were kept versus reloaded ("hooks modules kept as loaded, unchanged"), and logs "hooks modules reloaded in full" when a full reload does happen.
- Internally, a new
isSetRecordflag tracks whether the current module set is authoritative. It's cleared before a reload starts and only marked set again once the reload succeeds. A single-module reload path checks for changes via a new plugin-directory watch or an external scan, and clearsisSetRecordwhen a change is found instead of treating the reload as authoritative.
Why
Avoiding unnecessary teardown and rebuild of hook modules when nothing actually changed makes plugin reloads faster and reduces disruption, while the new dirty-flag tracking keeps the loaded state accurate when changes do occur.