MCPcopy Create free account
hub / github.com/WJX20/claude-code / getNestedMemoryAttachments

Function getNestedMemoryAttachments

src/utils/attachments.ts:2168–2195  ·  view source on GitHub ↗

* Processes paths that need nested memory attachments and checks for nested CLAUDE.md files * Uses nestedMemoryAttachmentTriggers field from ToolUseContext

(
  toolUseContext: ToolUseContext,
)

Source from the content-addressed store, hash-verified

2166 * Uses nestedMemoryAttachmentTriggers field from ToolUseContext
2167 */
2168async function getNestedMemoryAttachments(
2169 toolUseContext: ToolUseContext,
2170): Promise<Attachment[]> {
2171 // Check triggers first — getAppState() waits for a React render cycle,
2172 // and the common case is an empty trigger set.
2173 if (
2174 !toolUseContext.nestedMemoryAttachmentTriggers ||
2175 toolUseContext.nestedMemoryAttachmentTriggers.size === 0
2176 ) {
2177 return []
2178 }
2179
2180 const appState = toolUseContext.getAppState()
2181 const attachments: Attachment[] = []
2182
2183 for (const filePath of toolUseContext.nestedMemoryAttachmentTriggers) {
2184 const nestedAttachments = await getNestedMemoryAttachmentsForFile(
2185 filePath,
2186 toolUseContext,
2187 appState,
2188 )
2189 attachments.push(...nestedAttachments)
2190 }
2191
2192 toolUseContext.nestedMemoryAttachmentTriggers.clear()
2193
2194 return attachments
2195}
2196
2197async function getRelevantMemoryAttachments(
2198 input: string,

Callers 1

getAttachmentsFunction · 0.85

Calls 2

clearMethod · 0.45

Tested by

no test coverage detected