Open source MCP server
94%

fewer input tokens for your AI coding agent

CCE indexes your codebase with Tree-sitter and serves relevant chunks via MCP. Your agent stops re-reading entire files. Benchmarked on FastAPI with 20 real queries.

$ uv tool install "code-context-engine[local]"
Watch demo →

One command to set up

~/my-project
$ cce init   Code Context Engine · my-project ────────────────────────────────   Git hooks installed (3 hooks, auto-updates) MCP server registered in .mcp.json CLAUDE.md created .gitignore updated   Indexing project... ██████████████████████████████ 89/89 files 100%   Indexed 1,247 chunks from 89 files   Done! Restart your AI coding agent to activate CCE.
Claude Code Cursor VS Code Gemini CLI and 5 more editors

30-second demo

terminal
CCE Demo: install, index, search, and see token savings

Reproducible results

20 real questions against FastAPI. No synthetic queries.

94% retrieval savings
89% compression
0.90 recall@10
0.4ms p50 latency

Token flow per query (avg)

Full files
83,681
After retrieval
4,927
After compression
523

Per-Layer Savings

Retrieval · measured 94%
Chunk Compression · measured 89%
Output Compression · estimated 65%
Grammar · measured 13%

Reproduce it

$ pip install "code-context-engine[local]"
$ python benchmarks/run_benchmark.py \
    --repo https://github.com/fastapi/fastapi.git \
    --source-dir fastapi

Full results: benchmarks/results/fastapi.md

What it does

01

AST-Aware Indexing

Tree-sitter parses your code into semantic chunks (functions, classes, modules). Stored locally with vector embeddings. Git hooks keep the index current after every commit.

$ cce init && cce index
02

Hybrid Search + Graph Expansion

Your agent calls context_search via MCP. Vector similarity + BM25 keyword search merged via Reciprocal Rank Fusion. If auth.py is a hit, utils.py it imports comes too.

context_search("how does auth work?")
03

Smart Compression

With Ollama running locally, chunks are summarized by phi3:mini. Without it, smart truncation extracts signatures and docstrings. Four output levels: off, lite, standard, max.

04

Session Memory

Decisions and code areas persist across sessions via record_decision, record_code_area, and session_recall. No re-explaining your architecture every time.

05

Dashboard + Savings Tracking

Every query is recorded. cce dashboard for charts and live polling. cce savings for token counts and dollar estimates from live Anthropic pricing.

06

Agent Plugin

cce init --plugin generates a portable Agent Plugin directory. VS Code, Cursor, Copilot, Codex, ChatGPT, and Kiro load it automatically via uvx. Zero install.

$ cce init --plugin

How CCE stacks up

Feature No tool Caveman CCE (default) CCE + Ollama Best
Compress output tokens
Compress input tokens
Codebase indexing
Session memory
LLM summarization
Agent Plugin (zero-install)
Cost per session (Sonnet, medium project) $0.45 $0.26 $0.14 $0.09

Latest

Start saving.

Three commands. Permanent token savings. Everything stays local.

$ uv tool install "code-context-engine[local]"
1 uv install
2 cce init
3 Restart editor
Saving tokens