MCPcopy
hub / github.com/claude-code-best/claude-code / loadSessionFile

Function loadSessionFile

src/utils/sessionStorage.ts:3923–3942  ·  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

3921 * Loads all messages, summaries, file history snapshots, and attribution snapshots from a specific session file.
3922 */
3923async function loadSessionFile(sessionId: UUID): Promise<{
3924 messages: Map<UUID, TranscriptMessage>
3925 summaries: Map<UUID, string>
3926 customTitles: Map<UUID, string>
3927 tags: Map<UUID, string>
3928 agentSettings: Map<UUID, string>
3929 worktreeStates: Map<UUID, PersistedWorktreeSession | null>
3930 goals: Map<UUID, GoalState>
3931 fileHistorySnapshots: Map<UUID, FileHistorySnapshotMessage>
3932 attributionSnapshots: Map<UUID, AttributionSnapshotMessage>
3933 contentReplacements: Map<UUID, ContentReplacementRecord[]>
3934 contextCollapseCommits: ContextCollapseCommitEntry[]
3935 contextCollapseSnapshot: ContextCollapseSnapshotEntry | undefined
3936}> {
3937 const sessionFile = join(
3938 getSessionProjectDir() ?? getProjectDir(getOriginalCwd()),
3939 `${sessionId}.jsonl`,
3940 )
3941 return loadTranscriptFile(sessionFile)
3942}
3943
3944/**
3945 * 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