MCPcopy Index your code
hub / github.com/codeaashu/claude-code / getNestedMemoryAttachments

Function getNestedMemoryAttachments

src/utils/attachments.ts:2167–2194  ·  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

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

Callers 1

getAttachmentsFunction · 0.85

Calls 3

pushMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected