Cctx

•
3
•

Reduces Claude Code token usage by 70-90% by applying context compression with a free local LLM.

Cctx is a CLI tool and Model Context Protocol (MCP) server designed to significantly reduce token usage when interacting with Claude Code, leveraging a local LLM like Ollama. It addresses the common problem of Claude's context window filling rapidly with verbose history and raw tool outputs by implementing three core optimization layers: a pre-built semantic codebase index, real-time compression of tool outputs, and asynchronous summarization of past turns. This entire pipeline operates locally on your machine, ensuring privacy and eliminating API call costs for the compression logic, making Claude Code interactions faster and more cost-efficient without changing your workflow.

Key Features

01Codebase Indexing for session start optimization
02Real-time Tool Output Compression (bash, grep, test_runner, file reads, web results)
03Local LLM Integration via Ollama for privacy and cost savings
04Model Context Protocol (MCP) Server and Stop Hook integration
050 GitHub stars
06Asynchronous Turn Summarization for long sessions

Use Cases

01Optimizing Claude Code token usage and cost for developers
02Accelerating development workflows when using Claude Code
03Ensuring privacy of code and conversation history through local processing