tokenjuice ๐Ÿงƒ

May 25, 2026 ยท View on GitHub

tokenjuice banner

tokenjuice ๐Ÿงƒ

lean output compaction for terminal-heavy agent workflows.

what is tokenjuice?

tokenjuice is a deterministic output compactor for terminal-heavy agent workflows. agents and harnesses run noisy commands like git status, pnpm test, docker build, rg, or pnpm --help; tokenjuice keeps the command semantics untouched, observes the output after execution, and returns a smaller payload built from rule-driven reducers instead of dumping the whole wall of terminal text back into context.

the point is leverage: less transcript waste, fewer useless reruns, and cleaner handoff between tools without making the shell magical. raw output stays available only when you explicitly ask for it through --raw / --full or opt-in artifact storage, rules stay inspectable JSON instead of LLM vibes, and host integrations stay thin wrappers around the same core reducer instead of becoming one-off adapter logic.

host integrations

supported integrations:

LogoClientInstallHook file
ClaudeClaude Codetokenjuice install claude-code~/.claude/settings.json
CodeBuddyCodeBuddytokenjuice install codebuddy~/.codebuddy/settings.json
CodexCodex CLItokenjuice install codex~/.codex/hooks.json
CursorCursortokenjuice install cursor~/.cursor/hooks.json
DroidDroid (Factory CLI)tokenjuice install droid~/.factory/settings.json
GitHub Copilot CLIGitHub Copilot CLItokenjuice install copilot-cli~/.copilot/hooks/tokenjuice-cli.json
OpenClawOpenClawopenclaw config set plugins.entries.tokenjuice.enabled true~/.openclaw/openclaw.json
OpenCodeOpenCodetokenjuice install opencode~/.config/opencode/plugins/tokenjuice.js
pipitokenjuice install pi~/.pi/agent/extensions/tokenjuice.js
VS Code CopilotVS Code Copilot Chattokenjuice install vscode-copilot~/.copilot/hooks/tokenjuice-vscode.json

beta integrations:

