MCPcopy Create free account
hub / github.com/freecodexyz/free-code / getMemoryPath

Function getMemoryPath

src/utils/config.ts:1799–1819  ·  view source on GitHub ↗
(memoryType: MemoryType)

Source from the content-addressed store, hash-verified

1797}
1798
1799export function getMemoryPath(memoryType: MemoryType): string {
1800 const cwd = getOriginalCwd()
1801
1802 switch (memoryType) {
1803 case 'User':
1804 return join(getClaudeConfigHomeDir(), 'CLAUDE.md')
1805 case 'Local':
1806 return join(cwd, 'CLAUDE.local.md')
1807 case 'Project':
1808 return join(cwd, 'CLAUDE.md')
1809 case 'Managed':
1810 return join(getManagedFilePath(), 'CLAUDE.md')
1811 case 'AutoMem':
1812 return getAutoMemEntrypoint()
1813 }
1814 // TeamMem is only a valid MemoryType when feature('TEAMMEM') is true
1815 if (feature('TEAMMEM')) {
1816 return teamMemPaths!.getTeamMemEntrypoint()
1817 }
1818 return '' // unreachable in external builds where TeamMem is not in MemoryType
1819}
1820
1821export function getManagedClaudeRulesDir(): string {
1822 return join(getManagedFilePath(), '.claude', 'rules')

Callers 4

claudemd.tsFile · 0.85

Calls 2

getOriginalCwdFunction · 0.85
getAutoMemEntrypointFunction · 0.85

Tested by

no test coverage detected