Skip to content

Feature request: per-invocation escape hatch (flag/env var) so an agent can self-disable rtk rewriting when stuck #1777

Open

Description

@DoWhileGeek

Summary

Request: a documented, per-invocation escape hatch that disables RTK's command rewriting/output condensation for a single command — ideally both a CLI flag and an env var — that an LLM agent can set itself when it determines RTK's rewritten output is hiding information it needs.

The motivating case: a Claude/Cursor agent ran npm test (jest), RTK's wrapper condensed the output, and the failing test detail the agent needed wasn't in the rewritten summary. The agent then retried the same command repeatedly with minor variations, getting the same condensed output each time, and got stuck in a loop until a human intervened.

If there were a known, agent-discoverable knob like RTK_PASSTHROUGH=1 npm test or npm test --rtk-passthrough (name TBD), the agent's loop-recovery logic could try it once and get the raw underlying output without the user having to uninstall RTK or reconfigure their shell.

Why a flag/env var (not just "uninstall rtk")

  • The whole point of RTK is that it's installed transparently — for humans and for the common agent path it's a net win. An agent shouldn't need to know how RTK was installed (Homebrew? PATH shim? hook?) to bypass it.
  • Telling a user "please disable rtk and rerun" is exactly the kind of human-in-the-loop escalation RTK is supposed to reduce. A documented escape hatch keeps the agent unblocked.
  • Existing wrappers in this space (e.g. NO_COLOR, CI=1, FORCE_COLOR=0, npm_config_*) have set the precedent that a single env var is the right surface area for tools that an agent might run unattended.

Suggested shape

Any of these would solve it; ranked by how useful they'd be to an agent:

  1. RTK_PASSTHROUGH=1 env var — when set, RTK execs the underlying tool directly (or runs as a no-op wrapper that streams stdout/stderr unchanged and propagates exit code). One-shot via RTK_PASSTHROUGH=1 npm test is ideal because it doesn't pollute the parent shell.
  2. --rtk-passthrough / --rtk-off CLI flag — RTK strips it from argv before invoking the wrapped tool. Useful when the agent can edit the command but not the env.
  3. RTK_DISABLE=jest (or RTK_DISABLE=*) env var — finer-grained: disable rewriting for a specific wrapped command. Helpful for users who want RTK on for tsc but off for jest.
  4. Documented exit-code/marker in the rewritten output — e.g. "to see raw output, rerun with RTK_PASSTHROUGH=1" appended to RTK's summary footer. This is what makes it agent-discoverable: the next time the agent reads condensed output and isn't satisfied, the recovery action is right there in the output it just read.

(4) is the cheapest and arguably the highest-leverage piece — without it, agents won't know the escape hatch exists; with it, they'll learn the pattern from a single observation.

Acceptance criteria

  • A single, documented mechanism to fully disable RTK rewriting for one command invocation.
  • Documented in the README under a heading an LLM is likely to retrieve (e.g. "Disabling RTK" or "Escape hatch for agents").
  • Mentioned (as a one-line hint) in RTK's own condensed output footer, so an agent reading the summary sees how to escalate to raw output.
  • Exit code of the underlying tool is preserved exactly; stdout/stderr stream through unchanged.

Related

This is adjacent to a few open issues that are essentially "RTK's rewriting silently dropped/altered output I needed" (#1772 tsc --pretty false-success, #1765 go test -cover coverage missing, #1773 empty hook output). Each of those is a real bug to fix on its own, but a generic escape hatch would also have unblocked the agent in each case as a fallback while the specific wrapper bug is being fixed.

Activity

  1. DoWhileGeek commented on May 7, 2026

    @DoWhileGeek
    Author

    If the maintainers are open to this, happy to put up a PR just let me know which shape you'd prefer (env var, flag, footer hint, or some combination) and I'll take a swing at it.

  2. bb1 commented on May 12, 2026

    @bb1

    Opened #1848 which addresses this by shipping an agent-discoverable skill (skills/raw-command-output/SKILL.md) that teaches agents to use RTK_DISABLED=1 — the per-command env prefix already supported by the binary (#345).

    The skill is installed to ~/.agents/skills/ via rtk init --opencode so agents can load it when they detect compressed/mangled output, or proactively when they know they need raw structured data (JSON, XML, etc.).

    This covers your suggested shape #1 (env var prefix, one-shot via RTK_DISABLED=1 npm test).

  3. added
    enhancement
    help wanted
    on May 27, 2026
  4. pszymkowiak commented on May 27, 2026

    @pszymkowiak
    Collaborator

    wshm · Automated triage by AI

    🔍 Automated Triage

    ✨ Category feature
    🟠 Priority high
    🎯 Confidence 95%

    Summary

    Well-scoped feature request for RTK_PASSTHROUGH escape hatch; addresses real agent-loop failure mode and has an active implementation PR (#1848) — prioritize review/merge.


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

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:cliarea:docsenhancementhelp wantedpriority:high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions