Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

172 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Whetstone

A single Rust binary that installs and orchestrates three upstream tools for Claude Code (and friends): Headroom (context proxy), RTK (Bash-output hook), and ICM (project memory). Idempotent setup, version-pinned manifest, reversible v2 β†’ v3 migration, release automation.

whetstone setup ──┬── Headroom (context compression proxy, upstream)
                  β”œβ”€β”€ RTK (Bash-output rewrite hook, upstream)
                  └── ICM (embedded SQLite project memory, upstream)

Compression is upstream's job. The glue β€” installing, versioning, configuring, migrating, and tearing down cleanly β€” is whetstone's.

Install

cd ~/my-project
curl -fsSL https://raw.githubusercontent.com/z19r/whetstone/main/install.sh | bash

Or from source: cargo install whetstone && whetstone setup

See docs/install.md for prerequisites, setup details, and project configuration.

Upgrading from v2 β†’ v3

v3 is a structural rewrite. whetstone setup will refuse to install over a v2 project and hand off to whetstone migrate. The migration is one command, archive-backed, and reversible.

whetstone migrate                 # interactive
whetstone migrate --dry-run       # preview the plan, write nothing
whetstone migrate -y              # non-interactive (CI)
whetstone migrate --rollback <id> # restore a prior v2 state byte-for-byte

Full procedure, archive contents, and rollback semantics: docs/migration.md.

Breaking changes (v3.0.0)

  • AutoMem provider removed. MemoryProvider is now { Icm, Skip }. The mcpServers.memory block is torn out of ~/.claude/settings.json (archived). If you ran an external FalkorDB + Qdrant service, tear it down yourself β€” it's no longer in whetstone's blast radius.
  • Bundled skills, rules, and hook scripts removed. The assets/hooks/*.sh, assets/skills/, assets/rules/, and the MEMSTACK.md shim are gone. ICM owns its own assets; whetstone delegates to icm init --mode standard.
  • Hooks are tool-managed. Whetstone no longer hand-merges ~/.claude/settings.json. rtk init --auto-patch and icm init write their own hook entries. whetstone doctor reports drift.
  • Migration is mandatory. Existing v2 installs must run whetstone migrate before any v3 command will configure them.
  • config.local.json replaced by .claude/whetstone.json (schema version, integration version, provider, tool versions, timestamps).
  • Default model is settings-driven. whetstone claude injects --model using, in order: an explicit api_model from whetstone settings, else the newest available Sonnet (12h-cached models API), else claude-opus-4-6. (v3.0.0 dropped the old hardcoded model; #68 restored a settings-driven default.)

Full release notes in CHANGELOG.md.

Architecture

User β†’ AI Coding Tool
         β”œβ”€β”€ Bash calls β†’ [RTK Hook]            β†’ compressed output
         β”œβ”€β”€ Context    β†’ [Headroom Proxy :8787]β†’ LLM API
         └── Memory     β†’ [ICM, embedded SQLite]β†’ persistent context

What each piece does

Whetstone (this repo) β€” single Rust binary. Installs the three tools below, ensures uv is present (offers to install it), version-pins everything in .claude/whetstone.json, exposes setup, update, migrate, doctor, and release. No runtime dependencies of its own.

Headroom (upstream β€” headroom-ai) β€” HTTP proxy in front of the LLM provider. Multi-stage pipeline: cache alignment, content routing, statistical JSON compression, AST-aware code compression, score-based message dropping. Compression numbers belong to Headroom; run curl localhost:8787/stats to measure your own.

RTK (upstream β€” rtk-ai/rtk) β€” Bash-output compression via PreToolUse hook. Compresses output before it enters the context window. Caveat: it only fires on Bash tool calls; Claude Code's native Read/Grep/Glob bypass it. Compression isn't free either β€” RTK's own tracker has logged a ~18% net cost-increase case. Run rtk gain and rtk discover to keep yourself honest, and consider RTK's audit mode if a particular rewrite feels suspect.

ICM (upstream β€” rtk-ai/icm) β€” embedded SQLite memory store; skills, hooks, and CLI installed by icm init --mode standard. Whetstone v2's bundled MemStack/skills/rules layer is gone β€” ICM owns its own assets now.

Documentation

Doc Contents
Installation Prerequisites, quick start, new/existing project setup
CLI Reference All v3 commands, flags, RTK quick reference + caveats
Migration Guide v2 β†’ v3 with migrate, --dry-run, --rollback
Editor Setup Claude Code, Cursor, Copilot, Windsurf, Cline, Aider, Codex, Gemini CLI, OpenCode + compatibility matrix
Headroom Service systemd, launchd, and background setup
Configuration Global/per-project files, environment variables
Troubleshooting Common issues, uninstall, manual removal

Development

just build          # Debug build
just test           # Run all tests
just lint           # Clippy lints
just fmt            # Format code
just check          # Build + test + lint

Source layout in CLAUDE.md.

About

whetstone | incredible optimization and caching for claude code | πŸ’¦πŸͺ¨

Topics

Resources

Stars

10 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages