MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / logContainsQuery

Function logContainsQuery

source code/utils/agenticSessionSearch.ts:115–142  ·  view source on GitHub ↗

* Checks if a log contains the query term in any searchable field.

(log: LogOption, queryLower: string)

Source from the content-addressed store, hash-verified

113 * Checks if a log contains the query term in any searchable field.
114 */
115function logContainsQuery(log: LogOption, queryLower: string): boolean {
116 // Check title
117 const title = getLogDisplayTitle(log).toLowerCase()
118 if (title.includes(queryLower)) return true
119
120 // Check custom title
121 if (log.customTitle?.toLowerCase().includes(queryLower)) return true
122
123 // Check tag
124 if (log.tag?.toLowerCase().includes(queryLower)) return true
125
126 // Check branch
127 if (log.gitBranch?.toLowerCase().includes(queryLower)) return true
128
129 // Check summary
130 if (log.summary?.toLowerCase().includes(queryLower)) return true
131
132 // Check first prompt
133 if (log.firstPrompt?.toLowerCase().includes(queryLower)) return true
134
135 // Check transcript (more expensive, do last)
136 if (log.messages && log.messages.length > 0) {
137 const transcript = extractTranscript(log.messages).toLowerCase()
138 if (transcript.includes(queryLower)) return true
139 }
140
141 return false
142}
143
144/**
145 * Performs an agentic search using Claude to find relevant sessions

Callers 1

agenticSessionSearchFunction · 0.85

Calls 2

getLogDisplayTitleFunction · 0.85
extractTranscriptFunction · 0.85

Tested by

no test coverage detected