← Reddit

half of my agent's test runs left nothing readable in the transcript. the culprit was its own | tail -5

Reddit · Due_Emu_8229 · August 10, 2026
Analysis of 525 Claude Code transcripts revealed that 49% of test runs produced no readable transcript output, with the primary cause being the use of pipes such as `| tail -5` that truncated test results. The author created "red-handed," an open-source tool that removes these output-truncating pipes from test commands before execution to preserve full test output. The tool supports vitest, jest, mocha, and pytest runners and is freely available without requiring signup.

Detailed Analysis

A Reddit post detailing a homegrown audit of Claude Code transcripts surfaces an unglamorous but consequential failure mode in agentic coding workflows: agents frequently claim "tests pass" without the underlying evidence surviving in the session record. The author scanned 525 local Claude Code sessions and found 183 instances where the agent reported passing tests. In 174 of those cases, a test run was verifiably present in the transcript. Nine cases involved legitimate but unparseable output, such as browser-based checks or scripts with nonstandard logging, that the auditing tool simply couldn't interpret, not agent fabrication. The more striking finding was that 49% of all test runs left no readable result whatsoever, and the root cause traced back to a mundane Unix habit: agents piping test output through commands like `tail -5`, which truncates the very summary line that would confirm success or failure. The run happened, but the record didn't survive the pipe.

This is a data-integrity problem more than a hallucination problem, and that distinction matters. Much of the current anxiety around agentic coding tools centers on whether models fabricate claims about code correctness. This analysis suggests that in a meaningful share of cases, the issue isn't dishonesty but auditability: the agent's own shell habits destroy the evidence trail needed to verify its claims after the fact. When 49% of test invocations produce transcripts that can't confirm pass/fail status, users and reviewers are left trusting an assertion they cannot independently check, which is functionally similar to a lie even if the agent never intended to deceive. As autonomous coding agents take on more unsupervised work, especially in CI-adjacent or "vibe coding" contexts, this kind of silent evidence-loss becomes a real trust and safety liability, not just a logging inconvenience.

The proposed fixes are notably lightweight and defensive rather than architectural. The author built two local, offline tools: an auditor (`red-handed`) that scans existing transcripts and counts how often "tests pass" claims are actually backed by parseable runs, and a Claude Code plugin that installs a `PreToolUse` hook to strip result-truncating pipes (like `| tail -5`) from test commands before they execute. The reasoning is pragmatic: test output is typically only a few hundred characters at the median, so preserving the full result costs almost nothing in context or performance, while the payoff is a transcript that can actually be trusted. The plugin was verified in a live session where the agent still attempted to truncate output, but the hook intervened and preserved the full 22-line result anyway, demonstrating that the fix works at the point of execution rather than relying on the agent to behave differently.

Broader context here connects to a growing ecosystem of third-party tooling built specifically to audit, constrain, and verify Claude Code and similar agentic systems, reflecting a maturing but still trust-deficient phase of AI-assisted development. Anthropic's own agent architecture increasingly relies on tool use, hooks, and permission systems (like `PreToolUse`) that third-party developers can extend, and this project is a direct example of the community building verification infrastructure on top of those primitives rather than waiting for the model itself to become more reliable. The author is transparent about limitations, the tool only fully parses a handful of test runners (vitest, jest, mocha, pytest) and had its own logic bugs caught and fixed via regression tests, and discloses that the tool itself was built using Claude Code, underscoring a recursive theme in current AI development: agents are increasingly being used to build the very oversight mechanisms meant to keep other agents honest.

Read original article →