# RTK-AI Token Saver

> Connect an agent to it and the output of its git, ls, grep and test commands comes back compressed — fewer tokens, same facts.

Source: https://docs.neurosquad.ai/en/plugins/rtk-ai-token-saver

Agents read a lot of command output: every `git status`, `git log`, directory listing and test run
lands in their context. The **RTK-AI Token Saver** plugin routes an agent's shell commands through
[RTK](https://github.com/rtk-ai/rtk), an open-source tool that keeps the facts and drops the noise —
`git status` becomes a compact list of changed files, a passing test suite becomes one line.

## How to use it

1. In the add-card menu choose **Plugins**, open **RTK-AI Token Saver** in the **Plugins** tab and
press **Add to canvas**.
2. If RTK isn't installed, press **Download RTK**. NeuroSquad downloads the official build from
GitHub (about 4.5 MB) and checks it against the checksum GitHub publishes — without a checksum it
refuses to download. Already have RTK (`winget install rtk-ai.rtk`, `brew install rtk`)? It's
found automatically.
3. Draw an [arrow](https://docs.neurosquad.ai/en/canvas/arrows) from an agent to the card.

That's it — the agent's **next** command already goes through RTK. No restart. Remove the arrow and
the next command runs as usual again.

## What the card shows

- **How much less output** the connected agents read, in percent, and roughly how many tokens that
saved.
- Each connected agent with its own savings and the last command RTK compressed, for example
`git status → rtk git status`.
- Which RTK version is in use, and whether it's your own install or the downloaded one.

Each compressed command also flashes on the arrow and is listed in the arrow's log.

> RTK estimates tokens as bytes ÷ 4, so the percentage is accurate and the token count is
> approximate. RTK compresses the output of shell commands only — your prompts, the agent's own
> file reads and its answers are unchanged.

## Which agents it works with

It works live with **Claude Code**, **Cursor CLI**, **OpenCode**, **Kilo Code**, **MiMo Code** and **ZCode**. Other agents can
be connected, but the card marks them **Not supported** — their CLIs don't offer a way to rewrite a
command before it runs yet.

- **Dangerous mode** — every supported command is compressed.
- **Normal mode (Claude Code)** — read-only commands such as `git status`, `git log`, `ls`, `cat`
and `grep` are compressed with no prompt, exactly as they ran before. Commands that would have
asked you anyway (`git push`, `cargo test`…) still ask once — you approve the `rtk` version. Anything
else runs unchanged. RTK never adds a prompt and never approves something that would have asked.
- **Normal mode (Cursor, OpenCode, Kilo, MiMo Code, ZCode)** — their permission prompts can't be predicted from
outside, so RTK works for them in dangerous mode only.
- **Canvas mode** — the agent has no shell of its own, so there is nothing to compress.

If RTK is missing, fails or doesn't know a command, the original command runs unchanged. An agent
that needs the full output of one command can run it with `RTK_DISABLED=1` in front.

## Privacy

RTK runs on your computer. NeuroSquad turns RTK's own (opt-in) telemetry off for every agent it
starts and keeps RTK's history per agent inside NeuroSquad's data folder. Your RTK settings stay as
they are.

RTK is made by rtk-ai and published under the Apache 2.0 license.
