Skip to content

Proxies silently truncate output or redefine flags (grep -c/-l/-m, find, git status/show/log, docker images); rtk curl -o fails; no Windows hook mode #4559

Open

Description

@kydechuk01

Summary

We evaluated RTK (v0.29.0, Windows 10, Git Bash) for automatic prefixing of Claude Code bash commands via a PreToolUse hook (~14.6k commands/month). The evaluation failed on output integrity: several proxies silently truncate output or change flag semantics, which is unsafe when an LLM consumes the output as complete data.

Findings (all reproduced on real workloads)

1. rtk grep redefines grep flags and silently truncates

  • -c means "context-only" (native grep: count), -l means "max-len" (native: files-with-matches), -m means "total results cap" (native: per-file max-count).
  • Defaults truncate to 50 results / 80 chars per line, silently. For agentic use this corrupts data: the model reads a truncated listing as complete.

2. Data loss in listing commands

  • rtk find on a directory with 6,710 files returns a 10-line summary.
  • rtk git status: 10 of 126 changed paths shown.
  • rtk git show: emits a "truncated" marker; diff lines cut (+64 → +15).
  • rtk git log without an explicit limit caps at 50 commits (visible only on large histories).
  • rtk docker images: 15 of 32 rows with a "+17 more" note.

3. rtk ls inflates output — on a large directory: 88,113 chars (native ls) → 119,080 chars (rtk ls).

4. rtk curl -sL --max-time 30 -o <file> <url> fails ("FAILED: curl"), reproducible; the same command without the rtk prefix works.

5. Hook mode unavailable on Windows

  • rtk init -g reports: "Hook-based mode requires Unix (macOS/Linux). Windows: use --claude-md mode", i.e. prompt-only on Windows.
  • rtk init also targets ~/.claude and ignores CLAUDE_CONFIG_DIR; with a custom config dir it patches the wrong settings/CLAUDE.md.

Requests

  1. A documented way to guarantee byte-complete output (e.g. --no-truncate / -m 0), including for grep.
  2. Preserve native flag semantics of wrapped commands (pass unknown flags through instead of redefining -c/-l/-m).
  3. Windows support for hook mode.
  4. Respect CLAUDE_CONFIG_DIR in rtk init.

Without (1) and (2), automatic prefixing is unsafe, and even manual use requires per-command verification that output was not shortened.

Activity

  1. added
    bug
    help wanted
    on Oct 14, 2026
  2. rtk-wshm-sync-bot commented on Oct 14, 2026

    @rtk-wshm-sync-bot

    wshm · Automated triage by AI

    🔍 Automated Triage

    🐛 Category bug
    🟠 Priority high
    🎯 Confidence 78%

    Summary

    Multiple rtk proxy commands (grep, find, git status/show/log, docker images, ls) silently truncate or redefine native flags, rtk curl -o fails, and Windows lacks hook mode — unsafe for automated LLM consumption.

    📁 Relevant files
    • src/grep.rs
    • src/find.rs
    • src/git/status.rs
    • src/git/show.rs
    • src/git/log.rs
    • src/docker.rs
    • src/ls.rs
    • src/curl.rs
    • src/init.rs

    Suggested Actions

    1. Split into separate tracked issues per sub-bug (flag redefinition, default truncation, curl -o, Windows hook) for triag…
    2. Add a documented byte-complete output flag (e.g. --no-truncate / -m 0) across grep/find/git/docker/ls paths
    3. Pass through native grep -c/-l/-m semantics instead of redefining them; cross-reference prior grep issues rtk hook claude rewrites rg → rtk grep (BSD grep) instead of rtk rg, so path-less ripgrep searches silently return 0 matches / hang on stdin #2301, Hook rewrite produces unparseable args for native grep flags and non-existent subcommands #1604,…
    4. Reproduce and fix rtk curl -sL --max-time 30 -o failure; compare against native curl behavior

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

  3. kydechuk01 commented on Oct 14, 2026

    @kydechuk01
    Author

    Follow-up after upgrading to v1.0.0 (Windows 10, Git Bash) — retested everything from the report:

    Fixed in v1.0.0 (verified locally):

    • grep -c now returns a count (300=300 on a synthetic file) and grep -l returns filenames — flag semantics match native grep.
    • rtk curl -sL --max-time 30 -o <file> <url> now downloads correctly (the v0.29 failure is gone).
    • Truncation is no longer silent: output shows +100 more in big.txt [+100 hidden: rtk recall <hash>] and rtk recall <hash> --full restores the full output.

    Still broken / new findings:

    1. [limits] values in config.toml are displayed but not applied. A/B test on grep_max_results: setting it to 7 and then to 10000000 in the config file (rtk config shows both values correctly read) produces an identical output — 200 shown + hidden marker. The filter ignores the config; only the CLI flag works (rtk grep --max 400 → full 300 lines).
    2. git log --oneline is still capped at 50 (synthetic repo with 100 commits); full-format git log returned 10 of 599 lines. No CLI flag found to raise either cap.

    Environment: rtk 1.0.0, Windows x86_64-pc-windows-msvc, config at %APPDATA%\rtk\config.toml.

    Net effect: the only working way to guarantee complete output today is passing --max/--max-len explicitly per invocation; [limits] as a global guarantee does not work.

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

    area:clibughelp wantedplatform:windowspriority:high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions