distill is a Rust-first orchestration layer for Claude Code cost optimization.
It does not reimplement GrepAI, RTK, Rolling Context, Token Optimizer, or claude-pulse. Instead, it detects, validates, and composes them into a coherent stack with sane defaults, install guidance, and conflict checks.
Claude Code cost and quota pressure usually come from several independent failure modes:
- Codebase exploration waste — too many broad file reads and weak search.
- Shell output waste — huge command output gets pushed into context.
- Long-session decay — compaction destroys useful history.
- Invisible context overhead — ghost tokens from settings, skills, MCP, memory, and plugin load.
- Poor observability — users do not see session, weekly, or context pressure early enough.
distill turns that into a layered system:
- GrepAI for semantic code retrieval.
- RTK for shell-output compression.
- Rolling Context for long-session compression.
- Token Optimizer for context audits and compaction survival.
- claude-pulse for usage analytics and historical visibility.
- distill statusline as the built-in local fallback renderer.
- Claude Code plugin + project settings generated by this repo to make the stack easier to install and maintain.
src/— Rust CLIdocs/— product requirements, architecture, publishing plan.claude-plugin/marketplace.json— marketplace metadata for Claude Codeplugins/distill-stack/— bundled Claude Code pluginnpm/— Node wrapper for NPM distribution.github/workflows/— release scaffolding
distill init
distill doctor
distill run -- -p "..."
distill statusline
distill print-plugin
distill print-marketplace- Do not vendor upstream tools by default. Install or detect them as external adapters.
- One rewriter per layer. RTK owns shell
PreToolUserewriting. Avoid stacking multiple rewriters. - Prefer project scope when shareable, local scope when machine-specific.
- Fail soft. Missing external tools should not break Claude Code.
- Keep legal boundaries clean. Some upstream projects are permissive, some are copyleft, and some are source-available only.
Local benchmarking on 2026-04-03 showed that the cheapest tested profile for this repository was:
distilllean modeRTKfor Bash rewritingRolling Contextfor long-session support
The full OpenWolf + RTK + Rolling Context stack was not the cheapest option in this repo-level benchmark.
See docs/STACK_BENCHMARKS.md for the benchmark method, totals, and setup notes for GrepAI, Token Optimizer, and claude-pulse.
The most robust public release path is:
- Publish the Rust binary on
crates.io. - Publish a thin NPM wrapper that exposes the same CLI using the
binfield and lifecycle scripts. - Host the repo on GitHub with a Claude Code marketplace and plugin.
- Let
distill initconfigure project/user/local scope with the least manual work possible.
- GitHub:
SamoraDC/distill - Crates:
distill - NPM:
@quantumgraph/distill
The repository now gives you:
- a working Rust CLI with
doctor,init,run, andstatusline, - adapter registry coverage for GrepAI, RTK, Rolling Context, Token Optimizer, and claude-pulse,
- safe local/project Claude settings generation with merge + backup behavior,
- a tested NPM wrapper around the Rust binary,
- Claude Code marketplace/plugin files,
- and the publication strategy for crates, NPM, and GitHub.
It still does not auto-install every upstream dependency for you. The current model is an orchestrator with official install guidance and conflict-aware diagnostics, not a redistributor of third-party binaries.