GitHub

RTK Output Compression for AI Coding Agents

Guarded rewriting, decision-ready filters, and recoverable output

8 chapters77 min total
Keywords
RTKFilteringRewritingContextPermissionsRecoveryShellAnalyticsPrivacyTelemetry
Overview

RTK is a Rust CLI proxy that changes how Git, Cargo, tests, linters, searches, and other development tools present output to AI coding agents; it does not replace those tools. The series follows that boundary from agent request and host permission through shell-aware rewriting, command-specific filtering, exit-status and encoding safeguards, and raw fallback. It then shows how recall storage and local analytics make intentional omission reversible and how trust-gated custom filters and opt-in aggregate telemetry shape privacy. The central conclusion is conditional: RTK is useful when supported, authorized transformations remove repetitive output while preserving decision-relevant evidence, and it is not a universal 90% cost reduction or a sandbox.

Learning outcomes
  • RTK reduces repetitive command output, but it cannot promise an equal reduction in total context or provider billing.
  • Safe use requires separate authorization, shell-semantic, and output-fidelity checks.
  • Raw passthrough is a valid result when RTK cannot establish a faithful rewrite or useful reduction.
  • Adoption is strongest when supported filters preserve decision evidence and users retain raw, bypass, trust, and privacy controls.
Keywords
RTKFilteringRewritingContextPermissionsRecoveryShellAnalyticsPrivacyTelemetry

Chapters

Preview every chapter · Unlock full text, audio, and video from chapter 4

Plans
Ch.1-3 FreeCh.4-8 Premium

FAQ

What does RTK do for AI coding agents?

RTK rewrites supported development commands and filters their output before it enters the agent's context, while the underlying tool still performs the operation.

How does RTK decide whether a command is safe to rewrite?

RTK checks host permission separately, then analyzes supported shell forms, wrappers, operators, redirects, arguments, and pipeline use; when equivalence is uncertain, it leaves the command raw.

What does RTK's 90% savings claim measure?

It measures estimated raw versus filtered shell output using bytes divided by four, not the full prompt, system context, conversation, model response, or provider bill.

Can RTK recover output it hides from an agent?

Often, yes: on failures or deliberate truncation, RTK can store a bounded raw payload and emit `rtk recall <hash>`; disabled, unavailable, or capped storage limits recovery.

What privacy controls does RTK provide?

RTK keeps detailed operational analytics local and makes network telemetry opt-in and aggregate; users can disable telemetry, choose recovery storage, and review or revoke trust for custom filters.