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

Function generateContextSuggestions

src/utils/contextSuggestions.ts:31–51  ·  view source on GitHub ↗
(
  data: ContextData,
)

Source from the content-addressed store, hash-verified

29// --
30
31export function generateContextSuggestions(
32 data: ContextData,
33): ContextSuggestion[] {
34 const suggestions: ContextSuggestion[] = []
35
36 checkNearCapacity(data, suggestions)
37 checkLargeToolResults(data, suggestions)
38 checkReadResultBloat(data, suggestions)
39 checkMemoryBloat(data, suggestions)
40 checkAutoCompactDisabled(data, suggestions)
41
42 // Sort: warnings first, then by savings descending
43 suggestions.sort((a, b) => {
44 if (a.severity !== b.severity) {
45 return a.severity === 'warning' ? -1 : 1
46 }
47 return (b.savingsTokens ?? 0) - (a.savingsTokens ?? 0)
48 })
49
50 return suggestions
51}
52
53// --
54

Callers 1

ContextVisualizationFunction · 0.85

Calls 5

checkNearCapacityFunction · 0.85
checkLargeToolResultsFunction · 0.85
checkReadResultBloatFunction · 0.85
checkMemoryBloatFunction · 0.85
checkAutoCompactDisabledFunction · 0.85

Tested by

no test coverage detected