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

Function getNestedMemoryAttachments

source code/utils/attachments.ts:2169–2196  ·  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

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

Callers 1

getAttachmentsFunction · 0.85

Calls 2

clearMethod · 0.45

Tested by

no test coverage detected