rtk-hermes
ogallotti/rtk-hermes
Hermes Agent plugin that rewrites shell commands through RTK to cut tokens in tool output
rtk-hermes is a small Hermes Agent plugin that passes terminal commands through RTK before they run, so the model receives filtered output with fewer tokens. It hooks the pre_tool_call event and falls back to the original command if anything fails.
What rtk-hermes does
rtk-hermes registers the entry point rtk-rewrite and uses the Hermes pre_tool_call hook. When the agent calls the terminal tool with a command such as git status or cargo test --nocapture, the plugin asks rtk rewrite for an equivalent, changes the command argument in place, and Hermes executes the RTK version. RTK then returns filtered output, which usually means fewer tokens in the context window. The repository description puts the savings at 60 to 90 percent.
The plugin holds no rewrite rules of its own. All logic lives in RTK, so new RTK rules apply without a plugin release. It fails open: if the rewrite does not work, the original command runs unchanged. It is published on PyPI, and the README says to install it into the same Python environment that runs Hermes. From Hermes v0.11 on, pip-distributed plugins are opt-in, so rtk-rewrite must be listed under plugins.enabled in ~/.hermes/config.yaml.
Key features
- Rewrites terminal commands through rtk rewrite before Hermes runs them
- Uses the Hermes pre_tool_call hook and edits the command in place
- Fails open, so the original command runs if the rewrite fails
- Keeps no rules of its own, so RTK updates apply without a plugin release
- Installable from PyPI or as a pinned GitHub release wheel
When to use it
- Trimming noisy test and build output before it reaches the model
- Reducing context use when the agent runs many git and shell commands
Who it is for: Hermes Agent users who run many shell commands and want shorter tool output in the model context.
How it fits with Hermes Agent
Built for Hermes Agent as a plugin on the pre_tool_call hook, and the README covers the opt-in plugin behavior of Hermes v0.11 and later.
How to install rtk-hermes
These commands are copied from the project's README. Check the repository for the latest steps before you run them.
brew install rtk
HERMES_PY="$HOME/.hermes/hermes-agent/venv/bin/python"
"$HERMES_PY" -m pip install --upgrade rtk-hermesRequirements: RTK installed, the plugin installed into the Hermes Python environment, and rtk-rewrite enabled under plugins.enabled in ~/.hermes/config.yaml
FAQ
What is rtk-hermes?
rtk-hermes is a Hermes Agent plugin that rewrites terminal commands through RTK before execution. RTK returns filtered output, which usually means fewer tokens reach the model.
How do I install rtk-hermes?
Install RTK first, for example with brew install rtk, then install rtk-hermes with pip into the same Python environment that runs Hermes. Afterwards add rtk-rewrite to plugins.enabled in ~/.hermes/config.yaml and restart Hermes or start a new session.
What happens if RTK cannot rewrite a command?
The plugin fails open, so the original command runs unchanged. All rewrite rules live in RTK, not in the plugin.
Similar plugins for Hermes Agent
All plugins23 plugins for hermes-agent covering autonomy, observability, cost control, safety and memory
robbyczgw-cla Web Search PlusHermes plugin for multi-provider web search and clean page extraction with automatic fallback
stainlu Hermes LabyrinthRead-only observability dashboard plugin for Hermes Agent that maps journeys, tool calls and failures
Humalike Humalike PluginHermes Agent plugin that adds turn-taking, persona and social learning for group chats
allmodels-io Hermes SpeechHermes Agent plugin that adds AllModels text-to-speech and speech-to-text with voice search
thomasbek3 Hermes Bot KitHermes Desktop plugins for iMessage-style chat bubbles, a live bot computer pane and roster sections
Related guides: How to install Hermes Agent · How to run Hermes Agent securely