[Bug]: A long Claude command's output stops at 30,000 characters, cut mid-line with no marker
Before submitting
- [x] I searched existing issues and did not find a duplicate.
- [x] I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
- In a Claude thread, ask the agent to run this as one Bash call:
seq 1 100000 | sed 's/^/build log line /' - When the turn ends, expand the command row and scroll to the end of its output.
Expected behavior
The output ends at build log line 100000, the real end. If T3 Code keeps only part of the output, the row says so. Codex rows already do this: Codex stores up to 1 MB with a ... N bytes omitted ... line, so a Codex row ends at the command's last line.
Actual behavior
The output stops at build log line 1555, followed by build l. That is the first 30,000 characters of a 2 MB output. There is no "Earlier output not shown" line and no other sign that anything is missing, so the row looks complete. For a build or test command, the part that is lost is the end, where the errors and the summary are.
Cause: Claude Code 2.1.309 caps the Bash result's stdout at 30,000 characters. It saves the full output to a file and reports that file in the same result as persistedOutputPath and persistedOutputSize; the model gets a 2 KB preview and the file path. claudeCommandOutputText (ClaudeAdapterV2.ts) stores stdout and ignores those two fields. 30,000 characters is below the hub's 64K display budget, so persistedCommandOutput (CommandOutputHub.ts) shows it in full and sets truncated: false.
While a long command runs, the live view tails Claude's task output file, so a slow command shows its latest lines. From the code, when the command settles the row switches to the stored stdout, and those lines are replaced by the first 30,000 characters. I did not watch this switch live: the command above finishes in about 50 ms.
Possible fix: when the result has persistedOutputPath, store a bounded tail of that file (the hub keeps at most 256K of a final output anyway), or at least set truncated when persistedOutputSize is larger than stdout.
Impact
Minor bug or occasional failure
Version or commit
Reproduced on main @ 337c5858c3; the code is the same on main @ 2e39f1d7de.
Environment
macOS 26.5, web client, server from a dev checkout, Claude Code 2.1.309, Claude Haiku 5.5. Mobile reads the same command output frames, so it should show the same cut.
Logs or stack traces
# Claude Code session transcript, toolUseResult for the command
stdout 30000 chars, ends "build log line 1555\nbuild l"
stderr ""
persistedOutputPath ~/.claude/projects/<project>/<session>/tool-results/bm8fft77t.txt
persistedOutputSize 2088895
# that file
$ wc -c bm8fft77t.txt
2088895 bm8fft77t.txt
$ tail -n 1 bm8fft77t.txt
build log line 100000
# T3 Code projection row (orchestration_v2_projection_turn_items)
type=command_execution status=completed length(output)=30000
Screenshots, recordings, or supporting files
No response
Workaround
Ask the agent to write long output to a file, or to pipe it through tail.