xiantong Docs

Performance and Token Optimization

Use RTK to reduce token usage from verbose development commands

Use RTK to reduce token usage from verbose development commands.

xiantong can route Bash tool output through RTK, a local CLI that compacts common development-command output before it is sent back to the model.

RTK is useful for diffs, directory listings, search results, test logs, package-manager output, and build output. It does not make commands faster; it reduces how many output tokens the model has to read.

Requirements#

  • RTK installed locally as rtk on PATH
  • RTK version 0.23.0 or newer
  • xiantong v0.9.4 or newer

Enable RTK#

  1. Install RTK.
  2. Open Settings → AI → Performance and click Re-check.
  3. Enable Token Optimization.
  4. Run a command-heavy session.
  5. Return to settings to view saved-token statistics.

Install RTK#

macOS/Linux:

brew install rtk-ai/tap/rtk
# or
curl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/master/install.sh | sh

Windows: download rtk.exe from the RTK releases page and place it on the Windows PATH.

Troubleshooting#

If xiantong cannot find RTK, verify the binary from the same shell environment visible to the app. On Windows, Git Bash PATH and Windows PATH are different.