feat(desktop): a shell command that only read, searched or listed says so

Merged
AV
11d ago
+2298-15

Walkthrough: https://app.superset.sh/page/shell-commands-in-chat-ljhx2e — before/after screenshots of the same transcript from the desktop dev app.

What

A cat, sed -n, head, grep, rg, find, fd or ls the agent ran through its shell rendered as the raw command in mono (or, for Claude, as the agent's prose description in mono), and the run summary counted every one as "ran N commands".

The row now reads like a native read or search: Read package.json, Searched useQueue in src, Listed apps, Read AGENTS.md:1. The file or directory is the same icon chip our prose paths use and opens the file on click; a search query is plain mono. A redirect is Wrote notes.txt (or Edited when appending). git status and friends stay commands. The verb shimmers while the call runs. Expanding the row shows the command as a $ command line, then what the agent sent with it (for Claude, its description and the output); the line is left out when the agent sends a terminal block, which already prints the command.

How

  • Transcript/utils/shellIntent: display-time classifier (so history re-renders too). Looks through the shell an agent launched the command with (/bin/zsh -lc '…', pwsh -Command, cmd /c), splits pipes and chains with quote awareness, follows cd, and leaves anything with substitution, unbalanced quotes, an unknown binary or a program of its own as a command.
  • ShellIntentTitle: verb + file chip (FileIcon, openLink), absolute paths show the file name with the full path as tooltip.
  • effectiveToolKind feeds stepCounts and dominantKind, so read-only greps are "4 searches" rather than "ran 4 commands", and the run's icon follows.
  • A command row whose title is the command now shows it unwrapped; a Claude description title is no longer set in mono.
  • 11 new strings in all 16 locales.

Codex sessions already had Codex's own parsed-command titles (Read name / Search q in path); this lifts Claude and ACP sessions to the same level.

Verified

  • 99 Transcript tests (classifier, title chip, step counts), 241 ChatSession tests, Biome clean, desktop tsc exit 0, check:i18n exit 0.
  • Live in the dev window on a Claude chat: five commands rendered as Read / Searched / Listed / Read / command, run summary "read 2 files, 1 search, ran 1 command".

Summary by cubic

Shell commands that only read, searched, or listed files now render as native reads, searches, or lists in the transcript, and the run summary counts them accordingly.

Shell commands

  • A display-time classifier recognizes read, search, and list commands behind shell wrappers, pipes, and chains, parsing the way the shell does; a stdout redirect renders as Wrote or Edited, while stderr redirects, programs, and unknowns stay plain commands.
  • Step counts and the run icon follow the same intent; a file that shell commands write counts once across calls, and an intent row keeps the literal command as a $ command line in its body when the agent sends no terminal block.
  • 11 new strings, added to all 16 locales.

Summary by CodeRabbit

  • New Features
    • Shell commands now appear in transcripts with activity labels for reading, searching, listing, writing, and editing.
    • File and directory paths can be opened from activity details when available. Search activities show the query and searched location.
    • Shell activity labels are localized across supported languages.
  • Improvements
    • Read and search commands are distinguished from other commands in activity summaries and counts.
    • Shell commands remain accessible in expanded transcript details, including when there is no command output, and are not repeated when terminal output already shows them.