LogoClientInstallHook file
AdaL CLIAdaL CLItokenjuice install adalAGENTS.md
AetherAethertokenjuice install aether.aether/tokenjuice.md / .aether/settings.json
aictlaictltokenjuice install aictlAICTL.md
AI Memory ProtocolAI Memory Protocoltokenjuice install ai-memory-protocol.memories/memory/preferences.rst
AiderAidertokenjuice install aiderCONVENTIONS.tokenjuice.md
Agent LayerAgent Layertokenjuice install agent-layer.agent-layer/instructions/tokenjuice.md; run al sync after install or uninstall
AgentInitAgentInittokenjuice install agentinitAGENTS.md; run agentinit sync after install or uninstall
AgentlinkAgentlinktokenjuice install agentlinkAGENTS.md; run agentlink sync after install or uninstall
AgentloomAgentloomtokenjuice install agentloom.agents/rules/tokenjuice-agentloom.md; run agentloom sync after install or uninstall
agents-cliagents-clitokenjuice install agents-cli~/.agents/memory/AGENTS.md; run agents sync after install or uninstall
AGENTS.mdAGENTS.mdtokenjuice install agents-mdAGENTS.md
agents.geagents.getokenjuice install agentsge.agents/rules/tokenjuice-agentsge.md
AgentsMeshAgentsMeshtokenjuice install agentsmesh.agentsmesh/rules/tokenjuice.md; run agentsmesh generate after install or uninstall
Amazon QAmazon Q Developer CLI / Kiro compatibilitytokenjuice install amazon-q.amazonq/rules/tokenjuice.md
AmpAmptokenjuice install ampAGENTS.md / AGENT.md / CLAUDE.md
AntigravityGoogle Antigravitytokenjuice install antigravity.agents/rules/tokenjuice.md
anywhere-agentsanywhere-agentstokenjuice install anywhere-agentsAGENTS.local.md; run anywhere-agents after install or uninstall
AugmentAugmenttokenjuice install augment.augment/rules/tokenjuice.md
AvanteAvante.nvimtokenjuice install avanteavante.md
BazBaztokenjuice install baz.baz/skills/tokenjuice/SKILL.md
BitoBitotokenjuice install bito.bito.yaml / .bito/tokenjuice.md
BlackboxBlackbox CLItokenjuice install blackbox.blackbox/skills/tokenjuice/SKILL.md
BlocksBlockstokenjuice install blocks.agents/skills/tokenjuice-blocks/SKILL.md
ClawdbotClawdbottokenjuice install clawdbotskills/tokenjuice/SKILL.md
IBM BobIBM Bob Shelltokenjuice install bobAGENTS.md
BuilderBuildertokenjuice install builder.builder/rules/tokenjuice.mdc
CharlieCharlietokenjuice install charlieAGENTS.md
ClineClinetokenjuice install cline~/Documents/Cline/Hooks/tokenjuice-post-tool-use
CodeAntCodeAnttokenjuice install codeant.codeant/instructions.json
CodebuffCodebufftokenjuice install codebuffAGENTS.md
CodegenCodegentokenjuice install codegenAGENTS.md
Coder AgentsCoder Agentstokenjuice install coder-agents.agents/skills/tokenjuice/SKILL.md
CodeRabbitCodeRabbittokenjuice install coderabbit.coderabbit.yaml
Command CodeCommand Codetokenjuice install command-code~/.commandcode/settings.json / .commandcode/settings.json
ContinueContinuetokenjuice install continue.continue/rules/tokenjuice.md
CrushCrushtokenjuice install crush.crush/skills/tokenjuice/SKILL.md
Deep Agents CodeDeep Agents Codetokenjuice install deepagents.deepagents/AGENTS.md
DevinDevin for Terminaltokenjuice install devin.devin/hooks.v1.json
dot-agentsdot-agentstokenjuice install dot-agents~/.agents/rules/global/rules.mdc; run dot-agents sync after install or uninstall
Docker AgentDocker Agenttokenjuice install docker-agent.docker-agent/tokenjuice.md
ECAECAtokenjuice install eca.eca/skills/tokenjuice/SKILL.md
ElyraElyratokenjuice install elyra.elyra/skills/tokenjuice/SKILL.md
Firebase StudioFirebase Studiotokenjuice install firebase-studio.idx/airules.md
ForgeCodeForgeCodetokenjuice install forgecodeAGENTS.md
GeminiGemini CLItokenjuice install gemini-cli~/.gemini/settings.json
GitLab DuoGitLab Duo Agent Platformtokenjuice install gitlab-duo.gitlab/duo/chat-rules.md
GooseGoosetokenjuice install goose.goosehints
GreptileGreptiletokenjuice install greptile.greptile/rules.md
Grok BuildGrok Buildtokenjuice install grok-buildAGENTS.md
Grok CLIGrok CLItokenjuice install grok-cli~/.grok/user-settings.json
gptmegptmetokenjuice install gptmeAGENTS.md
GitHub Copilot coding agentGitHub Copilot coding agenttokenjuice install copilot-agent.github/hooks/tokenjuice-agent.json
Jean2Jean2tokenjuice install jean2AGENTS.md
JetBrains AI AssistantJetBrains AI Assistanttokenjuice install jetbrains-ai.aiassistant/rules/tokenjuice.md
JunieJunietokenjuice install junie.junie/AGENTS.md
JulesJulestokenjuice install julesAGENTS.md
LeanCTLLeanCTLtokenjuice install leanctl.leanctl/instructions.md
KimiKimi Code CLItokenjuice install kimi~/.kimi/config.toml
KiroKirotokenjuice install kiro.kiro/steering/tokenjuice.md
Kilo CodeKilo Codetokenjuice install kilokilo.jsonc or .kilo/kilo.jsonc + .kilo/rules/tokenjuice.md
LocalCodeLocalCodetokenjuice install localcode~/.localcode/plugins/tokenjuice/
mcp-agentmcp-agenttokenjuice install mcp-agent.mcp-agent/agents/tokenjuice.md
mini-SWE-agentmini-SWE-agenttokenjuice install mini-swe-agent.mini-swe-agent/tokenjuice.yaml
SWE-agentSWE-agenttokenjuice install swe-agent.swe-agent/tokenjuice.yaml
StagewiseStagewisetokenjuice install stagewise.stagewise/skills/tokenjuice/SKILL.md
Mistral VibeMistral Vibetokenjuice install mistral-vibeAGENTS.md
MuxMuxtokenjuice install mux.mux/tool_post
NovaKitNovaKit CLItokenjuice install novakitNOVAKIT.md
KnownsKnownstokenjuice install knownsKNOWNS.md
OnaOna Agenttokenjuice install ona.ona/skills/tokenjuice/SKILL.md
OpenHandsOpenHandstokenjuice install openhands.openhands/hooks.json
Open InterpreterOpen Interpretertokenjuice install open-interpreterAGENTS.md
Open WebUIOpen WebUItokenjuice install openwebui.openwebui/tools/tokenjuice_compact.py
pi-gopi-gotokenjuice install pi-go.pi/skills/tokenjuice/SKILL.md
PlandexPlandextokenjuice install plandexPLANDEX.tokenjuice.md
QodoQodo Code Reviewtokenjuice install qodo.pr_agent.toml
QoderQoder CLItokenjuice install qoderAGENTS.md
Qwen CodeQwen Codetokenjuice install qwen-code.qwen/settings.json
ReplitReplit Agenttokenjuice install replitreplit.md
Roo CodeRoo Codetokenjuice install roo.roo/rules/tokenjuice.md
RovoRovo Dev CLItokenjuice install rovoAGENTS.md
RulerRulertokenjuice install ruler.ruler/tokenjuice.md
TabbyTabbytokenjuice install tabby~/.tabby/config.toml
TabnineTabnine CLItokenjuice install tabnineTABNINE.md
TraeTraetokenjuice install trae.trae/rules/project_rules.md
UiPathUiPath for Coding Agentstokenjuice install uipathAGENTS.md
WarpWarptokenjuice install warpAGENTS.md / WARP.md
WindsurfWindsurftokenjuice install windsurf.windsurf/rules/tokenjuice.md
ZedZedtokenjuice install zed.rules
ZencoderZencodertokenjuice install zencoder.zencoder/rules/tokenjuice.md

