Skip to content

SamoraDC/Distill

Repository files navigation

distill

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.

What problem this solves

Claude Code cost and quota pressure usually come from several independent failure modes:

  1. Codebase exploration waste — too many broad file reads and weak search.
  2. Shell output waste — huge command output gets pushed into context.
  3. Long-session decay — compaction destroys useful history.
  4. Invisible context overhead — ghost tokens from settings, skills, MCP, memory, and plugin load.
  5. 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.

Repository layout

  • src/ — Rust CLI
  • docs/ — product requirements, architecture, publishing plan
  • .claude-plugin/marketplace.json — marketplace metadata for Claude Code
  • plugins/distill-stack/ — bundled Claude Code plugin
  • npm/ — Node wrapper for NPM distribution
  • .github/workflows/ — release scaffolding

CLI

distill init
distill doctor
distill run -- -p "..."
distill statusline
distill print-plugin
distill print-marketplace

Design principles

  • Do not vendor upstream tools by default. Install or detect them as external adapters.
  • One rewriter per layer. RTK owns shell PreToolUse rewriting. 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.

Measured findings

Local benchmarking on 2026-04-03 showed that the cheapest tested profile for this repository was:

  • distill lean mode
  • RTK for Bash rewriting
  • Rolling Context for 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.

Recommended product direction

The most robust public release path is:

  1. Publish the Rust binary on crates.io.
  2. Publish a thin NPM wrapper that exposes the same CLI using the bin field and lifecycle scripts.
  3. Host the repo on GitHub with a Claude Code marketplace and plugin.
  4. Let distill init configure project/user/local scope with the least manual work possible.

Suggested repo name

  • GitHub: SamoraDC/distill
  • Crates: distill
  • NPM: @quantumgraph/distill

Current state of this scaffold

The repository now gives you:

  • a working Rust CLI with doctor, init, run, and statusline,
  • 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.

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors