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

Function shouldSkipMessage

src/utils/collapseReadSearch.ts:407–424  ·  view source on GitHub ↗

* Check if a message should be skipped (not break the group, just passed through). * This includes thinking blocks, redacted thinking, attachments, etc.

(msg: RenderableMessage)

Source from the content-addressed store, hash-verified

405 * This includes thinking blocks, redacted thinking, attachments, etc.
406 */
407function shouldSkipMessage(msg: RenderableMessage): boolean {
408 if (msg.type === 'assistant') {
409 const content = getFirstContentItem(msg.message?.content)
410 // Skip thinking blocks and other non-text, non-tool content
411 if (content && (content.type === 'thinking' || content.type === 'redacted_thinking')) {
412 return true
413 }
414 }
415 // Skip attachment messages
416 if (msg.type === 'attachment') {
417 return true
418 }
419 // Skip system messages
420 if (msg.type === 'system') {
421 return true
422 }
423 return false
424}
425
426/**
427 * Type predicate: Check if a message is a collapsible tool use.

Callers 1

collapseReadSearchGroupsFunction · 0.85

Calls 1

getFirstContentItemFunction · 0.85

Tested by

no test coverage detected