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

Function loadSessionFile

src/utils/sessionStorage.ts:3819–3837  ·  view source on GitHub ↗

* Loads all messages, summaries, file history snapshots, and attribution snapshots from a specific session file.

(sessionId: UUID)

Source from the content-addressed store, hash-verified

3817 * Loads all messages, summaries, file history snapshots, and attribution snapshots from a specific session file.
3818 */
3819async function loadSessionFile(sessionId: UUID): Promise<{
3820 messages: Map<UUID, TranscriptMessage>
3821 summaries: Map<UUID, string>
3822 customTitles: Map<UUID, string>
3823 tags: Map<UUID, string>
3824 agentSettings: Map<UUID, string>
3825 worktreeStates: Map<UUID, PersistedWorktreeSession | null>
3826 fileHistorySnapshots: Map<UUID, FileHistorySnapshotMessage>
3827 attributionSnapshots: Map<UUID, AttributionSnapshotMessage>
3828 contentReplacements: Map<UUID, ContentReplacementRecord[]>
3829 contextCollapseCommits: ContextCollapseCommitEntry[]
3830 contextCollapseSnapshot: ContextCollapseSnapshotEntry | undefined
3831}> {
3832 const sessionFile = join(
3833 getSessionProjectDir() ?? getProjectDir(getOriginalCwd()),
3834 `${sessionId}.jsonl`,
3835 )
3836 return loadTranscriptFile(sessionFile)
3837}
3838
3839/**
3840 * Gets message UUIDs for a specific session without loading all sessions.

Callers 2

sessionStorage.tsFile · 0.85
getLastSessionLogFunction · 0.85

Calls 4

getSessionProjectDirFunction · 0.85
getOriginalCwdFunction · 0.85
loadTranscriptFileFunction · 0.85
getProjectDirFunction · 0.70

Tested by

no test coverage detected