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

Function getMemoryPath

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

Source from the content-addressed store, hash-verified

1777}
1778
1779export function getMemoryPath(memoryType: MemoryType): string {
1780 const cwd = getOriginalCwd()
1781
1782 switch (memoryType) {
1783 case 'User':
1784 return join(getClaudeConfigHomeDir(), 'CLAUDE.md')
1785 case 'Local':
1786 return join(cwd, 'CLAUDE.local.md')
1787 case 'Project':
1788 return join(cwd, 'CLAUDE.md')
1789 case 'Managed':
1790 return join(getManagedFilePath(), 'CLAUDE.md')
1791 case 'AutoMem':
1792 return getAutoMemEntrypoint()
1793 }
1794 // TeamMem is only a valid MemoryType when feature('TEAMMEM') is true
1795 if (feature('TEAMMEM')) {
1796 return teamMemPaths!.getTeamMemEntrypoint()
1797 }
1798 return '' // unreachable in external builds where TeamMem is not in MemoryType
1799}
1800
1801export function getManagedClaudeRulesDir(): string {
1802 return join(getManagedFilePath(), '.claude', 'rules')

Callers 4

claudemd.tsFile · 0.85

Calls 3

getOriginalCwdFunction · 0.85
getAutoMemEntrypointFunction · 0.85
featureFunction · 0.85

Tested by

no test coverage detected