Skip to content

About

πŸ§ƒ Token weight loss. Lean output compaction for terminal-heavy agent workflows. Works as a native CLI tool or as an extension to popular coding and agent frameworks.

Topics

Resources

Contributing

Security policy

Stars

544 stars

Watchers

2 watching

Forks

Repository files navigation

tokenjuice banner

tokenjuice πŸ§ƒ

lean output compaction for terminal-heavy agent workflows.

tokenjuice runs noisy commands and returns smaller, deterministic output to your agent. JSON rules summarize listings, test output, build logs, and other terminal output. The same core powers the CLI and host integrations.

install

Requires Node.js 22 or newer.

npm install -g tokenjuice
tokenjuice --version
tokenjuice wrap -- git status

Other package managers:

pnpm add -g tokenjuice
yarn global add tokenjuice

For Homebrew:

brew tap vincentkoc/tap
brew install tokenjuice

See distribution for release artifacts and Linux packages.

host integrations

The catalog below covers CLI and editor harnesses, desktop clients, instruction formats, and framework adapters. Each name links to its setup guide. Pre-tool wrapping rewrites commands before execution; result replacement compacts captured output; guidance asks the agent to call tokenjuice wrap and is not automatic. Manual imports, retired hooks, and experimental routes are marked separately.

Support varies by host and version. The support matrix records native acceptance and remaining gaps; the verification inventory covers every installer target and alias. A passing doctor check confirms managed configuration, not host loading or model-visible output.

harness and framework catalog