install

npm install -g tokenjuice
# or
pnpm add -g tokenjuice
# or
yarn global add tokenjuice
# or
brew tap vincentkoc/tap
brew install tokenjuice

then:

tokenjuice --help
tokenjuice --version
tokenjuice install [adal|aether|aictl|ai-memory-protocol|aider|agent-layer|agentinit|agentlink|agentloom|agents-cli|agents-md|agentsge|agentsmesh|amazon-q|amp|antigravity|anywhere-agents|augment|avante|baz|bito|blackbox|blocks|clawdbot|bob|builder|charlie|codex|claude-code|cline|codeant|codebuff|codegen|coder-agents|coderabbit|codebuddy|command-code|continue|copilot-agent|crush|cursor|deepagents|devin|dot-agents|docker-agent|droid|eca|elyra|firebase-studio|forgecode|gemini-cli|gitlab-duo|goose|greptile|grok-build|grok-cli|gptme|jean2|jetbrains-ai|junie|jules|leanctl|kimi|kiro|kilo|localcode|mcp-agent|mini-swe-agent|swe-agent|stagewise|mistral-vibe|mux|novakit|knowns|ona|openhands|open-interpreter|openwebui|pi|pi-go|opencode|plandex|qodo|qoder|qwen-code|replit|roo|rovo|ruler|tabby|tabnine|trae|uipath|vscode-copilot|warp|windsurf|copilot-cli|zed|zencoder]
tokenjuice uninstall [adal|aether|aictl|ai-memory-protocol|aider|agent-layer|agentinit|agentlink|agentloom|agents-cli|agents-md|agentsge|agentsmesh|amazon-q|amp|antigravity|anywhere-agents|augment|avante|baz|bito|blackbox|blocks|clawdbot|bob|builder|charlie|codex|claude-code|cline|codeant|codebuff|codegen|coder-agents|coderabbit|codebuddy|command-code|continue|copilot-agent|crush|cursor|deepagents|devin|dot-agents|docker-agent|droid|eca|elyra|firebase-studio|forgecode|gemini-cli|gitlab-duo|goose|greptile|grok-build|grok-cli|gptme|jean2|jetbrains-ai|junie|jules|leanctl|kimi|kiro|kilo|localcode|mcp-agent|mini-swe-agent|swe-agent|stagewise|mistral-vibe|mux|novakit|knowns|ona|openhands|open-interpreter|openwebui|pi|pi-go|opencode|plandex|qodo|qoder|qwen-code|replit|roo|rovo|ruler|tabby|tabnine|trae|uipath|vscode-copilot|warp|windsurf|copilot-cli|zed|zencoder]

OpenClaw support is bundled on the OpenClaw side. Do not run tokenjuice install openclaw; enable the bundled plugin instead:

openclaw config set plugins.entries.tokenjuice.enabled true

this requires OpenClaw 2026.4.22 or newer.

commands

