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
Real-world numbers from rtk discover --all --since 30:
Pattern
Calls (30d)
env -u VAR ... <cmd>
92
The env prefix (used to unset/override environment variables before invoking another binary, e.g. env -u HTTP_PROXY -u HTTPS_PROXY curl ...) is a common workaround in environments where certain env vars need to be stripped for specific commands. Today this prefix prevents rtk from rewriting the inner command, because the rewrite engine matches on the leading token, sees env, and bails out.
This mirrors what rtk already does for direct invocations, but lets the env prefix pass through transparently. The savings come from the inner command's normal RTK filter (curl, go, node, etc.), not from env itself.
Methodology: counts come from rtk discover --all --since 30 against the local Claude Code transcript directory.
Feature request to support env -u VAR/env VAR=val command prefix passthrough so rtk can still rewrite the inner command; well-scoped with usage data and clear spec.
Triaged automatically by wshm · This is an automated analysis, not a human review.
Hi, @mshogin! I found a workaround that preserves the native env behavior without requiring RTK to implement or emulate it.
Instead of:
rtk env X=Y cargo test
the agent should place the environment prefix before RTK:
env X=Y rtk cargo test
The system env command sets the variable for the RTK process, and RTK passes that environment through to the command it dispatches. This allows cargo test—or any other supported command—to keep benefiting from RTK's token-saving filters.
The underlying issue is that the current agent context says to always place rtk at the beginning, which can lead agents to generate rtk env ... and bypass filtering for the inner command.
I've created a pull request at #3706, regardless of whether my PR is accepted by the maintainer, we can use a workaround by modifying the context on our local device or explicitly informing the Agent during the session.
Closing in favour of #4099, which asks for the same thing, rewriting through env -u VAR <cmd> while keeping the env prefix. PR #4115 implements it there. env VAR=val already rewrites today. Please follow up on #4099.
Activity
pszymkowiak commentedon Apr 29, 2026
🔍 Automated Triage
featuremediumSummary
Feature request to support
env -u VAR/env VAR=valcommand prefix passthrough so rtk can still rewrite the inner command; well-scoped with usage data and clear spec.Triaged automatically by wshm · This is an automated analysis, not a human review.
fu050409 commentedon Aug 25, 2026
I’ve encountered a similar situation: in the development of some projects, the Agent makes extensive use of commands with the
envprefix.fu050409 commentedon Aug 25, 2026
Hi, @mshogin! I found a workaround that preserves the native
envbehavior without requiring RTK to implement or emulate it.Instead of:
rtk env X=Y cargo testthe agent should place the environment prefix before RTK:
env X=Y rtk cargo testThe system
envcommand sets the variable for the RTK process, and RTK passes that environment through to the command it dispatches. This allowscargo test—or any other supported command—to keep benefiting from RTK's token-saving filters.The underlying issue is that the current agent context says to always place
rtkat the beginning, which can lead agents to generatertk env ...and bypass filtering for the inner command.I've created a pull request at #3706, regardless of whether my PR is accepted by the maintainer, we can use a workaround by modifying the context on our local device or explicitly informing the Agent during the session.
refactor(cmdline): peel transparent wrappers with a generic walker ov…
KuSh commentedon Oct 3, 2026
Closing in favour of #4099, which asks for the same thing, rewriting through
env -u VAR <cmd>while keeping the env prefix. PR #4115 implements it there.env VAR=valalready rewrites today. Please follow up on #4099.refactor(cmdline): peel transparent wrappers with a generic walker ov…
refactor(cmdline): peel transparent wrappers with a generic walker ov…
refactor(cmdline): peel transparent wrappers with a generic walker ov…
refactor(cmdline): peel transparent wrappers with a generic walker ov…
refactor(cmdline): peel transparent wrappers with a generic walker ov…
refactor(cmdline): peel transparent wrappers with a generic walker ov…
refactor(cmdline): peel transparent wrappers with a generic walker ov…
refactor(cmdline): peel transparent wrappers with a generic walker ov…
refactor(cmdline): peel transparent wrappers with a generic walker ov…
refactor(cmdline): peel transparent wrappers with a generic walker ov…
refactor(cmdline): peel transparent wrappers with a generic walker ov…
refactor(cmdline): peel transparent wrappers with a generic walker ov…
refactor(cmdline): peel transparent wrappers with a generic walker ov…
refactor(cmdline): peel transparent wrappers with a generic walker ov…