Skip to content

bug(critical): silent truncation causes data loss — LLM takes decisions on incomplete diffs #827

Closed

Description

@pszymkowiak

User report

I did a diff between 2 large files (+1000 lines of data/yaml) and asked Claude for a summary.
RTK truncated the diff, Claude didn't tell me or didn't notice.
I made important decisions based on this diff that I can't undo (very frustrating).
Claude confirmed the next day that RTK had truncated the data.
I lost trust, I don't have time for this, I'm uninstalling.

Root cause

rtk diff silently truncates output at 3 levels:

  1. Max 50 changes shown (.take(50)) — no warning to LLM
  2. Lines truncated at 70-80 chars — content silently cut
  3. No machine-readable truncation marker — LLM cannot detect data loss

Same pattern exists in rtk git diff, rtk read, and potentially other commands.

Impact

  • P0 severity: Users make irreversible decisions on incomplete data
  • Trust killer: Once bitten, users uninstall RTK
  • LLM blind spot: Claude/Copilot cannot tell the user that data was truncated

Proposed fix

Short term (must-fix)

Add a clear, machine-readable truncation warning at the end of any truncated output:

[warn] Output truncated: showing 50/847 changes. Run `diff file1 file2` for full output.

This lets the LLM:

  1. Tell the user the diff is incomplete
  2. Suggest running the raw command for full output
  3. Avoid making decisions on partial data

Long term

  • Add --full flag to disable truncation for critical commands (diff, read)
  • Consider making rtk diff of large files pass through to raw diff with a warning
  • Tee integration: save full output to disk, print hint

Affected commands

Command Truncation Current warning
rtk diff 50 changes, 70-80 char lines "... +N more changes" (easy to miss)
rtk git diff hunk limits None
rtk read filter levels strip content None
rtk git log body truncated to 3 lines None

Related

Priority

P0 — This is a trust and safety issue. Users who experience silent data loss will uninstall RTK permanently.

Activity

  1. added a commit that references this issue on Mar 25, 2026
    80fc29a
  2. pszymkowiak commented on Mar 26, 2026

    @pszymkowiak
    CollaboratorAuthor

    [w] wshm · Automated triage by AI

    🔍 Automated Triage

    🐛 Category bug
    🔴 Priority critical
    🎯 Confidence 92%

    Summary

    Silent output truncation across rtk commands (diff, git diff, read) causes LLMs to make decisions on incomplete data without any machine-readable warning; needs truncation markers added to all affected commands.


    Triaged automatically by wshm · This is an automated analysis, not a human review.

  3. added 2 commits that reference this issue on May 14, 2026
    440de71
    4a66f0b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingeffort-medium1-2 jours, quelques fichiersfilter-qualityFilter produces incorrect/truncated signal

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions