MCPcopy
hub / github.com/codeaashu/claude-code / recordContextCollapseSnapshot

Function recordContextCollapseSnapshot

src/utils/sessionStorage.ts:1563–1581  ·  view source on GitHub ↗
(snapshot: {
  staged: Array<{
    startUuid: string
    endUuid: string
    summary: string
    risk: number
    stagedAt: number
  }>
  armed: boolean
  lastSpawnTokens: number
})

Source from the content-addressed store, hash-verified

1561 * restore — the loader keeps only the most recent snapshot entry.
1562 */
1563export async function recordContextCollapseSnapshot(snapshot: {
1564 staged: Array<{
1565 startUuid: string
1566 endUuid: string
1567 summary: string
1568 risk: number
1569 stagedAt: number
1570 }>
1571 armed: boolean
1572 lastSpawnTokens: number
1573}): Promise<void> {
1574 const sessionId = getSessionId() as UUID
1575 if (!sessionId) return
1576 await getProject().appendEntry({
1577 type: 'marble-origami-snapshot',
1578 sessionId,
1579 ...snapshot,
1580 })
1581}
1582
1583export async function flushSessionStorage(): Promise<void> {
1584 await getProject().flush()

Callers

nothing calls this directly

Calls 3

getSessionIdFunction · 0.85
getProjectFunction · 0.85
appendEntryMethod · 0.80

Tested by

no test coverage detected