You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Signal truncation in git diff, git log, and json filters #621
30 lines per hunk is too low for any meaningful refactor. Claude sees a truncated diff, assumes the change is complete, then produces incorrect code because it missed the rest of the hunk.
2. git log — 1 line of commit body (src/git.rs:492-493)
The filter keeps only the subject line and drops the body after the first non-empty line. This silently discards:
BREAKING CHANGE: notes
Migration instructions
Co-author / fix references
Claude operating on release history or changelogs gets a misleading picture.
3. json — all values stripped (src/json_cmd.rs:86-173)
The JSON filter removes all values and shows only structure. For config debugging (the primary use case), this is useless — Claude needs to see both keys and values to spot a misconfiguration.
Proposed fixes
Filter
Current
Proposed
git diff hunk cap
30 lines
50-100 lines (configurable)
git log body
1 line
3 first non-empty lines
json values
stripped
preserved by default, opt-in --keys-only
Acceptance criteria
rtk git diff shows hunks up to 100 lines before truncating
rtk git log preserves BREAKING CHANGE and other body metadata
rtk json shows values by default; --keys-only for structure-only view
All three filters still achieve ≥50% savings vs raw output
Confirmed this is still unaddressed. Scoped the actual changes needed:
src/cmds/git/git.rscompact_diff(): raise max_hunk_lines from 30 to 50 (or make configurable via config.toml)
src/cmds/git/git.rsfilter_log_output(): change body limit from 1 line to 3 non-empty lines (to preserve BREAKING CHANGE: notes, migration instructions, co-author refs)
src/cmds/system/json_cmd.rs: preserve values by default, add --keys-only flag for structure-only view
Acceptance criteria: all three filters must still achieve at least 50% savings vs raw output.
Will address in a separate PR after the discover coverage PR lands.
Part of this is now addressed by #993 (merged): #993
Specifically, rtk git diff now preserves the full unified diff hunk header, including the trailing function / symbol context after the second @@ marker. This fixes one class of lost diff context in compact diff output.
This does not resolve the rest of this issue yet (for example the separate hunk line cap, git log body preservation, or JSON value preservation), but it does fix one of the git diff signal-loss cases described here.
Three filters (git diff, git log, json) truncate too aggressively, losing signal LLMs need; PR #863 already addresses the json portion — remaining work on git diff hunk cap and git log body retention.
📁 Relevant files
src/git.rs
src/json_cmd.rs
Triaged automatically by wshm · This is an automated analysis, not a human review.
Activity
fix: increase signal in git diff, git log, and json filters (#621)
fix: increase signal in git diff, git log, and json filters (#621)
fix: increase signal in git diff, git log, and json filters (#621)
fix: increase signal in git diff, git log, and json filters (#621) (#708
fix: increase signal in git diff, git log, and json filters (#621)
FlorianBruniaux commentedon Mar 28, 2026
Confirmed this is still unaddressed. Scoped the actual changes needed:
src/cmds/git/git.rscompact_diff(): raisemax_hunk_linesfrom 30 to 50 (or make configurable viaconfig.toml)src/cmds/git/git.rsfilter_log_output(): change body limit from 1 line to 3 non-empty lines (to preserveBREAKING CHANGE:notes, migration instructions, co-author refs)src/cmds/system/json_cmd.rs: preserve values by default, add--keys-onlyflag for structure-only viewAcceptance criteria: all three filters must still achieve at least 50% savings vs raw output.
Will address in a separate PR after the discover coverage PR lands.
fix(json): rename --schema to --keys-only for clearer opt-in semantics
em0t commentedon Apr 3, 2026
Part of this is now addressed by #993 (merged): #993
Specifically,
rtk git diffnow preserves the full unified diff hunk header, including the trailing function / symbol context after the second@@marker. This fixes one class of lost diff context in compact diff output.Example of the part fixed by #993:
@@ -10,3 +10,4 @@@@ -10,3 +10,4 @@ fn important_context() {This does not resolve the rest of this issue yet (for example the separate hunk line cap,
git logbody preservation, or JSON value preservation), but it does fix one of the git diff signal-loss cases described here.Merge pull request #890 from rtk-ai/fix/filter-truncation-621
fix: increase signal in git diff, git log, and json filters (rtk-ai#621…
pszymkowiak commentedon Apr 12, 2026
🔍 Automated Triage
featurehighSummary
Three filters (git diff, git log, json) truncate too aggressively, losing signal LLMs need; PR #863 already addresses the json portion — remaining work on git diff hunk cap and git log body retention.
📁 Relevant files
src/git.rssrc/json_cmd.rsTriaged automatically by wshm · This is an automated analysis, not a human review.
fix: increase signal in git diff, git log, and json filters (rtk-ai#621…
fix(json): rename --schema to --keys-only for clearer opt-in semantics
Merge pull request rtk-ai#890 from rtk-ai/fix/filter-truncation-621
fix: increase signal in git diff, git log, and json filters (rtk-ai#621…
fix(json): rename --schema to --keys-only for clearer opt-in semantics
Merge pull request rtk-ai#890 from rtk-ai/fix/filter-truncation-621