claude-code - 💡(How to fix) Fix Bash tool summary line undercounts find paths and -o patterns

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

Reality:

  • find received 1 root path (~) and 2 name patterns connected by -o
  • "1 pattern" undercounts because the -o-connected second -name is treated as part of the same logical pattern instead of as a separate pattern

Code Example

ls ~/Desktop/file1.pdf ~/Desktop/file2.pdf 2>&1 ; find ~/Desktop ~/Downloads ~/Documents -name "file1*" -o -name "file2*" 2>/dev/null | head -5

---

find ~ -maxdepth 4 -name "file1*" -o -name "file2*" 2>/dev/null
RAW_BUFFERClick to expand / collapse

Issue: Bash tool call summary line misleadingly undercounts find paths and -o patterns

Observed

The collapsed-summary line shown for a Bash tool call (the Searched for N patterns, listed M directories (ctrl+o to expand) text) does not accurately reflect what the shell command actually scanned or searched.

Example 1

Bash command (single tool call):

ls ~/Desktop/file1.pdf ~/Desktop/file2.pdf 2>&1 ; find ~/Desktop ~/Downloads ~/Documents -name "file1*" -o -name "file2*" 2>/dev/null | head -5

UI summary line: listed 1 directory (ctrl+o to expand)

Reality:

  • ls operated on 2 file paths in 1 directory (~/Desktop)
  • find scanned 3 separate root paths (~/Desktop, ~/Downloads, ~/Documents) with 2 name patterns joined by -o

The "1 directory" label captures the ls portion only and silently drops the find portion of the same Bash invocation.

Example 2

Bash command (single tool call):

find ~ -maxdepth 4 -name "file1*" -o -name "file2*" 2>/dev/null

UI summary line: Searched for 1 pattern, listed 1 directory (ctrl+o to expand)

Reality:

  • find received 1 root path (~) and 2 name patterns connected by -o
  • "1 pattern" undercounts because the -o-connected second -name is treated as part of the same logical pattern instead of as a separate pattern

Impact

When the user cannot expand the summary line (e.g., ctrl+o keybinding is overridden, the line is shown in a non-interactive transcript paste, or the user is reading the output in a context where the expansion is unavailable), the misleading summary becomes the only visible source of truth about what the assistant did. This produces real distrust between the user and the assistant when the user reads "1 directory" while the assistant's narration says "3 directories." Both descriptions are accurate fragments, but the UI summary's choice of which fragment to surface is incomplete and not labeled as such.

Expected behavior

Either:

  1. Summarize the full command (e.g., Listed 2 files in 1 directory; searched 3 directories for 2 patterns), or
  2. Label the summary explicitly as a partial/heuristic description (e.g., 1 directory listed (other shell ops in the call not summarized)), or
  3. Show the actual underlying command text in the collapsed view rather than a heuristic phrase.

Repro environment

  • Linux (Ubuntu 25.10, X11)

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Either:

  1. Summarize the full command (e.g., Listed 2 files in 1 directory; searched 3 directories for 2 patterns), or
  2. Label the summary explicitly as a partial/heuristic description (e.g., 1 directory listed (other shell ops in the call not summarized)), or
  3. Show the actual underlying command text in the collapsed view rather than a heuristic phrase.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Bash tool summary line undercounts find paths and -o patterns