MCPcopy Create free account
hub / github.com/codeaashu/claude-code / loadSessionMemoryPrompt

Function loadSessionMemoryPrompt

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

Source from the content-addressed store, hash-verified

109 * Use {{variableName}} syntax for variable substitution (e.g., {{currentNotes}}, {{notesPath}})
110 */
111export async function loadSessionMemoryPrompt(): Promise<string> {
112 const promptPath = join(
113 getClaudeConfigHomeDir(),
114 'session-memory',
115 'config',
116 'prompt.md',
117 )
118
119 try {
120 return await readFile(promptPath, { encoding: 'utf-8' })
121 } catch (e: unknown) {
122 const code = getErrnoCode(e)
123 if (code === 'ENOENT') {
124 return getDefaultUpdatePrompt()
125 }
126 logError(toError(e))
127 return getDefaultUpdatePrompt()
128 }
129}
130
131/**
132 * Parse the session memory file and analyze section sizes

Callers 1

Calls 5

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

Tested by

no test coverage detected