rust token killer / exact-output lab
RTK output lab
See exactly what an AI agent receives with and without RTK. Pick a command — the panes below show the raw terminal output next to what the pinned RTK release returns instead.
Pick a command
Each example is generated by running RTK against a deterministic fixture, so the panes stay tied to the same formatter code as the CLI.
$ git statusOn branch main
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: src/math.ts
Untracked files:
(use "git add <file>..." to include in what will be committed)
docs/
sample.json
src/app.ts
no changes added to commit (use "git add" and/or "git commit -a")$ rtk git status* main
~ Modified: 1 files
src/math.ts
? Untracked: 3 files
docs/
sample.json
src/app.tsunder the hood
Where the output changes
RTK sits between the shell command and the agent context. These four steps explain why the two panes above are different.
- 01ask
The agent asks for the normal command
In hook mode, the assistant can request a familiar shell command such as git status. RTK's hook can rewrite that request before the shell executes it.
note The input shown in the examples is the command being compared; it is not pulled from personal command history.
- 02route
RTK receives the equivalent command
RTK routes the request to a command-specific handler: git status, git diff, grep, json, read, smart, and other modules each have their own output strategy.
note This page uses explicit RTK commands so the before/after comparison is reproducible.
- 03run
The handler gets source output
Proxy handlers execute the real CLI and capture stdout/stderr. Built-in handlers read files, JSON, logs, or command output directly before formatting it.
note The examples are generated by running the pinned RTK release against a deterministic synthetic fixture.
- 04filter
Output is rewritten for the context window
The output can become shorter, grouped, reordered, or annotated. The goal is not byte-for-byte fidelity; it is lower-noise output for an agent.
note For exact raw terminal output, run the command without RTK.