MCPcopy Index your code
hub / github.com/claude-code-best/claude-code / clearCommandMemoizationCaches

Function clearCommandMemoizationCaches

src/commands.ts:610–619  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

608 * Use this when dynamic skills are added to invalidate cached command lists.
609 */
610export function clearCommandMemoizationCaches(): void {
611 loadAllCommands.cache?.clear?.()
612 getSkillToolCommands.cache?.clear?.()
613 getSlashCommandToolSkills.cache?.clear?.()
614 // getSkillIndex in skillSearch/localSearch.ts is a separate memoization layer
615 // built ON TOP of getSkillToolCommands/getCommands. Clearing only the inner
616 // caches is a no-op for the outer — lodash memoize returns the cached result
617 // without ever reaching the cleared inners. Must clear it explicitly.
618 clearSkillIndexCache?.()
619}
620
621export function clearCommandsCache(): void {
622 clearCommandMemoizationCaches()

Callers 3

clearCommandsCacheFunction · 0.85
initializeFunction · 0.85
useSkillsChangeFunction · 0.85

Calls 2

clearSkillIndexCacheFunction · 0.85
clearMethod · 0.45

Tested by

no test coverage detected