tokenjuice --help
tokenjuice --version
tokenjuice reduce [file]
tokenjuice reduce-json [file]
tokenjuice wrap -- <command> [args...]
tokenjuice wrap --raw -- <command> [args...]
tokenjuice wrap --store -- <command> [args...]
tokenjuice install [adal|aether|aictl|ai-memory-protocol|aider|agent-layer|agentinit|agentlink|agentloom|agents-cli|agents-md|agentsge|agentsmesh|amazon-q|amp|antigravity|anywhere-agents|augment|avante|baz|bito|blackbox|blocks|clawdbot|bob|builder|charlie|codex|claude-code|cline|codeant|codebuff|codegen|coder-agents|coderabbit|codebuddy|command-code|continue|copilot-agent|crush|cursor|deepagents|devin|dot-agents|docker-agent|droid|eca|elyra|firebase-studio|forgecode|gemini-cli|gitlab-duo|goose|greptile|grok-build|grok-cli|gptme|jean2|jetbrains-ai|junie|jules|leanctl|kimi|kiro|kilo|localcode|mcp-agent|mini-swe-agent|swe-agent|stagewise|mistral-vibe|mux|novakit|knowns|ona|openhands|open-interpreter|openwebui|pi|pi-go|opencode|plandex|qodo|qoder|qwen-code|replit|roo|rovo|ruler|tabby|tabnine|trae|uipath|vscode-copilot|warp|windsurf|copilot-cli|zed|zencoder]
tokenjuice install [adal|aether|aictl|ai-memory-protocol|aider|agent-layer|agentinit|agentlink|agentloom|agents-cli|agents-md|agentsge|agentsmesh|amazon-q|amp|antigravity|anywhere-agents|augment|avante|baz|bito|blackbox|blocks|clawdbot|bob|builder|charlie|codex|claude-code|cline|codeant|codebuff|codegen|coder-agents|coderabbit|codebuddy|command-code|continue|copilot-agent|crush|cursor|deepagents|devin|dot-agents|docker-agent|droid|eca|elyra|firebase-studio|forgecode|gemini-cli|gitlab-duo|goose|greptile|grok-build|grok-cli|gptme|jean2|jetbrains-ai|junie|jules|leanctl|kimi|kiro|kilo|localcode|mcp-agent|mini-swe-agent|swe-agent|stagewise|mistral-vibe|mux|novakit|knowns|ona|openhands|open-interpreter|openwebui|pi|pi-go|opencode|plandex|qodo|qoder|qwen-code|replit|roo|rovo|ruler|tabby|tabnine|trae|uipath|vscode-copilot|warp|windsurf|copilot-cli|zed|zencoder] --local
tokenjuice uninstall [adal|aether|aictl|ai-memory-protocol|aider|agent-layer|agentinit|agentlink|agentloom|agents-cli|agents-md|agentsge|agentsmesh|amazon-q|amp|antigravity|anywhere-agents|augment|avante|baz|bito|blackbox|blocks|clawdbot|bob|builder|charlie|codex|claude-code|cline|codeant|codebuff|codegen|coder-agents|coderabbit|codebuddy|command-code|continue|copilot-agent|crush|cursor|deepagents|devin|dot-agents|docker-agent|droid|eca|elyra|firebase-studio|forgecode|gemini-cli|gitlab-duo|goose|greptile|grok-build|grok-cli|gptme|jean2|jetbrains-ai|junie|jules|leanctl|kimi|kiro|kilo|localcode|mcp-agent|mini-swe-agent|swe-agent|stagewise|mistral-vibe|mux|novakit|knowns|ona|openhands|open-interpreter|openwebui|pi|pi-go|opencode|plandex|qodo|qoder|qwen-code|replit|roo|rovo|ruler|tabby|tabnine|trae|uipath|vscode-copilot|warp|windsurf|copilot-cli|zed|zencoder]
tokenjuice ls
tokenjuice cat <artifact-id>
tokenjuice verify
tokenjuice discover
tokenjuice doctor
tokenjuice doctor hooks
tokenjuice doctor pi
tokenjuice doctor opencode
tokenjuice stats
tokenjuice stats --timezone utc

overview

tokenjuice has three surfaces. reduce compacts text that already exists, wrap runs a command and compacts the observed output, and reduce-json gives host adapters a stable machine protocol. host integrations are intentionally thin: they install a hook, extension, rule, or guidance file; call the shared compactor; and return compacted context through the host's native surface. use tokenjuice doctor hooks to check installed wiring, tokenjuice doctor <host> for one integration, and tokenjuice install <host> --local when validating the current repo build before release.

the reduction engine is rule-driven. built-in JSON rules live in src/rules, user overrides live in ~/.config/tokenjuice/rules, and project overrides live in .tokenjuice/rules; later layers override earlier ones by rule id. rules classify command output, normalize lines, keep or drop patterns, count facts, and retain deterministic head/tail slices. host adapters also apply a narrow safe-inventory policy: exact file-content reads stay raw, standalone repository inventory commands can compact, and unsafe mixed command sequences stay raw.

when a reducer gets it wrong or the task needs untouched bytes, use the explicit bypass:

tokenjuice wrap --raw -- pnpm --help
tokenjuice wrap --full -- git status

useful maintenance commands:

tokenjuice verify --fixtures
tokenjuice discover
tokenjuice doctor hooks
tokenjuice stats --timezone utc

adapter JSON

reduce-json is the machine-facing adapter command. it reads JSON from stdin or a file and always writes JSON to stdout; see the spec for envelope options and adapter behavior.

direct payload:

{
  "toolName": "exec",
  "command": "pnpm test",
  "argv": ["pnpm", "test"],
  "combinedText": "RUN  v3.2.4 /repo\n...",
  "exitCode": 1
}

docs

status

usable foundation for token reduction with diagnostics and a growing reducer set, now focused on deeper coverage and tuning.

๐Ÿ’™ built by Vincent Koc.