Logo Harness / client / framework Integration Setup Configuration / limits
AdaL CLI AdaL CLI Guidance tokenjuice install adal AGENTS.md
Aether Aether Guidance tokenjuice install aether .aether/tokenjuice.md / .aether/settings.json
Agent Layer Agent Layer Guidance tokenjuice install agent-layer .agent-layer/instructions/tokenjuice.md; run al sync after install or uninstall
β€” AgentInit Guidance tokenjuice install agentinit AGENTS.md; run agentinit sync after install or uninstall
Agentlink Agentlink Guidance tokenjuice install agentlink AGENTS.md; run agentlink sync after install or uninstall
Agentloom Agentloom Guidance tokenjuice install agentloom .agents/rules/tokenjuice-agentloom.md; run agentloom sync after install or uninstall
agents-cli agents-cli Guidance tokenjuice install agents-cli ~/.agents/memory/AGENTS.md; run agents sync after install or uninstall
agents.ge agents.ge Guidance tokenjuice install agentsge .agents/rules/tokenjuice-agentsge.md
AGENTS.md AGENTS.md Guidance tokenjuice install agents-md AGENTS.md
AgentsMesh AgentsMesh Guidance tokenjuice install agentsmesh .agentsmesh/rules/tokenjuice.md; run agentsmesh generate after install or uninstall
β€” AI Memory Protocol Guidance tokenjuice install ai-memory-protocol .memories/memory/preferences.rst
aictl aictl Guidance tokenjuice install aictl AICTL.md
Aider Aider Guidance tokenjuice install aider CONVENTIONS.tokenjuice.md
Amazon Q Developer CLI / Kiro compatibility Amazon Q Developer CLI / Kiro compatibility Guidance tokenjuice install amazon-q .amazonq/rules/tokenjuice.md
Amp Amp Guidance tokenjuice install amp AGENTS.md / AGENT.md / CLAUDE.md
Antigma Ante Antigma Ante Guidance tokenjuice install ante project AGENTS.md or CLAUDE.md
anywhere-agents anywhere-agents Guidance tokenjuice install anywhere-agents AGENTS.local.md; run anywhere-agents after install or uninstall
Augment Augment Guidance tokenjuice install augment .augment/rules/tokenjuice.md
AutoClaw AutoClaw Manual skill setup Create a custom skill using the workflow Select the skill in a fresh conversation; execution unqualified
Avante.nvim Avante.nvim Guidance tokenjuice install avante avante.md
Baz Baz Guidance tokenjuice install baz .baz/skills/tokenjuice/SKILL.md
Bito Bito Guidance tokenjuice install bito .bito.yaml / .bito/tokenjuice.md
Blackbox CLI Blackbox CLI Guidance tokenjuice install blackbox .blackbox/skills/tokenjuice/SKILL.md
Blocks Blocks Guidance tokenjuice install blocks .agents/skills/tokenjuice-blocks/SKILL.md
Builder Builder Guidance tokenjuice install builder .builder/rules/tokenjuice.mdc
Charlie Charlie Guidance tokenjuice install charlie AGENTS.md
Claude Code Claude Code Pre-tool wrapping tokenjuice install claude-code ~/.claude/settings.json
Clawdbot Clawdbot Guidance tokenjuice install clawdbot skills/tokenjuice/SKILL.md
Cline Cline Pre-tool wrapping tokenjuice install cline ~/.cline/hooks/PreToolUse; native CLI 3.0.74 input wrapping
CodeAnt CodeAnt Guidance tokenjuice install codeant .codeant/instructions.json
CodeBuddy CodeBuddy Pre-tool wrapping tokenjuice install codebuddy ~/.codebuddy/settings.json
Codebuff Codebuff Guidance tokenjuice install codebuff AGENTS.md
Codegen Codegen Guidance tokenjuice install codegen AGENTS.md
Coder Agents Coder Agents Guidance tokenjuice install coder-agents .agents/skills/tokenjuice/SKILL.md
CodeRabbit CodeRabbit Guidance tokenjuice install coderabbit .coderabbit.yaml
Codex CLI Codex CLI Explicit wrapping tokenjuice wrap -- <command> Native 0.166.0 hooks lack exit status; automatic compaction stays off
Command Code Command Code Explicit wrapping tokenjuice wrap -- <command> Additive hook retired; scoped legacy cleanup remains available
β€” Community Grok CLI Explicit wrapping tokenjuice wrap -- <command> Automatic hook retired
Continue Continue Guidance tokenjuice install continue .continue/rules/tokenjuice.md
Crush Crush Guidance tokenjuice install crush .crush/skills/tokenjuice/SKILL.md
Cursor Cursor Pre-tool wrapping tokenjuice install cursor ~/.cursor/hooks.json
Deep Agents Code Deep Agents Code Guidance tokenjuice install deepagents .deepagents/AGENTS.md
DeepSeek Harness DeepSeek Harness Native plugin dsh plugin --profile PROFILE add <bundle> Use the packaged dist/hosts/deepseek-harness/bundle; PTC requires explicit wrapping
Devin for Terminal Devin for Terminal Pre-tool wrapping tokenjuice install devin .devin/hooks.v1.json
Docker Agent Docker Agent Guidance tokenjuice install docker-agent .docker-agent/tokenjuice.md
dot-agents dot-agents Guidance tokenjuice install dot-agents ~/.agents/rules/global/rules.mdc; run dot-agents sync after install or uninstall
Doubao Work Doubao Work Manual skill import Import the packaged Doubao Work skill Personal file/folder import; native execution unqualified
Droid (Factory CLI) Droid (Factory CLI) Pre-tool wrapping tokenjuice install droid ~/.factory/hooks.json or legacy settings
ECA ECA Guidance tokenjuice install eca .eca/skills/tokenjuice/SKILL.md
Elyra Elyra Guidance tokenjuice install elyra .elyra/skills/tokenjuice/SKILL.md
FastMCP FastMCP Python middleware pip install 'tokenjuice-integrations[fastmcp]' Add TokenjuiceMiddleware to the server or proxy; routed MCP traffic only
Firebase Studio Firebase Studio Guidance tokenjuice install firebase-studio .idx/airules.md
ForgeCode ForgeCode Guidance tokenjuice install forgecode AGENTS.md
Gemini CLI Gemini CLI Pre-tool wrapping tokenjuice install gemini-cli ~/.gemini/settings.json; BeforeTool command wrapping
GitHub Copilot CLI GitHub Copilot CLI Result replacement tokenjuice install copilot-cli native Bash replacement; 1.0.105 acceptance
GitHub Copilot coding agent GitHub Copilot coding agent Result replacement tokenjuice install copilot-agent .github/hooks/tokenjuice-agent.json
GitHub Copilot SDK GitHub Copilot SDK SDK result hook createCopilotSdkHooks() from tokenjuice/copilot-sdk Compose with application onPostToolUse hooks; successful Bash results only
GitLab Duo Agent Platform GitLab Duo Agent Platform Guidance tokenjuice install gitlab-duo .gitlab/duo/chat-rules.md
Google Antigravity Google Antigravity Guidance tokenjuice install antigravity .agents/rules/tokenjuice.md
Goose Goose Guidance tokenjuice install goose .goosehints
gptme gptme Guidance tokenjuice install gptme AGENTS.md
Greptile Greptile Guidance tokenjuice install greptile .greptile/rules.md
Grok Bot Grok Bot Experimental guidance tokenjuice install grok-bot experimental local rule; cloud skill workflow
Grok Build Grok Build Guidance tokenjuice install grok-build AGENTS.md
Hermes Hermes Native plugin Copy the packaged bundle, then hermes plugins enable tokenjuice Native user-plugin directory; transform_terminal_output
IBM Bob Shell IBM Bob Shell Guidance tokenjuice install bob AGENTS.md
Jean2 Jean2 Guidance tokenjuice install jean2 AGENTS.md
JetBrains AI Assistant JetBrains AI Assistant Guidance tokenjuice install jetbrains-ai .aiassistant/rules/tokenjuice.md
Jules Jules Guidance tokenjuice install jules AGENTS.md
Junie Junie Guidance tokenjuice install junie .junie/AGENTS.md
Kilo Code Kilo Code Guidance tokenjuice install kilo kilo.jsonc or .kilo/kilo.jsonc + .kilo/rules/tokenjuice.md
Kimi Code CLI Kimi Code CLI Explicit wrapping tokenjuice wrap -- <command> Automatic hook retired
Kiro Kiro Guidance tokenjuice install kiro .kiro/steering/tokenjuice.md
Knowns Knowns Guidance tokenjuice install knowns KNOWNS.md
LangChain LangChain Python middleware pip install 'tokenjuice-integrations[langchain]' Add TokenjuiceMiddleware with an explicit shell-result decoder
β€” LeanCTL Guidance tokenjuice install leanctl .leanctl/instructions.md
LocalCode LocalCode On-demand tool (beta) tokenjuice install localcode ~/.localcode/plugins/tokenjuice/
Mastra Mastra Output processor createMastraProcessor() from tokenjuice/mastra Add to outputProcessors with application decoder/replacement callbacks
mcp-agent mcp-agent Guidance tokenjuice install mcp-agent .mcp-agent/agents/tokenjuice.md
mini-SWE-agent mini-SWE-agent Guidance tokenjuice install mini-swe-agent .mini-swe-agent/tokenjuice.yaml
Mistral Vibe Mistral Vibe Guidance tokenjuice install mistral-vibe AGENTS.md
Mux / Xum Mux / Xum Explicit wrapping tokenjuice wrap -- <command> Automatic hook retired
β€” NovaKit CLI Guidance tokenjuice install novakit NOVAKIT.md
Ona Agent Ona Agent Guidance tokenjuice install ona .ona/skills/tokenjuice/SKILL.md
Open Interpreter Open Interpreter Guidance tokenjuice install open-interpreter AGENTS.md
Open WebUI Open WebUI Manual tool import (beta) tokenjuice install openwebui .openwebui/tools/tokenjuice_compact.py; then import in Workspace Tools
OpenClaw OpenClaw External plugin openclaw plugins install @openclaw/tokenjuice ~/.openclaw/openclaw.json; enable plugin and restart Gateway (see below)
OpenCode V1 OpenCode V1 Result replacement tokenjuice install opencode ~/.config/opencode/plugins/tokenjuice.js
OpenCode V2 OpenCode V2 Result replacement tokenjuice install opencode-v2 foreground shell result replacement; native v2.0.18 acceptance
OpenHands OpenHands Explicit wrapping tokenjuice wrap -- <command> Manual wrapping; legacy hook cleanup
pi pi Result replacement tokenjuice install pi ~/.pi/agent/extensions/tokenjuice.js
β€” pi-go Guidance tokenjuice install pi-go .pi/skills/tokenjuice/SKILL.md
Plandex Plandex Guidance tokenjuice install plandex PLANDEX.tokenjuice.md
QClaw QClaw Migration only Follow the WorkBuddy migration guide No QClaw hook installer; qualify WorkBuddy separately
Qoder (guidance) Qoder (guidance) Guidance tokenjuice install qoder AGENTS.md; use qoder-cli for the replacement hook
Qoder CLI Qoder CLI Result replacement tokenjuice install qoder-cli Native PostToolUse; separate from Qoder guidance below
QoderWork skills QoderWork skills Guidance tokenjuice install qoderwork guidance skill at ~/.qoderwork/skills/tokenjuice/SKILL.md
Qodo Code Review Qodo Code Review Guidance tokenjuice install qodo .pr_agent.toml
Qwen Code Qwen Code Pre-tool wrapping tokenjuice install qwen-code .qwen/settings.json
QwenWork QwenWork Guidance tokenjuice install qwenwork guidance skill at ~/.qwenwork/skills/tokenjuice/SKILL.md
Replit Agent Replit Agent Guidance tokenjuice install replit replit.md
Roo Code Roo Code Guidance tokenjuice install roo .roo/rules/tokenjuice.md
Rovo Dev CLI Rovo Dev CLI Guidance tokenjuice install rovo AGENTS.md
β€” Ruler Guidance tokenjuice install ruler .ruler/tokenjuice.md
Stagewise Stagewise Guidance tokenjuice install stagewise .stagewise/skills/tokenjuice/SKILL.md
SWE-agent SWE-agent Guidance tokenjuice install swe-agent .swe-agent/tokenjuice.yaml
T3 Code T3 Code Provider integration Configure the selected Codex, Claude Code or OpenCode provider Install on the machine executing tools; no separate T3 installer
Tabby Tabby Guidance tokenjuice install tabby ~/.tabby/config.toml
Tabnine CLI Tabnine CLI Guidance tokenjuice install tabnine TABNINE.md
Trae Trae Guidance tokenjuice install trae .trae/rules/project_rules.md
UiPath for Coding Agents UiPath for Coding Agents Guidance tokenjuice install uipath AGENTS.md
VS Code Copilot Chat (Local) VS Code Copilot Chat (Local) Pre-tool wrapping tokenjuice install vscode-copilot ~/.copilot/hooks/tokenjuice-vscode.json
Warp Warp Guidance tokenjuice install warp AGENTS.md / WARP.md
Windsurf Windsurf Guidance tokenjuice install windsurf .windsurf/rules/tokenjuice.md
WorkBuddy WorkBuddy Manual skill import Import the packaged WorkBuddy skill Desktop import and execution unqualified; separate from CodeBuddy CLI
Zed Zed Guidance tokenjuice install zed .rules
Zencoder Zencoder Guidance tokenjuice install zencoder .zencoder/rules/tokenjuice.md

