RTK (Rust Token Kit) for Openclaw

A high-performance Rust-based proxy that compresses command-line output to drastically reduce LLM token costs.

radicalgeek
v1.0.0
Mar 20, 2026
0
1.8k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install rtk

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install rtk using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is RTK (Rust Token Kit)?

RTK (Rust Token Kit) is an essential utility for developers using AI coding agents, designed to bridge the gap between verbose CLI outputs and limited LLM context windows. By acting as a smart proxy, RTK intercepts the output of standard development tools and applies advanced compression algorithms to strip away noise while preserving critical semantic information.

Integrating this tool into your Openclaw Skills workflow allows for a significantly more efficient development cycle. It transforms massive logs from test runners, linters, and version control systems into compact, high-signal snippets, ensuring your AI agent stays focused on problem-solving rather than parsing boilerplate text.

RTK (Rust Token Kit) Use Cases

  • Reducing token burn when performing frequent git status or git diff operations.
  • Compressing verbose test failure logs from npm, cargo, or pytest to fit within context limits.
  • Summarizing large directory structures or file contents for AI analysis.
  • Cleaning up Docker and Kubernetes logs to focus on errors and deduplicated events.
  • Monitoring token savings and command history through integrated analytics.

How RTK (Rust Token Kit) Works

  1. The user or agent prefixes a standard CLI command with rtk (e.g., rtk git status).
  2. RTK intercepts the command execution and captures the raw stdout and stderr.
  3. A command-specific filter is applied to remove progress bars, whitespace, and redundant boilerplate.
  4. If a command fails, RTK automatically saves the full, unfiltered output to a local tee log for debugging.
  5. The compressed, high-signal output is returned to the terminal/agent context.
  6. Token savings are calculated and stored in a local database for analytics reporting.

RTK (Rust Token Kit) Setup

RTK is distributed as a single Rust binary. To verify your installation or check your current version, use the following commands:

# Verify installation
rtk --version

# Check initial token savings stats
rtk gain

If you need to configure custom behavior, you can edit the configuration file at ~/.config/rtk/config.toml to manage hooks or log rotation.

RTK (Rust Token Kit) Data Schema & Taxonomy

RTK manages local data to provide analytics and debugging persistence. Its data taxonomy is organized as follows:

Component Location Description
Analytics DB ~/.local/share/rtk/stats.db SQLite database tracking command history and token savings.
Tee Logs ~/.local/share/rtk/tee/ Storage for full, unfiltered logs from failed commands.
Config ~/.config/rtk/config.toml Global settings for filtering, hooks, and exclusions.

Users can interact with this data using Openclaw Skills commands like rtk gain --history.

RTK (Rust Token Kit) Advanced Features

  • Ultra-compact mode: Use the -u flag for minimalist ASCII-based output formats.
  • Smart File Reading: Multiple levels of compression (e.g., signatures only) for large source files.
  • Heuristic Summarization: A summary mode for unknown or custom commands not natively supported.
  • Interactive Filtering: Pipe-like filtering for environment variables and complex outputs.
  • Token Analytics: Built-in graphing tools to visualize daily and monthly token savings.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*