#17966: feat(ui/usage): show files read during session in context panel
app: web-ui
gateway
size: M
Cluster:
Tool Execution and Error Handling
## Files Read Tracking & Tree View
Adds file read tracking to the usage dashboard, showing which files were read during a session and how often.
<img width="667" height="872" alt="image" src="https://github.com/user-attachments/assets/d6e60a0f-5f75-46e5-856e-28621fe4051d" />
### Backend
- `extractFileReadPaths()` in transcript-tools.ts (supports tool_use + toolCall formats)
- Per-session and cross-session filesRead aggregation
- File paths included in session log format `[Tool: read /path]`
- New `SessionFilesRead` type
### UI
- Tree view in System Prompt Breakdown with common prefix detection and directory collapsing
- Filter-aware: recalculates from logs when time range cursor active
- Insight list values on single line with ellipsis for long labels
### Tests
- 29 tests pass (14 backend + 15 UI)
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Added file read tracking to the usage dashboard. Files read during a session are extracted from transcript tool_use blocks, aggregated per-session and cross-session, displayed in a tree view with directory collapsing in the System Prompt Breakdown panel, and recalculated from logs when a timeline filter is active.
**Backend Changes:**
- `extractFileReadPaths()` extracts file paths from Read tool blocks in both tool_use and toolCall formats
- `loadSessionCostSummary()` aggregates filesRead data with counts per file
- Session logs include file paths in format `[Tool: read /path]`
- New `SessionFilesRead` type mirrors `SessionToolUsage` structure
**Frontend Changes:**
- Tree view with common prefix detection and directory collapsing
- Filter-aware: recalculates from logs when timeline cursor is active
- `parseToolSummary()` regex updated to capture only tool name (first word) to prevent file paths from leaking into tool grouping pills
- Compact insight list rendering with ellipsis for long labels
**Testing:**
- 29 passing tests (14 backend + 15 frontend) cover path extraction, aggregation, tree building, and filtering
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk
- The implementation is well-tested with 29 passing tests, follows established patterns in the codebase, includes proper type definitions, handles edge cases (cursor filtering, common prefix detection, tree collapsing), and the previous thread concerns about tool name grouping have been resolved. No security issues, performance concerns, or logical errors detected.
- No files require special attention
<sub>Last reviewed commit: 5d7f7c6</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#10189: fix: resolve file_path param in tool display for read/write tools
by Yida-Dev · 2026-02-06
74.3%
#6819: fix(tui): handle unstructured tool results and errors in tool execu...
by TreyDong · 2026-02-02
73.4%
#21285: fix(auto-reply): parse toolCall read paths in post-compaction audit
by Jackten · 2026-02-19
73.2%
#22387: fix: session_status context tracking undercount for cached providers
by 1ucian · 2026-02-21
73.1%
#15162: Include tool args in verbose preview summaries
by bufordtjustice2918 · 2026-02-13
72.9%
#17448: ui: make tool cards collapsible with inline expansion
by karimStekelenburg · 2026-02-15
72.5%
#6308: feat(ui): add logsLevelFilters field to store log level filter sett...
by Cassius0924 · 2026-02-01
72.2%
#6408: feat(ui): add job filtering and improve run history display
by Cassius0924 · 2026-02-01
72.2%
#11825: fix: keep tool_use/tool_result pairs together during session compac...
by C31gordon · 2026-02-08
72.1%
#20861: feat(context): add conversation transcript stats to /context command
by davidrudduck · 2026-02-19
71.7%