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

Function loadMessageLogs

src/utils/sessionStorage.ts:4047–4064  ·  view source on GitHub ↗
(limit?: number)

Source from the content-addressed store, hash-verified

4045 * @returns List of message logs sorted by date
4046 */
4047export async function loadMessageLogs(limit?: number): Promise<LogOption[]> {
4048 const sessionLogs = await fetchLogs(limit)
4049 // fetchLogs returns lite (stat-only) logs — enrich them to get metadata.
4050 // enrichLogs already filters out sidechains, empty sessions, etc.
4051 const { logs: enriched } = await enrichLogs(
4052 sessionLogs,
4053 0,
4054 sessionLogs.length,
4055 )
4056
4057 // enrichLogs returns fresh unshared objects — mutate in place to avoid
4058 // re-spreading every 30-field LogOption just to renumber the index.
4059 const sorted = sortLogs(enriched)
4060 sorted.forEach((log, i) => {
4061 log.value = i
4062 })
4063 return sorted
4064}
4065
4066/**
4067 * Loads message logs from all project directories.

Callers 3

getLogByIndexFunction · 0.85
getRecentActivityFunction · 0.85

Calls 3

fetchLogsFunction · 0.85
enrichLogsFunction · 0.85
sortLogsFunction · 0.85

Tested by

no test coverage detected