RTK
Parent: Integrations.
RTK rewrites common shell commands into token-efficient forms before they run. When the rtk binary is on your PATH, Rho uses it automatically for agent shell tools. You do not run rtk init, install host hooks, or change prompts.
Install RTK
Install the rtk binary with the method you prefer from the RTK project, then confirm it is on PATH:
rtk --versionRho needs RTK 0.23 or newer so rtk rewrite is available. Older versions are treated as unavailable.
Rewritten commands run in bash -lc, so rtk must also be on your login shell's PATH, not only one set by .bashrc or an interactive-only activation.
What Rho does
When RTK is available and enabled:
- Before
bashorpowershellasks for permission, Rho callsrtk rewriteon the command string. - If rewrite returns a different non-empty command, that rewritten form is what the permission mode checks and what runs. An approval prompt shows
rtk git status, notgit status. - After the command finishes, Rho writes RTK-compatible analytics records so
rtk gainandrtk discovercan account for Rho shell use.
The tool card and the transcript keep the command the agent wrote. Hooks get both: shell_command is the rewritten command that runs, and requested_command is the one the agent wrote, present only when RTK rewrote it. A deny hook that anchors on ^git push should check requested_command when it is set, so it still blocks rtk git push. The Auto classifier also sees both, judges the agent's intent by the command it wrote, and denies a rewrite that does more than run that command with compacted output. Approval, including Allow for session, still applies to the rewritten command that runs.
Commands that already start with rtk are left unchanged. Empty commands are not rewritten. Rewrite is skipped when the environment the command runs in sets RTK_DISABLED=1: your shell's, or for a daemon session the environment of the client that last prompted it.
Rho does not rewrite:
- inline shell commands you type in the TUI
- in-process tools such as
grepandglob(prefer those for workspace search)
Rewritten commands still go through the normal shell path, so RTK records savings through its usual rtk gain path.
SDK hosts that build the shell tool with rho_agent_tools::shell_tool opt in with ShellToolOptions::rtk(true). It is off by default.
Example
Without RTK, an agent might run:
git statusWith RTK available, Rho may rewrite that to:
rtk git statusThe agent still requested git status. The rewrite is an execution detail.
Configuration
[behavior].rtk in ~/.rho/config.toml defaults to true:
[behavior]
rtk = trueSet rtk = false to leave shell commands unchanged even when the binary is installed. Toggle it under /config → Tools → RTK, edit config.toml, or set RTK_DISABLED=1. See configuration.
For a one-off disable without editing config, set RTK_DISABLED=1 in the environment.
Analytics and discover
Rewritten runs participate in RTK's savings history through the RTK binary.
Rho also writes discover-compatible command records under the Claude projects directory so rtk discover can include Rho shell commands:
~/.claude/projects/<encoded-cwd>/rho-sessions/rho-<pid>-<uuid>.jsonlSet CLAUDE_CONFIG_DIR to override the default ~/.claude root used by both Rho and RTK.
These records store the command string and a placeholder sized to the tool output length. They do not copy command output text.
"No hook installed" warning
RTK 1.x warns No hook installed — run `rtk init -g` when ~/.claude exists without its Claude Code hook. Rho's discover records create that directory, so rtk gain and rtk discover can show the warning on machines that only use Rho. Rho does not need the hook. To hide the warning, set this in RTK's own config (rtk config shows the path):
[hooks]
suppress_hook_warning = trueOr export RTK_SUPPRESS_HOOK_WARNING=1. Either one hides only the missing-hook warning, not RTK's outdated-hook prompt.
Check the integration
In the interactive TUI, run /doctor. The rtk row reports:
| Status | Meaning |
|---|---|
available | rtk --version succeeds and supports rewrite |
unavailable | Binary missing, too old, or not runnable |
disabled | [behavior].rtk = false; Rho does not probe the binary |
Unavailable and disabled are not errors; both show as informational rows. In both cases Rho runs shell commands unchanged.
Related
- Integrations - other built-in integrations
- Configuration - the
rtkconfig key - Tools and workspace - shell tools and permission modes
- Search tools - in-process search that does not need RTK
- Interactive TUI -
/doctorand/config