MCPcopy Index your code
hub / github.com/codeaashu/claude-code / getRelevantTips

Function getRelevantTips

src/services/tips/tipRegistry.ts:668–686  ·  view source on GitHub ↗
(context?: TipContext)

Source from the content-addressed store, hash-verified

666}
667
668export async function getRelevantTips(context?: TipContext): Promise<Tip[]> {
669 const settings = getInitialSettings()
670 const override = settings.spinnerTipsOverride
671 const customTips = getCustomTips()
672
673 // If excludeDefault is true and there are custom tips, skip built-in tips entirely
674 if (override?.excludeDefault && customTips.length > 0) {
675 return customTips
676 }
677
678 // Otherwise, filter built-in tips as before and combine with custom
679 const tips = [...externalTips, ...internalOnlyTips]
680 const isRelevant = await Promise.all(tips.map(_ => _.isRelevant(context)))
681 const filtered = tips
682 .filter((_, index) => isRelevant[index])
683 .filter(_ => getSessionsSinceLastShown(_.id) >= _.cooldownSessions)
684
685 return [...filtered, ...customTips]
686}
687

Callers 2

startDeferredPrefetchesFunction · 0.85
getTipToShowOnSpinnerFunction · 0.85

Calls 3

getInitialSettingsFunction · 0.85
getCustomTipsFunction · 0.85

Tested by

no test coverage detected