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

Function isNonCollapsibleToolUse

src/utils/collapseReadSearch.ts:345–368  ·  view source on GitHub ↗

* Check if a message is a non-collapsible tool use that should break a group. * This includes tool uses like Edit, Write, etc.

(
  msg: RenderableMessage,
  tools: Tools,
)

Source from the content-addressed store, hash-verified

343 * This includes tool uses like Edit, Write, etc.
344 */
345function isNonCollapsibleToolUse(
346 msg: RenderableMessage,
347 tools: Tools,
348): boolean {
349 if (msg.type === 'assistant') {
350 const content = msg.message.content[0]
351 if (
352 content?.type === 'tool_use' &&
353 !isToolSearchOrRead(content.name, content.input, tools)
354 ) {
355 return true
356 }
357 }
358 if (msg.type === 'grouped_tool_use') {
359 const firstContent = msg.messages[0]?.message.content[0]
360 if (
361 firstContent?.type === 'tool_use' &&
362 !isToolSearchOrRead(msg.toolName, firstContent.input, tools)
363 ) {
364 return true
365 }
366 }
367 return false
368}
369
370function isPreToolHookSummary(
371 msg: RenderableMessage,

Callers 1

collapseReadSearchGroupsFunction · 0.85

Calls 1

isToolSearchOrReadFunction · 0.85

Tested by

no test coverage detected