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

Function loadSessionMemoryTemplate

src/services/SessionMemory/prompts.ts:86–104  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

84 * Load custom session memory template from file if it exists
85 */
86export async function loadSessionMemoryTemplate(): Promise<string> {
87 const templatePath = join(
88 getClaudeConfigHomeDir(),
89 'session-memory',
90 'config',
91 'template.md',
92 )
93
94 try {
95 return await readFile(templatePath, { encoding: 'utf-8' })
96 } catch (e: unknown) {
97 const code = getErrnoCode(e)
98 if (code === 'ENOENT') {
99 return DEFAULT_SESSION_MEMORY_TEMPLATE
100 }
101 logError(toError(e))
102 return DEFAULT_SESSION_MEMORY_TEMPLATE
103 }
104}
105
106/**
107 * Load custom session memory prompt from file if it exists

Callers 2

isSessionMemoryEmptyFunction · 0.85
setupSessionMemoryFileFunction · 0.85

Calls 4

readFileFunction · 0.85
getErrnoCodeFunction · 0.85
toErrorFunction · 0.85
logErrorFunction · 0.50

Tested by

no test coverage detected