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

Function recordContextCollapseSnapshot

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

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