{"version":"2.0.36","anchor":"enhanced-plugin-hook-loading","canonical_anchor":"enhanced-plugin-hook-loading","heading":"Enhanced Plugin Hook Loading","tier":null,"area":null,"scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.0.36\/e\/enhanced-plugin-hook-loading","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.0.36","markdown":"### Enhanced Plugin Hook Loading\n\n**What:** Plugin loading now detects and prevents duplicate hook file loading **How it works:**\n\n- Uses `realpathSync()` to resolve canonical file paths (at line 275643 in `BwQ()`)\n- Tracks loaded hook files in a Set to detect duplicates\n- In strict mode (default), duplicate hooks trigger errors with helpful messages\n- Automatically loads `hooks\/hooks.json` if it exists, so manifest shouldn't reference it\n\n**Details:**\n\n- New 5th parameter added to plugin loading function `BwQ(A, B, Q, I, G = !0)` where `G` controls strict mode (function signature at line 275505)\n- Strict mode enabled by default but can be disabled via marketplace entry's `strict: false` property (call site at line 275831)\n- Enhanced logging: \"Loaded hooks from standard location for plugin...\" (at line 275647)\n- Error message explains the issue: \"The standard hooks\/hooks.json is loaded automatically, so manifest.hooks should only reference additional hook files\" (at lines 275696-275697)\n- Prevents common plugin authoring mistakes and duplicate hook registrations\n- **Evidence**: Function `BwQ() at line 275505`, duplicate detection at `lines 275689-275707`, Set tracking at `line 275637`"}