One-command setup for a Claude Code token-savings stack. Installs and wires up four tools that reduce token usage at different layers.
Source code ──→ context-link (91% reduction — serve only exact symbols)
CLI output ──→ RTK (60-90% reduction — compress shell output)
Session memory ─→ MemStack (persistent memory, skills, diary, vector recall)
API transport ──→ Headroom (~34% reduction — compress in transit)
│
MemStack auto-starts Headroom
| Layer | Tool | Mechanism |
|---|---|---|
| Code intelligence | context-link | MCP server (stdio) |
| CLI compression | RTK | Bash tool hook (PreToolUse) |
| Session memory | MemStack | SessionStart/Stop/Pre/PostToolUse hooks |
| API compression | Headroom | HTTP proxy (auto-managed by MemStack) |
- Claude Code installed
- context-link already installed and indexed for your project
- Python 3.10+
- Git
- macOS: Homebrew — Linux/Windows (Git Bash): curl
Clone this repo, then run the installer from your project directory:
git clone <this-repo-url> token-saver-stack
cd /path/to/your/project
bash /path/to/token-saver-stack/install.shOr if you're already in the token-saver-stack directory:
bash install.sh| Flag | Description |
|---|---|
--project <path> |
Target project directory (default: current dir) |
--dry-run |
Print every command without executing |
--skip-rtk |
Skip RTK install and hook registration |
--skip-memstack |
Skip MemStack, Headroom, and .claude symlink |
bash verify.sh
bash verify.sh --project /path/to/projectbash uninstall.sh
bash uninstall.sh --project /path/to/project --dry-runRemoves: .claude symlink, RTK global hook, headroom-ai pip package. Prompts before deleting ~/memstack (contains diary and memory data).
- RTK hook →
~/.claude/settings.json(global, all projects) - Headroom → pip package; proxy auto-started by MemStack on session open
- MemStack → cloned to
~/memstack; linked into each project via.claudesymlink - context-link → not installed by this script (prerequisite);
.mcp.jsonis created/verified
cd /path/to/your/project
claudeEverything activates automatically. Before closing, say "save diary" so MemStack stores your session for next time.
To link MemStack to additional projects:
cd /path/to/another/project
bash /path/to/token-saver-stack/install.sh