Skip to content

Plugins

Every token-reduction method in rtok is a plugin behind one trait. Plugins are in-tree modules behind Cargo features — no daemon, no subprocesses, no WASM in v0.1.

The replaces column is a specification target, never a dependency: rtok reimplements the behaviour from scratch and never runs, links, or reads the tool named.

PluginReplaces (spec only)Surface
measurertk gain, headroom savings, lean-ctx gainstats, bench, proxy
cmdrtk hook, ctx_shell, bash_compressPreToolUse(Bash) → rtok run
readlean-ctx read/search/tree, read_cacheMCP read
archiveCCRexpand, store
proxycaveman-proxyANTHROPIC_BASE_URL, OPENAI_BASE_URL
injectcaveman/ponytail, lean-ctxSessionStart, UserPromptSubmit
guardPreToolUse
memoryclaude-memMCP, PreCompact
graphcodebase-memory-mcpMCP
toonMCP

Turning plugins off

At runtime, in ~/.rtok/config.toml:

[plugins.cmd]
enabled = false

Or at build time, so the code is not compiled in at all:

cargo build --no-default-features --features cmd,read

Each plugin directory

FileHolds
README.mdwhat the plugin does and why — the pages below
AGENTS.mdinvariants and task rules for whoever works on it
PLAN.mdthe plugin’s own build plan

Writing your own: plugin authoring.