Install
openclaw plugins install clawhub:openclaw-snipopenclaw-snip
OpenClaw plugin that reduces LLM token consumption by 60-90% by filtering CLI output through snip.
Why
Every shell command executed by an OpenClaw agent consumes tokens. Commands like git log, go test, docker ps, or npm install produce verbose output that mostly repeats known patterns. Snip filters this output down to what matters, saving 60-90% of tokens across all models.
Install
1. Install snip
brew install edouard-claude/tap/snip
Or from source:
go install github.com/edouard-claude/snip/cmd/snip@latest
2. Install the plugin
openclaw plugins install openclaw-snip
Configuration
In your OpenClaw gateway config, under plugins.entries.openclaw-snip:
| Key | Type | Default | Description |
|---|---|---|---|
enabled | boolean | true | Enable/disable snip filtering |
snipPath | string | auto-detect | Path to snip binary |
How it works
The plugin registers a snip tool that wraps shell command execution through the snip binary. The agent's SKILL.md instructions guide it to prefer snip over exec for CLI commands.
- 22+ built-in filters for common CLI tools
- Declarative YAML filter DSL (no compiled code)
- Graceful degradation (passthrough if no filter matches)
- Exit codes always preserved
Supported commands
git, go, npm, yarn, pnpm, cargo, docker, kubectl, terraform, pip, conda, make, cmake, gcc, rustc, javac, gradle, maven, brew, apt, and more.
License
MIT
