fix: hide internal tool-result file reads from sidebar activity

Claude reads its own ~/.claude/projects/.../tool-results/ files as
internal plumbing. These showed up as long unreadable paths in the
sidebar. Now: describeToolCall returns empty for tool-result reads,
and the sidebar skips rendering tool_use entries with no description.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-04-04 07:56:16 -07:00
parent 907d9d0187
commit e3be644b45
2 changed files with 11 additions and 3 deletions
+5 -1
View File
@@ -167,7 +167,11 @@ function describeToolCall(tool: string, input: any): string {
return short.length > 100 ? short.slice(0, 100) + '…' : short;
}
if (tool === 'Read' && input.file_path) return `Reading ${shorten(input.file_path)}`;
if (tool === 'Read' && input.file_path) {
// Skip Claude's internal tool-result file reads — they're plumbing, not user-facing
if (input.file_path.includes('/tool-results/') || input.file_path.includes('/.claude/projects/')) return '';
return `Reading ${shorten(input.file_path)}`;
}
if (tool === 'Edit' && input.file_path) return `Editing ${shorten(input.file_path)}`;
if (tool === 'Write' && input.file_path) return `Writing ${shorten(input.file_path)}`;
if (tool === 'Grep' && input.pattern) return `Searching for "${input.pattern}"`;
+6 -2
View File
@@ -241,11 +241,15 @@ function handleAgentEvent(entry) {
if (thinking) thinking.remove();
if (entry.type === 'tool_use') {
const toolEl = document.createElement('div');
toolEl.className = 'agent-tool';
const toolName = entry.tool || 'Tool';
const toolInput = entry.input || '';
// Skip tool uses with no description (e.g. internal tool-result file reads)
if (!toolInput) return;
const toolEl = document.createElement('div');
toolEl.className = 'agent-tool';
// Use the verbose description as the primary text
// The tool name becomes a subtle badge
const toolIcon = toolName === 'Bash' ? '▸' : toolName === 'Read' ? '📄' : toolName === 'Grep' ? '🔍' : toolName === 'Glob' ? '📁' : '⚡';