-
Notifications
You must be signed in to change notification settings - Fork 43
Home
Edouard CLAUDE edited this page Sep 3, 2026
·
9 revisions
The extensible LLM token optimizer. CLI proxy that filters shell output before it reaches your AI coding assistant's context window.
AI coding agents burn tokens on verbose shell output that adds zero signal. snip sits between your AI tool and the shell, filtering output through declarative YAML pipelines before it reaches the context window.
132 filters, 20 pipeline actions, 15 CLI commands, 13 AI integrations.
Measured on a real Claude Code session: 128 commands, 2.3M tokens saved, 99.8% average savings.
- Installation - curl install, Homebrew, binary, from source
- Integration - Claude Code, Cursor, Codex, Windsurf, Cline, OpenCode, OpenClaw, standalone
- Gain Dashboard - Token savings reports and analytics
- Learn - Detect CLI error-correction patterns, generate agent rules
- Filters - 132 built-in filters, pipeline actions, custom filters
- Filter DSL Reference - Complete YAML schema and 20 action reference
- Configuration - TOML config, environment variables
- Architecture - Design decisions, internals, data flow
- Contributing - Development setup, adding filters, conventions
# Quick install (macOS/Linux)
curl -fsSL https://raw.githubusercontent.com/edouard-claude/snip/master/install.sh | sh
# Or via Homebrew
brew install edouard-claude/tap/snip
# Or with Go
go install github.com/edouard-claude/snip/cmd/snip@latestThen hook into your AI tool:
snip init # Claude Code (default)
snip init --agent cursor # Cursor
snip init --agent codex # OpenAI Codex
snip init --agent pi # Pi
snip init --agent windsurf # Windsurf
snip init --agent cline # Cline / Roo Code
snip init --agent copilot # GitHub Copilot
snip init --agent gemini # Gemini CLI
snip init --agent kilocode # Kilo Code
snip init --agent antigravity # Antigravity
snip init --agent grok # Grok| Command | Description |
|---|---|
snip <command> |
Run command through filter pipeline (implicit) |
snip run |
Run command through snip filter pipeline (use -- to separate) |
snip check |
Check if a command would be filtered (use -- to separate) |
snip init |
Install agent integration (default: claude-code) |
snip hook |
Handle agent PreToolUse/shell hook |
snip hook-audit |
Show recent hook activity (set SNIP_HOOK_AUDIT=1 to log) |
snip gain |
Show token savings report |
snip cc-economics |
Show financial impact of token savings by API tier |
snip discover |
Scan sessions for missed filter opportunities |
snip learn |
Detect CLI error-correction patterns in sessions |
snip verify |
Run inline filter tests (--require-all to enforce coverage) |
snip config |
Show current configuration |
snip trust |
Trust project-local filter file(s) by SHA-256 hash |
snip untrust |
Remove filter file(s) from the trust store |
snip proxy |
Passthrough without filtering (optional -- separator) |
snip inspect |
Code quality checks for snip's own source |
┌─────────────┐ ┌─────────────────┐ ┌──────────────┐ ┌────────────┐
│ Claude Code │────>│ snip intercept │────>│ run command │────>│ filter │
│ runs git │ │ match filter │ │ capture I/O │ │ pipeline │
└─────────────┘ └─────────────────┘ └──────────────┘ └─────┬──────┘
│
┌─────────────────┐ ┌──────────────┐ │
│ Claude Code │<────│ track savings│<──────────┘
│ sees filtered │ │ in SQLite │
└─────────────────┘ └──────────────┘