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

Function getAgentMemoryDir

src/tools/AgentTool/agentMemory.ts:52–65  ·  view source on GitHub ↗
(
  agentType: string,
  scope: AgentMemoryScope,
)

Source from the content-addressed store, hash-verified

50 * - 'local' scope: see getLocalAgentMemoryDir()
51 */
52export function getAgentMemoryDir(
53 agentType: string,
54 scope: AgentMemoryScope,
55): string {
56 const dirName = sanitizeAgentTypeForPath(agentType)
57 switch (scope) {
58 case 'project':
59 return join(getCwd(), '.claude', 'agent-memory', dirName) + sep
60 case 'local':
61 return getLocalAgentMemoryDir(dirName)
62 case 'user':
63 return join(getMemoryBaseDir(), 'agent-memory', dirName) + sep
64 }
65}
66
67// Check if file is within an agent memory directory (any scope).
68export function isAgentMemoryPath(absolutePath: string): boolean {

Callers 9

getAgentMemoryEntrypointFunction · 0.85
loadAgentMemoryPromptFunction · 0.85
getSyncedJsonPathFunction · 0.85
copySnapshotToLocalFunction · 0.85
saveSyncedMetaFunction · 0.85
checkAgentMemorySnapshotFunction · 0.85
replaceFromSnapshotFunction · 0.85
MemoryFileSelectorFunction · 0.85

Calls 4

sanitizeAgentTypeForPathFunction · 0.85
getCwdFunction · 0.85
getLocalAgentMemoryDirFunction · 0.85
getMemoryBaseDirFunction · 0.85

Tested by

no test coverage detected