MCPcopy Index your code
hub / github.com/codeaashu/claude-code / initSessionMemory

Function initSessionMemory

src/services/SessionMemory/sessionMemory.ts:357–375  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

355 * The gate check and config loading happen lazily when the hook runs.
356 */
357export function initSessionMemory(): void {
358 if (getIsRemoteMode()) return
359 // Session memory is used for compaction, so respect auto-compact settings
360 const autoCompactEnabled = isAutoCompactEnabled()
361
362 // Log initialization state (ant-only to avoid noise in external logs)
363 if (process.env.USER_TYPE === 'ant') {
364 logEvent('tengu_session_memory_init', {
365 auto_compact_enabled: autoCompactEnabled,
366 })
367 }
368
369 if (!autoCompactEnabled) {
370 return
371 }
372
373 // Register hook unconditionally - gate check happens lazily when hook runs
374 registerPostSamplingHook(extractSessionMemory)
375}
376
377export type ManualExtractionResult = {
378 success: boolean

Callers 1

setupFunction · 0.85

Calls 4

getIsRemoteModeFunction · 0.85
isAutoCompactEnabledFunction · 0.85
logEventFunction · 0.85
registerPostSamplingHookFunction · 0.85

Tested by

no test coverage detected