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

Function getNestedMemoryAttachments

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

2217 * Uses nestedMemoryAttachmentTriggers field from ToolUseContext
2218 */
2219async function getNestedMemoryAttachments(
2220 toolUseContext: ToolUseContext,
2221): Promise<Attachment[]> {
2222 // Check triggers first — getAppState() waits for a React render cycle,
2223 // and the common case is an empty trigger set.
2224 if (
2225 !toolUseContext.nestedMemoryAttachmentTriggers ||
2226 toolUseContext.nestedMemoryAttachmentTriggers.size === 0
2227 ) {
2228 return []
2229 }
2230
2231 const appState = toolUseContext.getAppState()
2232 const attachments: Attachment[] = []
2233
2234 for (const filePath of toolUseContext.nestedMemoryAttachmentTriggers) {
2235 const nestedAttachments = await getNestedMemoryAttachmentsForFile(
2236 filePath,
2237 toolUseContext,
2238 appState,
2239 )
2240 attachments.push(...nestedAttachments)
2241 }
2242
2243 toolUseContext.nestedMemoryAttachmentTriggers.clear()
2244
2245 return attachments
2246}
2247
2248async function getRelevantMemoryAttachments(
2249 input: string,

Callers 1

getAttachmentsFunction · 0.85

Calls 3

pushMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected