Skip to content

feat: tee full output to file for LLM re-read without re-run #86

Closed

Description

@FlorianBruniaux

Problem

When RTK filters command output (especially test runners), LLM agents like Claude Code often lose critical failure details (stack traces, assertion messages). This leads to re-running the same command 2-3 times just to get the full error info — wasting both tokens and time.

Some users already work around this with manual tee instructions in their CLAUDE.md.

Proposed Solution

Tee the full unfiltered output to a temporary file, and append a one-line hint at the end of RTK's filtered output:

✓ 42 passed, 1 failed (3.2s)
FAIL: test_parse_complex_input - assertion failed at src/filter.rs:142
📄 Full output: /tmp/rtk/cargo-test-2026-02-12-143052.log

The LLM can then read /tmp/rtk/...log once if it needs details, instead of re-running the command.

Design Considerations

  • Scope: start with test runners (cargo test, vitest, playwright, pytest) and build commands (cargo build, cargo clippy, tsc) — commands where failure details matter most
  • File location: /tmp/rtk/ (or $TMPDIR/rtk/) with auto-cleanup (e.g., 24h retention or max N files)
  • Naming: rtk-{cmd}-{timestamp}.log to avoid collisions
  • Config: opt-in or opt-out via config.toml ([output] tee_to_file = true)
  • Size cap: consider a max file size to avoid filling /tmp

Impact

  • Eliminates redundant command re-runs (biggest token waste pattern)
  • One-line hint cost is negligible (~10 tokens)
  • Aligns with RTK's mission: save tokens on the filtered output, but never lose information

Source

Feature request from Reddit discussion: https://www.reddit.com/r/ClaudeAI/comments/1r2tt7q/comment/o50eht9/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions