MCPcopy Index your code
hub / github.com/claude-code-best/claude-code / initCacheStatsState

Function initCacheStatsState

src/utils/cacheStatsState.ts:38–48  ·  view source on GitHub ↗
(sid: string)

Source from the content-addressed store, hash-verified

36 * to persist to and can pre-load the last known state.
37 */
38export async function initCacheStatsState(sid: string): Promise<void> {
39 sessionId = sid
40 const filePath = getStateFilePath(sid)
41 const persisted = await readState(filePath)
42 // Pre-load persisted values so the UI can show fallback immediately
43 memState = {
44 signature: persisted.signature,
45 lastResetAt: persisted.lastResetAt,
46 lastHitRate: persisted.lastHitRate,
47 }
48}
49
50/**
51 * Called whenever a new assistant response is received with usage data.

Callers 2

CachePillFunction · 0.85
cacheStats.test.tsFile · 0.85

Calls 2

getStateFilePathFunction · 0.85
readStateFunction · 0.85

Tested by

no test coverage detected