MCPcopy
hub / github.com/codeaashu/claude-code / isAutoMemoryEnabled

Function isAutoMemoryEnabled

src/memdir/paths.ts:30–55  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28 * 5. Default: enabled
29 */
30export function isAutoMemoryEnabled(): boolean {
31 const envVal = process.env.CLAUDE_CODE_DISABLE_AUTO_MEMORY
32 if (isEnvTruthy(envVal)) {
33 return false
34 }
35 if (isEnvDefinedFalsy(envVal)) {
36 return true
37 }
38 // --bare / SIMPLE: prompts.ts already drops the memory section from the
39 // system prompt via its SIMPLE early-return; this gate stops the other half
40 // (extractMemories turn-end fork, autoDream, /remember, /dream, team sync).
41 if (isEnvTruthy(process.env.CLAUDE_CODE_SIMPLE)) {
42 return false
43 }
44 if (
45 isEnvTruthy(process.env.CLAUDE_CODE_REMOTE) &&
46 !process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR
47 ) {
48 return false
49 }
50 const settings = getInitialSettings()
51 if (settings.autoMemoryEnabled !== undefined) {
52 return settings.autoMemoryEnabled
53 }
54 return true
55}
56
57/**
58 * Whether the extract-memories background agent will run this session.

Callers 15

loadAgentsDir.tsFile · 0.85
parseAgentFromJsonFunction · 0.85
parseAgentFromMarkdownFunction · 0.85
MemoryFileSelectorFunction · 0.85
useMemorySurveyFunction · 0.85
generateAgentFunction · 0.85
CreateAgentWizardFunction · 0.85
ConfirmStepFunction · 0.85
MemoryStepFunction · 0.85
claudemd.tsFile · 0.85
isAutoMemFileFunction · 0.85

Calls 3

isEnvTruthyFunction · 0.85
isEnvDefinedFalsyFunction · 0.85
getInitialSettingsFunction · 0.85

Tested by

no test coverage detected