MCPcopy Create free account
hub / github.com/WJX20/claude-code / loadMessageLogs

Function loadMessageLogs

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

Source from the content-addressed store, hash-verified

3938 * @returns List of message logs sorted by date
3939 */
3940export async function loadMessageLogs(limit?: number): Promise<LogOption[]> {
3941 const sessionLogs = await fetchLogs(limit)
3942 // fetchLogs returns lite (stat-only) logs — enrich them to get metadata.
3943 // enrichLogs already filters out sidechains, empty sessions, etc.
3944 const { logs: enriched } = await enrichLogs(
3945 sessionLogs,
3946 0,
3947 sessionLogs.length,
3948 )
3949
3950 // enrichLogs returns fresh unshared objects — mutate in place to avoid
3951 // re-spreading every 30-field LogOption just to renumber the index.
3952 const sorted = sortLogs(enriched)
3953 sorted.forEach((log, i) => {
3954 log.value = i
3955 })
3956 return sorted
3957}
3958
3959/**
3960 * 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