On this page
On this page
Tools
Tokenjuice
tokenjuice is an optional external plugin that compacts noisy exec and bash
tool results after the command has already run.
It changes the returned tool_result, not the command itself. Tokenjuice does
not rewrite shell input, rerun commands, or change exit codes.
Today this applies to OpenClaw embedded runs and OpenClaw dynamic tools in the Codex
app-server harness. Native codex-rs shell (bash/exec) results returned to the
model are not compacted. Native PostToolUse events can run the middleware for
observers, but Codex does not accept a replacement tool response.
Enable the plugin
Install once:
Then enable it:
Equivalent:
If you prefer editing config directly:
What tokenjuice changes
- Compacts noisy
execandbashresults before they are fed back into the session. - Keeps the original command execution untouched.
- Applies a safe-inventory policy: exact file-content reads stay raw, standalone repository-inventory commands can compact, and unsafe mixed command sequences stay raw.
- Stays opt-in: disable the plugin if you want verbatim output everywhere.
The plugin releases Tokenjuice's compiled rule cache after results have used 128 distinct selected working directories. Ignored fallback directories do not count toward this limit. This bounds retained rule sets from old worktrees while preserving reuse for repeated results within the current set. After a release, active projects reload their rules on the next eligible result. Rule selection still uses the command's working directory.
Verify it is working
- Enable the plugin.
- Start a session that can call OpenClaw's
exectool, either in an embedded run or as a dynamic tool in the Codex app-server harness. - Run a noisy command such as
git status. - Check that the returned tool result is shorter and more structured than the raw shell output.
Native codex-rs shell results stay unchanged, so this check does not apply to them.
Disable the plugin
Or: