MCPcopy Index your code
hub / github.com/liuup/claude-code-analysis / materializeSessionFile

Method materializeSessionFile

src/utils/sessionStorage.ts:976–991  ·  view source on GitHub ↗

* Create the session file, write cached startup metadata, and flush * buffered entries. Called on the first user/assistant message.

()

Source from the content-addressed store, hash-verified

974 * buffered entries. Called on the first user/assistant message.
975 */
976 private async materializeSessionFile(): Promise<void> {
977 // Guard here too — reAppendSessionMetadata writes via appendEntryToFile
978 // (not appendEntry) so it would bypass the per-entry persistence check
979 // and create a metadata-only file despite --no-session-persistence.
980 if (this.shouldSkipPersistence()) return
981 this.ensureCurrentSessionFile()
982 // mode/agentSetting are cache-only pre-materialization; write them now.
983 this.reAppendSessionMetadata()
984 if (this.pendingEntries.length > 0) {
985 const buffered = this.pendingEntries
986 this.pendingEntries = []
987 for (const entry of buffered) {
988 await this.appendEntry(entry)
989 }
990 }
991 }
992
993 async insertMessageChain(
994 messages: Transcript,

Callers 1

insertMessageChainMethod · 0.95

Calls 4

shouldSkipPersistenceMethod · 0.95
appendEntryMethod · 0.95

Tested by

no test coverage detected