The Distillery. A Token Optimization Proxy
# Add to your Claude Code skills
git clone https://github.com/The-Distillery-dev/thedistilleryGuides for using cli tools skills like thedistillery.
thedistillery is an open-source cli tools skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by The-Distillery-dev. The Distillery. A Token Optimization Proxy. It has 51 GitHub stars.
thedistillery's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/The-Distillery-dev/thedistillery" and add it to your Claude Code skills directory (see the Installation section above).
thedistillery is primarily written in TypeScript. It is open-source under The-Distillery-dev on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other CLI Tools skills you can browse and compare side by side. Open the CLI Tools category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh thedistillery against similar tools.
No comments yet. Be the first to share your thoughts!
Top skills in this category by stars
Unlocks once the catalog security scan passes (runs nightly).
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
Cut your input tokens before they reach the model.
The Distillery is a local token-optimization proxy for AI coding tools. It sits between your coding agent and the model API, removes redundant input context, and reports the overall input reduction across your sessions. It is built for developers who want lower model bills without prompt rewriting, workflow changes, or sending code to The Distillery's hosted service for optimization.
npm install -g thedistillery
Requires Node.js >=20.9.0 <25.
# Log in once
thedistillery auth login
# Start the local proxy
thedistillery start
# Use Claude Code normally, then inspect savings
thedistillery stats
thedistillery start binds to 127.0.0.1:3080 by default and automatically configures Claude Code routing. For other clients, point the tool at the local Anthropic or OpenAI-compatible endpoint shown below.
The Distillery optimizes request input before it reaches the upstream model API:
The displayed reduction is an input-token metric. Output tokens are streamed back unchanged.
The Distillery works with Claude Code automatically and with any client that supports a custom Anthropic base URL or OpenAI-compatible base URL.
| Client | Configuration | OpenAI adapter required |
|---|---|---|
| Claude Code | Auto-configured by thedistillery start |
No |
| Cline | cline.anthropicBaseUrl in VS Code settings |
No |
| Goose | ANTHROPIC_HOST=http://localhost:3080 |
No |
| Zed | language_models.anthropic.api_url in settings |
No |
| Aider | --openai-api-base http://localhost:3080/v1 + --model openai/claude-sonnet-4-5 |
Yes |
| Codex CLI | OPENAI_BASE_URL=http://localhost:3080/openai/v1 with API-key auth |
Yes |
Full client guides live at thedistillery.dev/clients. Codex CLI must use API-key auth; ChatGPT login uses a websocket backend and bypasses OPENAI_BASE_URL.
Using AWS Bedrock through Bedrock-Mantle? See Bedrock setup.
Create .distilleryrc.json in your project directory, or any parent directory, to set a project-level preset:
{ "preset": "smart" }
| Preset | Use when | Behavior |
|---|---|---|
light |
You want the safest baseline | Deduplication only |
smart |
Most coding sessions | Deduplication, tool-output distillation, retention |
deep |
Long sessions with large outputs | More aggressive distillation and retention |
Legacy preset names still work: conservative maps to light, balanced maps to smart, and aggressive maps to deep.
Disable compression for a project:
{ "preset": "smart", "compression": false }
Environment variables:
| Variable | Description |
|---|---|
DISTILLERY_PORT |
Proxy port, default 3080 |
DISTILLERY_BYPASS |
Set to 1 for pass-through mode |
thedistillery start # Start the local proxy
thedistillery start --port 4000 # Use a different port
thedistillery stop # Stop the proxy
thedistillery stats # Show cumulative token and cost savings
thedistillery preset smart # Switch global preset
thedistillery config show # Show resolved config
thedistillery sessions --detail # Show recent sessions, Pro only
thedistillery export --format csv --output sessions.csv
thedistillery billing status
thedistillery billing breakdown --month 2026-07
thedistillery billing manage
thedistillery uninstall --dry-run
For one-off commands, run a child process with an embedded proxy:
thedistillery run claude --watch
Optimization runs locally on your machine. The hosted service receives usage metadata needed for account, billing, dashboard, alerts, and attribution features: token counts, cost deltas, model/session metadata, and project attribution. It does not receive your code or prompts for optimization.
Local session data is stored in:
~/.distillery/data.db
The proxy is designed for loopback-only use and binds to 127.0.0.1 by default.
Do not bind it to 0.0.0.0 unless you understand the risk. Binding to all interfaces can expose a proxy that forwards requests using your API credentials.
Supported local deployment:
ANTHROPIC_BASE_URL=http://127.0.0.1:3080
Interactive teardown:
thedistillery uninstall
Preview what would be removed:
thedistillery uninstall --dry-run
Full uninstall guidance: thedistillery.dev/docs/uninstalling.
npm install
npm test
npm run build:cli
Useful scripts:
npm run dev # Run the CLI from source
npm run benchmark:tokens # Compare token counts
npm run generate:benchmark # Regenerate benchmark JSON
npm run build # Build marketing, dashboard, API, and CLI
This project is licensed under the Elastic License 2.0.