Get started
Introduction & Setup
Learn how to install, register, and verify CacheLane on your local machine.
What is CacheLane?
CacheLane is a **local-first caching and context-discipline middleware** for Claude Code. It sits invisibly between your CLI client and the Anthropic API, intercepting request payloads and structuring them to maximize prompt-cache matches.
By combining cache-aware block reordering with turn-based context pruning (K-pruning) and background keepalive pings, CacheLane reduces billing tokens for long multi-turn sessions by **30% to 60%** without discarding information or changing your workflow.
Prerequisites
- Node.js:
v20.10.xor later. Node 20 is strongly recommended as native SQLite bindings are optimized for Node 20. - Claude Code:
v0.6.xor later.
Installation
To compile and install CacheLane globally from source:
# Clone the repository
git clone https://github.com/Aditya-Tripuraneni/CacheLane.git
cd CacheLane
# Install package dependencies
npm install
# Compile the TypeScript files
npm run build
# Link globally to your local npm registry
npm linkIntegration with Claude Code
Once linked, initialize the idempotent installation command. This registers the stdio MCP server in Claude's global settings and copies hook descriptors into place:
cachelane installThis command automatically executes the following changes:
- Registers the CacheLane MCP server inside
~/.claude/mcp.json. - Writes PreRequest and PostResponse hook configurations into
~/.claude/hooks/. - Scaffolds a default configuration file at
~/.cachelane/config.jsonif none exists.
Verifying the Installation
Verify your setup by running the built-in diagnostic tool. It checks Node compatibility, hook registration, configuration schemas, and database write access:
cachelane doctor