Skip to main content

Documentation Index

Fetch the complete documentation index at: https://agents.craft.do/docs/llms.txt

Use this file to discover all available pages before exploring further.

Craft Agents can route Bash tool output through RTK, a local CLI that compresses common development-command output before it is sent back to the model. This is useful when a session runs commands that produce lots of repetitive text: diffs, directory listings, search results, test logs, package-manager output, and build output. RTK does not make commands run faster; it reduces how many output tokens the model has to read and pay attention to.
Craft Agents checks and permission-prompts the original command. RTK only changes the output path used for the model context.

Why enable RTK?

Verbose tool output is one of the easiest ways to burn context. For example:
git diff
rg "TODO|FIXME" .
bun test
npm install
ls -R
Without RTK, the full raw output is appended to the conversation. With RTK enabled, Craft Agents invokes the local rtk binary to rewrite eligible Bash commands so their output is compacted before it reaches the model. Typical benefits:
  • Lower token usage for common development commands
  • More usable context left for code and reasoning
  • Less noise from repetitive logs, huge diffs, and long file listings
  • Visibility in Settings through RTK’s saved-token / efficiency stats
RTK is most useful for coding and repository-maintenance sessions. It helps less for commands that already print short, targeted output.

Requirements

  • RTK installed locally as rtk on your system PATH
  • RTK version 0.23.0 or newer
  • Craft Agents v0.9.4 or newer
Craft Agents does not bundle RTK. It detects the rtk executable on PATH and invokes it locally with telemetry disabled for Craft Agents’ rewrite and stats calls.
You do not need to run rtk init for Craft Agents. rtk init installs hooks for other tools; Craft Agents calls rtk rewrite directly when the Performance toggle is enabled.

Enable RTK in Craft Agents

  1. Install RTK for your operating system.
  2. Open Settings → AI → Performance and click Re-check. If you edited PATH environment variables, restart Craft Agents first so the desktop process sees the new PATH.
  3. Enable Token Optimization.
  4. Run a command-heavy session.
  5. Return to Settings → AI → Performance to view saved-token stats once RTK has processed commands.
If Craft Agents still shows Get RTK, the rtk binary is either missing, below the required version, or not visible on the PATH used by the desktop app.

Install RTK

Homebrew is the simplest option:
brew install rtk-ai/tap/rtk
Or use RTK’s install script:
curl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/master/install.sh | sh
Verify:
which rtk
rtk --version
rtk gain

Windows PowerShell notes

If you are verifying from Windows PowerShell 5.1:
  • Use Get-Command rtk or where.exe rtk; which is not a PowerShell command.
  • Use ; between commands instead of Bash-style &&.
Example:
Get-Command rtk; rtk --version; rtk gain

Troubleshooting

Click Re-check in Settings → AI → Performance. If it still fails, verify rtk from the same operating-system shell Craft Agents can see:
  • macOS/Linux: which rtk && rtk --version
  • Windows: Get-Command rtk; rtk --version
On Windows, make sure the folder is on the Windows PATH, not only on Git Bash/MSYS PATH.
Check the version. Craft Agents requires RTK 0.23.0 or newer because it depends on rtk rewrite.
Make sure you installed Rust Token Killer (rtk-ai/rtk), not the unrelated Rust Type Kit package with the same binary name. The correct RTK supports rtk gain.
No. Craft Agents does not require rtk init; it uses the installed rtk binary directly. You only need rtk init if you also want RTK hooks for another tool that uses RTK that way.