MCPcopy
hub / github.com/claude-code-best/claude-code / cachePluginSettings

Function cachePluginSettings

src/utils/plugins/pluginLoader.ts:3284–3298  ·  view source on GitHub ↗
(plugins: LoadedPlugin[])

Source from the content-addressed store, hash-verified

3282 * Called after loadAllPlugins resolves.
3283 */
3284export function cachePluginSettings(plugins: LoadedPlugin[]): void {
3285 const settings = mergePluginSettings(plugins)
3286 setPluginSettingsBase(settings)
3287 // Only bust the session settings cache if there are actually plugin settings
3288 // to merge. In the common case (no plugins, or plugins without settings) the
3289 // base layer is empty and loadSettingsFromDisk would produce the same result
3290 // anyway — resetting here would waste ~17ms on startup re-reading and
3291 // re-validating every settings file on the next getSettingsWithErrors() call.
3292 if (settings && Object.keys(settings).length > 0) {
3293 resetSettingsCache()
3294 logForDebugging(
3295 `Cached plugin settings with keys: ${Object.keys(settings).join(', ')}`,
3296 )
3297 }
3298}
3299
3300/**
3301 * Type predicate: check if a value is a non-null, non-array object (i.e., a record).

Callers 1

assemblePluginLoadResultFunction · 0.85

Calls 5

mergePluginSettingsFunction · 0.85
setPluginSettingsBaseFunction · 0.85
resetSettingsCacheFunction · 0.85
keysMethod · 0.65
logForDebuggingFunction · 0.50

Tested by

no test coverage detected