Logos use locally stored, padded tiles for light and dark themes. A dash means no verified project mark is available; see logo sources and standards.

installation notes

For example, Claude Code uses pre-tool command wrapping:

tokenjuice install claude-code
tokenjuice doctor claude-code

Restart the host or start a fresh session as its guide requires. A successful doctor check confirms managed configuration. It does not prove that the host loaded it or delivered compacted output. Use tokenjuice uninstall claude-code to remove tokenjuice's managed wiring.

OpenClaw uses the external @openclaw/tokenjuice plugin:

openclaw plugins install @openclaw/tokenjuice
openclaw config set plugins.entries.tokenjuice.enabled true
openclaw gateway restart

Match the plugin to your OpenClaw version. See the OpenClaw guide for host compatibility.

The OpenClaw adapter compacts shell results, not Code Mode JavaScript results. Code Mode inputs carrying code pass through unchanged, even when OpenClaw also supplies that JavaScript in a command alias. Genuine shell command inputs still use the normal compaction and inspection-output protections.

commands

tokenjuice --help
tokenjuice reduce build.log
tokenjuice reduce-json result.json
tokenjuice wrap -- pnpm test
tokenjuice wrap --keep-failures -- pnpm test
tokenjuice wrap --raw -- git status
tokenjuice wrap --store -- pnpm test
tokenjuice doctor hooks
tokenjuice stats --timezone utc
tokenjuice verify --fixtures
tokenjuice discover

