From a6640e9ef21998444d0ed6977a1482cedda53ded Mon Sep 17 00:00:00 2001 From: Charles Packer Date: Fri, 9 Jan 2026 14:57:15 -0800 Subject: [PATCH] feat: show line count summary for Read tool results (#507) Co-authored-by: Letta --- src/cli/components/ToolCallMessageRich.tsx | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/cli/components/ToolCallMessageRich.tsx b/src/cli/components/ToolCallMessageRich.tsx index b020073..15ab2b4 100644 --- a/src/cli/components/ToolCallMessageRich.tsx +++ b/src/cli/components/ToolCallMessageRich.tsx @@ -13,6 +13,7 @@ import { import { getDisplayToolName, isFileEditTool, + isFileReadTool, isFileWriteTool, isMemoryTool, isPatchTool, @@ -547,6 +548,28 @@ export const ToolCallMessage = memo( } } + // Check if this is a file read tool - show line count summary + if ( + isFileReadTool(rawName) && + line.resultOk !== false && + line.resultText + ) { + // Count lines in the result (the content returned by Read tool) + const lineCount = line.resultText.split("\n").length; + return ( + + + {prefix} + + + + Read {lineCount} lines + + + + ); + } + // Regular result handling const isError = line.resultOk === false;