-
Notifications
You must be signed in to change notification settings - Fork 226
Open
Description
Summary
When using rtk with Claude Code, output from `gh` CLI (PR comments, review data) and `git diff` is frequently truncated, forcing the AI agent to retry fetches multiple times before it can begin actual work. This significantly delays productivity.
Related Issues
- gh api output is truncated, breaking programmatic use #199 (closed) — `gh api` output truncation
- Impossible to get full Github Issue content, even by getting the full raw markdown #188 (closed) — GitHub Issue content truncation at ~21 lines
rtk gh pr view --json ...fails #313 (closed) — `gh pr view --json` failure- bug: rtk gh api --jq returns type placeholders (int/string) instead of real values #311 (closed) — `gh api --jq` returning type placeholders
These addressed specific cases, but the broader problem persists for PR review comments and large diffs.
Reproduction
- PR review comments: `gh api repos/OWNER/REPO/pulls/123/comments` — output is truncated when there are many comments, requiring multiple fetch attempts
- PR review data: `gh pr view 123` with substantial review threads — truncated output
- git diff: Large diffs are cut off, requiring multiple read attempts before Claude can analyze changes
Impact
- Claude spends significant effort retrying truncated GitHub review comments across multiple sessions, delaying actual code fixes
- Git diff output truncation causes unnecessary back-and-forth before Claude can analyze changes
- Overall workflow is slowed considerably by what should be single-fetch operations
Suggestion
Consider one or more of:
- Passthrough mode for
gh api: Since API responses are consumed programmatically, pass them through unfiltered - Pagination-aware filtering: When
gh apiuses pagination flags (--paginate), preserve full output - Per-item fetching: For collections (PR comments), fetch and filter individually rather than truncating the batch
- Configurable truncation limits: Allow users to set higher thresholds for specific command categories (e.g.,
gh,git diff) - Smart truncation for
git diff: Preserve diff structure (file headers, hunk headers) even when truncating content
Environment
- rtk 0.25.0
- gh CLI
- Claude Code
- macOS (darwin arm64)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels