Repository navigation
Description
Feature Request: no_truncation = true config flag
RTK's internal architecture already distinguishes between lossless summarization (whitespace stripping, ANSI removal, deduplication, reformatting) and lossy truncation (hard result caps that silently drop data). That distinction is encoded in FilterResult.truncated, FormatMode, and FilterLevel — but it's never surfaced to users.
Request: expose a single config flag that disables all lossy truncation while keeping lossless compression:
[safety]
no_truncation = trueWhen set, RTK would only apply operations that preserve all facts: strip ANSI codes, collapse blank lines, reformat JSON, deduplicate repeated log lines. It would never hard-cap result counts or truncate line content.
Why this matters: real failure scenarios
These aren't hypothetical. Every one of these can happen silently today with default config.
1. Incomplete git commits (git status capped at 15 modified + 10 untracked)
An AI agent reviews git status output to decide which files to stage. RTK shows 15 modified files — but 20 were actually modified. The agent stages and commits the 15 it can see. The remaining 5 files — potentially including a config change, migration file, or security fix — are silently left out of the commit. No error. No warning. The commit goes out broken.
2. Missed security vulnerabilities in grep results (200 total, 25/file hard cap)
An agent is tasked with finding all usages of a deprecated/vulnerable API pattern across the codebase. grep returns what looks like a complete result set, but RTK has silently capped it at 200 total and 25 per file. The agent updates every match it sees, declares the job done, and ships — with the remaining instances of the vulnerable pattern still in production code.
3. Approved diffs with hidden changes (diff capped at 10 changes/file, hunks at 100 lines)
An agent performs a pre-commit review of a diff. RTK shows 10 changes per file. There are actually 25. The agent approves the diff having never seen the other 15 changes — which might include a logic error, a hardcoded credential, or a broken test. The ... +15 more marker is easy to miss or ignore.
4. Missing breaking change notices in git log (commit body truncated to 3 lines)
An agent analyzes commit history to understand a change before cherry-picking or reverting it. The commit body contains a BREAKING CHANGE: notice, a required migration step, or a known caveat — but it's on line 4 or later. RTK drops it. The agent proceeds without the context it needed, causing a broken deployment or missed migration.
5. Incomplete API schema inference from curl (30 lines, 200 chars/line)
An agent calls an API endpoint to understand its response structure and generate client code. The response has 50 fields. RTK shows 30. The agent generates a model/interface that handles those 30 fields — missing pagination metadata, error shapes, or required fields. The generated code silently fails at runtime on responses that include the truncated fields.
6. Wrong validation logic from truncated JSON (arrays after 5 items, objects after 20 keys)
An agent reads a JSON config or schema file containing an enum of valid values: ["admin", "editor", "viewer", "moderator", "guest", "readonly", "api", "webhook", "service", "auditor", "superuser", "owner"]. RTK shows [admin, editor, viewer, moderator, guest, ... +7 more]. The agent generates validation code that only accepts the 5 visible values and rejects the other 7 as invalid. Users with those roles start getting access denied errors.
7. Silent grep misses in multi-file refactors (25/file cap)
An agent is renaming a function across a large codebase. A heavily-used file has 40 call sites. RTK shows 25. The agent updates the 25 it can see and considers the rename complete. The other 15 call sites in that file still reference the old name. The codebase no longer compiles.
Common thread
In every case: RTK provides no indication that results are incomplete when it would matter most. The ... (N more) messages are easy to treat as cosmetic. An agent has no way to know it's working with a partial picture.
Lossless summarization — stripping noise, collapsing whitespace, reformatting — is genuinely valuable in agent contexts. Hard result caps are not. The fix is to let users opt into lossless-only mode.
Suggested implementation
# ~/.config/rtk/config.toml (or platform equivalent)
[safety]
no_truncation = true # disable all lossy caps; lossless compression still appliesCommands that currently have FilterResult.truncated = true paths would skip those paths when this flag is set. The FormatMode / FilterLevel pipeline stages that only reformat (not drop) would continue working normally.
Environment
- RTK version: 0.36.0
- OS: macOS 24.6.0
- Use case: AI coding agent (Claude Code)
Activity
ChrisEdwards commentedon Apr 14, 2026
Correction: most truncations do emit indicators
After digging into the source more carefully, I need to correct the framing in the original report. Most commands do emit truncation markers:
curl... (N more lines, X bytes total)— cleargrep... +Nper file and total — clearjson[first, ... +N more]/... +N more keys— inline, easy to skim pastgit status... +N moreat end of each sectiongit logbody[+N lines omitted]— weak, looks like a notegit logcountdiff(file path)So the scenarios I described as "silent" are mostly not silent — the
... +N moremarker is there.The actual problem is different and arguably worse: the indicators exist, but they don't stop anything. An AI agent reads output, synthesizes it, and proceeds. Seeing
... +47 more grep resultsdoesn't cause the agent to refuse to act — it notes it and moves on, potentially treating what it saw as sufficient. The truncation marker is informational, not a hard stop.The
git logcommit count cap (default 10, no indicator) is the one genuinely silent case.The feature request still stands — a
no_truncation = truemode that removes hard caps entirely is cleaner than relying on agents to correctly handle overflow markers. But the failure mode is agents proceeding on partial data with awareness they couldn't act on, not agents being completely unaware data was dropped.Sorry for the overstatement in the original report.
feat(safety): add [safety] no_truncation config flag to disable lossy…
feat(safety): add [safety] no_truncation config flag to disable lossy…
feat(safety): add [safety] no_truncation config flag to disable lossy…
RKelln commentedon Apr 16, 2026
Hi @ChrisEdwards — I've implemented the
no_truncationflag you described here. It's running in my fork at RKelln/rtk on thefeature/no-truncationbranch (5 commits on top of v0.36.0).What it does:
Guarded truncation sites:
status_max_files,status_max_untrackedgrep_max_per_filepassthrough_max_charstruncate_passthrough()I placed the flag in
[limits]rather than a new[safety]section since that's where all the caps it controls already live.I'd appreciate any feedback before submitting this upstream as a PR. In particular:
no_truncationthe right flag name, or would you prefer something likelossless_only?Happy to iterate based on your real-world experience with agent workflows.
ChrisEdwards commentedon Apr 16, 2026
So, the motivation for this feature was the revelation that rtk not only filters out noise, it also truncates the signal. This config flag turns off truncation of the signal. Those are two very different things. In a test run, noise is all the passing test details, blank lines and other stuff. The signal is the test failures, and possibly the aggregate of numbers of tests passed, etc. No one is going to complain if you remove all that noise, but if there are 3 failing tests, the expectation is that you will see all three failing tests. Truncating that is unexpected, and rtk does it (albeit mabye not for tests, but for other things). This flag would turn that off, but keep the token-saving noise reduction.
So the heuristic is, If this filters noise, compresses the signal (aggregation/dedup), but does not lose the signal, its allowed when this flag is on. Anything that removes signal (even if it adds a note that its removed) is disallowed when this flag is on. The agent should not have to call again to get the full signal when this flag is on.
I hope this helps.
I was surprised to learn that rtk truncated the actual signal. I never expected that. I guess it makes sense from a token persepective, but then if the agent needs to make ANOTHER call to get the rest of the signal, it actually uses MORE tokens...defeating the purpose. Since rtk already does this, I think having a feature flag to turn that off makes total sense.
ChrisEdwards commentedon Apr 17, 2026
It looks like what you implemented in your branch is what I asked for. Thank you. It looks well thought-out too.
yadue commentedon Apr 17, 2026
@RKelln I believe that cli flag would be useful too (i.e., for stateless pipelines).
pszymkowiak commentedon Apr 17, 2026
🔍 Automated Triage
featurehighSummary
Request for a
no_truncation = trueconfig flag to disable lossy hard caps while preserving lossless compression, with detailed failure scenarios showing how silent truncation causes agent errors.Triaged automatically by wshm · This is an automated analysis, not a human review.
noctuid commentedon Apr 17, 2026
It looks like rtk also removes warnings for some commands @RKelln Does your branch address that as well? Should this be thought about completely separately? Removing warnings is still lossy behavior that I'd like to avoid.
RKelln commentedon Apr 18, 2026
I wasn't aware of the warnings, can you give some examples? Probably would be a separate PR but good to think about how it might be structured with this.
I have a new patch coming, with --lossless cli flag but discovered a bunch more lossy truncation in testing that needs to be dealt with. Thanks for the extra eyes on this folks.
noctuid commentedon Apr 18, 2026
I heard other people mention it removing unused variable warnings, and the first showcase on the website shows it removing warnings like that from
cargo test.1 remaining item
feat(config): support multi-word entries in exclude_commands
feat(config): support multi-word entries in exclude_commands
RKelln commentedon Apr 23, 2026
Community review request: fork is up to date, would love eyes before upstream PR
The fork (RKelln/rtk ·
feature/no-truncation) is now fully up to date. Planning to put together a proper upstream PR but would love community feedback first — especially on scope and the longer-term design direction.What's in the branch
--losslessflag +lossless = trueconfig — disables all lossy output caps while keeping lossless operations (ANSI strip, dedup, reformat). Addresses the core request in this issue. The flag works per-invocation (rtk --lossless git status) or persistently via config — which I believe also covers @yadue's stateless pipeline use case.Full cap audit — went through every
.take(N)site in the codebase (47+ across 20+ files). Every lossy cap is now guarded so--losslessactually means what it says. Non-lossy sites (summarization stats, display truncation, internal pipeline) are annotated so the distinction is auditable. A pre-commit script enforces this going forward.Warning suppression (@noctuid) — out of scope for this PR, but agree it's the same class of problem (lossy filtering of signal). Worth a separate issue/PR once this lands.
Try it
Longer-term design discussion
While doing the audit it became clear the magic numbers problem is worth thinking through properly. Wrote up a design proposal in PLAN.md — the short version:
The hard-coded caps are essentially vibes — and consistently so. They cluster by density intent rather than command: ~3 for tight context (stack traces), ~5 for focused attention (failures), ~10 for pattern recognition (files, rules), ~20 for inventory browsing (env vars, deps).
A
few/some/many/lotsvocabulary in code + a user config that's a personal density contract would make this auditable and tunable without magic numbers anywhere:Not proposing to land all of that in the first PR — just want to flag the direction so the
--losslessimplementation doesn't paint us into a corner. Happy to hear whether this resonates or if there's a simpler approach upstream prefers.Full design notes (including
rtk caps --auditfor human calibration of defaults): PLAN.mdshanoaice commentedon May 6, 2026
Wonder whether it is possible to tune truncation on a per-command or per-category basis? Sometimes it is just a few commands that needs to be excluded and produces lossless output.
ROADMAP: v1.1 plan with P0/P1/P2 priorities, motivated by community
Yohjisakamoto commentedon Jul 22, 2026
Your lossless-mode and silent-failure proposal raises the same measurement question: DeepSWE found Tura cuts coding-agent rounds by 89% and total token cost by 80%, while I/O-only compression has limited end-to-end impact; would you evaluate the methodology? https://turaai.net/docs#benchmark-current-test-set-record
sanchpet commentedon Aug 31, 2026
A measured data point for this, from three weeks of agent use with the Bash hook enabled, in case production numbers help the case.
From rtk's own
history.db: 203 of 1573rtk readcalls dropped content. The largest returned 44 tokens out of 387373; a 104 KB Markdown file came back as 2178 of 26108, and the agent went on to work from it. The remaining 1370 reads saved exactly nothing, so the read filter's entire contribution to the "3.3M tokens saved" headline — 2.65M of it, ranked top by Impact — is truncation. The ledger presents the loss as the tool's main achievement.What makes this fixable rather than inherent is that the same binary already gets it right elsewhere.
grepgave 25 of 100 matches,find52 of 300,jq42 of 300 — and each printed the true total, the number withheld, and atailcommand recovering the rest from a tee log.readwrites no tee log at all, and a baregit logstops at 50 of 469 commits with no marker (#1296, #2204). An explicit-nis honoured exactly, which suggests the caps, not the filters, are the thing to surface.So
no_truncationwould help, but even without it, applying the existing notice-and-tee convention toreadand to unboundedgit logwould remove the silent cases. Reporting rather than requesting: we have removed the hook and now call rtk explicitly for the filters that announce their truncation.Assisted-By: Claude [email protected]
Ezechis commentedon Sep 4, 2026
Hey — your lossless-mode proposal on #1313 is exactly the kind of thing I've been looking into. Trying to understand how much people actually worry about silent truncation/corruption in these tools versus just living with it. Open to 2-3 quick questions on that?
ChrisEdwards commentedon Sep 5, 2026
I stopped using RTK because of this. It was truncating information that was needed. After the third time I wasted cycles troubleshooting an issue only to discover it was caused by RTK truncating data the agent needed, I uninstalled it.
I think there is a lot of value in this tool, but there is too much risk in it over-truncating and my agents missing important info. I just can't take that risk anymore.
ChrisEdwards commentedon Sep 5, 2026
This issue is STILL open and under debate after 5 months. There is no debate. You truncate the signal, your tool has failed. And it has. We asked everyone in our company to cease using it months ago.
Ezechis commentedon Sep 21, 2026
Really appreciate you laying that out — that's exactly the kind of failure I was trying to understand. Two follow-ups: is silent truncation still happening on the latest version, or was that a version you've since moved off? And separately — if RTK actually guaranteed lossless output (no truncation, ever), would that be enough to bring it back for you or your team, or is trust already too far gone at this point?
ChrisEdwards commentedon Sep 22, 2026