reduce compacts existing text. wrap runs a command and compacts its observed output. reduce-json provides the machine protocol for adapters. See the spec for options, JSON envelopes, rules, and storage behavior.

output and storage

Host integrations preserve exact file reads and apply their documented compaction policy to eligible output. Use --keep-failures to preserve failed commands' stdout, stderr, and exit status within the capture limit. Automatic pre-tool wrappers enable this option.

--raw and its alias --full bypass reduction. They still obey the capture limit, which defaults to 4mb. Increase --max-capture-bytes when you need a larger capture.

Raw artifact storage is opt-in through --store. The Pi extension is the exception: it stores the raw bytes of every rewrite for retrieval with tokenjuice cat <artifact-id>. Set TOKENJUICE_ARTIFACT_DIR to choose the artifact directory.

Statistics use bounded metadata segments. tokenjuice stats --limit 1000 reports partial coverage and a cursor for the next page. Set TOKENJUICE_STATS=off or pass --no-stats to disable metadata and hook-debug telemetry writes.

Rules load from built-ins, ~/.config/tokenjuice/rules, and .tokenjuice/rules. Later layers override earlier rules by ID. See rule authoring.

docs

πŸ’™ built by Vincent Koc.

About

πŸ§ƒ Token weight loss. Lean output compaction for terminal-heavy agent workflows. Works as a native CLI tool or as an extension to popular coding and agent frameworks.

Topics

Resources

Contributing

Security policy

Stars

544 stars

Watchers

2 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages