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

Function processAttachment

src/utils/analyzeContext.ts:839–851  ·  view source on GitHub ↗
(
  msg: AttachmentMessage,
  breakdown: MessageBreakdown,
)

Source from the content-addressed store, hash-verified

837}
838
839function processAttachment(
840 msg: AttachmentMessage,
841 breakdown: MessageBreakdown,
842): void {
843 const contentStr = jsonStringify(msg.attachment)
844 const tokens = roughTokenCountEstimation(contentStr)
845 breakdown.attachmentTokens += tokens
846 const attachType = msg.attachment.type || 'unknown'
847 breakdown.attachmentsByType.set(
848 attachType,
849 (breakdown.attachmentsByType.get(attachType) || 0) + tokens,
850 )
851}
852
853async function approximateMessageTokens(
854 messages: Message[],

Callers 1

approximateMessageTokensFunction · 0.85

Calls 4

jsonStringifyFunction · 0.85
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected