@4rcadia/opencode-rtkOpenCode plugin that proxies shell commands through rtk to reduce LLM token consumption.
3
37
10 in 7 days
29.5
Multi-signal model
3 months ago
2026-05-13
Install and configure
opencode.jsonWrites to this project's opencode.json — applies to this repository only.
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@4rcadia/opencode-rtk@0.1.0"]
}Writes to ~/.config/opencode/opencode.json — applies to every project.
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@4rcadia/opencode-rtk@0.1.0"]
}If you want to modify the plugin locally, install it into the project and reference the local path.
shell
pnpm add -D @4rcadia/opencode-rtkopencode loads npm dependencies through its embedded runtime on startup and caches them locally — no manual global install needed.
rtk (Rust Token Killer) proxies and filters shell commands to condense their output (less LLM token consumption). E.g., rtk git diff returns the same information with less formatting and noise. This OpenCode plugin automatically proxies supported shell commands through rtk without any extra prompting or instructions for the LLM.
Installation
Install
rtkAdd the following (or similar) to your OpenCode config file:
// opencode.json { "$schema": "https://opencode.ai/config.json", "plugin": [ "@4rcadia/opencode-rtk@latest" ] }
How It Works
The plugin intercepts OpenCode bash tool calls and rewrites supported shell commands so they run through rtk first. Unlike a regular rtk installation, using this plugin requires no extra prompting or instructions to the LLM.
The plugin is syntax-aware. It analyzes commands with unbash and tree-sitter. Complex, piped, nested commands can be handled gracefully.
Supported shells:
bashzshpowershell
Caveat
The model is not aware that commands are being proxied. There is a risk that the model may be confused if rtk fails and returns an error. However, it is observed that most mid to large models can self-correct by retrying with the command's absolute path (e.g., /usr/bin/ls instead of ls).
Use with discretion.
A standalone no_rtk_bash tool was once considered but not eventually implemented, as extra tool registration would take up more context window and might be excessive just to handle rtk's occasional failures.'