code-context-engine 0.4.4__tar.gz → 0.4.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. {code_context_engine-0.4.4/src/code_context_engine.egg-info → code_context_engine-0.4.6}/PKG-INFO +33 -16
  2. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/README.md +29 -13
  3. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/pyproject.toml +4 -3
  4. {code_context_engine-0.4.4 → code_context_engine-0.4.6/src/code_context_engine.egg-info}/PKG-INFO +33 -16
  5. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/code_context_engine.egg-info/requires.txt +1 -0
  6. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/cli.py +11 -7
  7. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/config.py +2 -5
  8. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/retrieval/confidence.py +2 -2
  9. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/retrieval/retriever.py +17 -1
  10. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/tests/test_cli_uninstall.py +1 -1
  11. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/LICENSE +0 -0
  12. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/setup.cfg +0 -0
  13. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/code_context_engine.egg-info/SOURCES.txt +0 -0
  14. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/code_context_engine.egg-info/dependency_links.txt +0 -0
  15. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/code_context_engine.egg-info/entry_points.txt +0 -0
  16. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/code_context_engine.egg-info/top_level.txt +0 -0
  17. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/__init__.py +0 -0
  18. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/cli_style.py +0 -0
  19. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/compression/__init__.py +0 -0
  20. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/compression/compressor.py +0 -0
  21. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/compression/ollama_client.py +0 -0
  22. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/compression/output_rules.py +0 -0
  23. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/compression/prompts.py +0 -0
  24. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/compression/quality.py +0 -0
  25. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/dashboard/__init__.py +0 -0
  26. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/dashboard/_page.py +0 -0
  27. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/dashboard/server.py +0 -0
  28. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/editors.py +0 -0
  29. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/event_bus.py +0 -0
  30. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/indexer/__init__.py +0 -0
  31. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/indexer/chunker.py +0 -0
  32. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/indexer/embedder.py +0 -0
  33. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/indexer/embedding_cache.py +0 -0
  34. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/indexer/git_hooks.py +0 -0
  35. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/indexer/git_indexer.py +0 -0
  36. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/indexer/ignorefile.py +0 -0
  37. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/indexer/manifest.py +0 -0
  38. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/indexer/pipeline.py +0 -0
  39. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/indexer/secrets.py +0 -0
  40. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/indexer/watcher.py +0 -0
  41. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/integration/__init__.py +0 -0
  42. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/integration/bootstrap.py +0 -0
  43. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/integration/git_context.py +0 -0
  44. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/integration/mcp_server.py +0 -0
  45. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/integration/session_capture.py +0 -0
  46. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/memory/__init__.py +0 -0
  47. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/memory/compressor.py +0 -0
  48. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/memory/db.py +0 -0
  49. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/memory/extractive.py +0 -0
  50. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/memory/grammar.py +0 -0
  51. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/memory/hook_installer.py +0 -0
  52. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/memory/hook_server.py +0 -0
  53. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/memory/hooks.py +0 -0
  54. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/memory/migrate.py +0 -0
  55. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/models.py +0 -0
  56. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/pricing.py +0 -0
  57. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/project_commands.py +0 -0
  58. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/retrieval/__init__.py +0 -0
  59. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/retrieval/query_parser.py +0 -0
  60. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/serve_http.py +0 -0
  61. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/services.py +0 -0
  62. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/storage/__init__.py +0 -0
  63. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/storage/backend.py +0 -0
  64. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/storage/fts_store.py +0 -0
  65. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/storage/graph_store.py +0 -0
  66. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/storage/local_backend.py +0 -0
  67. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/storage/remote_backend.py +0 -0
  68. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/storage/vector_store.py +0 -0
  69. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/src/context_engine/utils.py +0 -0
  70. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/tests/test_cli_init_probe.py +0 -0
  71. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/tests/test_cli_mcp_config.py +0 -0
  72. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/tests/test_cli_savings.py +0 -0
  73. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/tests/test_cli_savings_buckets.py +0 -0
  74. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/tests/test_cli_savings_e2e.py +0 -0
  75. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/tests/test_cli_serve.py +0 -0
  76. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/tests/test_cli_sessions_export.py +0 -0
  77. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/tests/test_cli_sessions_status.py +0 -0
  78. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/tests/test_cli_smoke.py +0 -0
  79. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/tests/test_config.py +0 -0
  80. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/tests/test_e2e.py +0 -0
  81. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/tests/test_event_bus.py +0 -0
  82. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/tests/test_models.py +0 -0
  83. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/tests/test_project_commands.py +0 -0
  84. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/tests/test_real_life.py +0 -0
  85. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/tests/test_services.py +0 -0
  86. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/tests/test_token_efficiency.py +0 -0
  87. {code_context_engine-0.4.4 → code_context_engine-0.4.6}/tests/test_token_packing.py +0 -0
@@ -1,14 +1,14 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: code-context-engine
3
- Version: 0.4.4
4
- Summary: Index your codebase. AI searches instead of re-reading files. Save 70%+ on tokens. Works with Claude Code, Cursor, VS Code, Gemini CLI, and Codex.
3
+ Version: 0.4.6
4
+ Summary: Index your codebase. AI searches instead of re-reading files. 94% token savings, benchmarked on FastAPI. Works with Claude Code, Cursor, VS Code, Gemini CLI, and Codex.
5
5
  Author-email: Fazle Elahee <felahee@gmail.com>, Raj <rajkumar.sakti@gmail.com>
6
6
  License-Expression: MIT
7
7
  Project-URL: Homepage, https://github.com/elara-labs/code-context-engine
8
8
  Project-URL: Repository, https://github.com/elara-labs/code-context-engine
9
9
  Project-URL: Issues, https://github.com/elara-labs/code-context-engine/issues
10
10
  Keywords: claude,context,mcp,llm,code-indexing,vector-search
11
- Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Development Status :: 4 - Beta
12
12
  Classifier: Intended Audience :: Developers
13
13
  Classifier: Programming Language :: Python :: 3
14
14
  Classifier: Programming Language :: Python :: 3.11
@@ -37,6 +37,7 @@ Requires-Dist: httpx>=0.27
37
37
  Requires-Dist: fastapi>=0.110
38
38
  Requires-Dist: uvicorn>=0.29
39
39
  Requires-Dist: aiohttp>=3.9
40
+ Requires-Dist: psutil>=5.9
40
41
  Provides-Extra: dev
41
42
  Requires-Dist: pytest>=8.0; extra == "dev"
42
43
  Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
@@ -53,10 +54,11 @@ Dynamic: license-file
53
54
  <h1 align="center">Code Context Engine</h1>
54
55
 
55
56
  <p align="center">
56
- <strong>Index your codebase. AI searches instead of re-reading files. 93% token savings, benchmarked.</strong>
57
+ <strong>Index your codebase. AI searches instead of re-reading files. 94% token savings, benchmarked.</strong>
57
58
  </p>
58
59
 
59
60
  <p align="center">
61
+ <a href="https://github.com/elara-labs/code-context-engine/actions/workflows/ci.yml"><img src="https://github.com/elara-labs/code-context-engine/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
60
62
  <a href="https://pypi.org/project/code-context-engine/"><img src="https://img.shields.io/pypi/v/code-context-engine?color=blue&label=PyPI" alt="PyPI"></a>
61
63
  <a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/python-3.11+-blue.svg" alt="Python 3.11+"></a>
62
64
  <a href="https://modelcontextprotocol.io"><img src="https://img.shields.io/badge/MCP-compatible-green.svg" alt="MCP Compatible"></a>
@@ -87,6 +89,14 @@ Dynamic: license-file
87
89
 
88
90
  ---
89
91
 
92
+ ## System requirements
93
+
94
+ - Python 3.11+
95
+ - A C compiler and `cmake` (needed to build tree-sitter grammars)
96
+ - **macOS:** `xcode-select --install`
97
+ - **Ubuntu/Debian:** `sudo apt install build-essential cmake`
98
+ - **Windows:** Visual Studio Build Tools (C++ workload)
99
+
90
100
  ## Install and see savings in 60 seconds
91
101
 
92
102
  ```bash
@@ -112,7 +122,7 @@ Multiple editors in the same project? All get configured in one command.
112
122
  ```
113
123
  my-project · 38 queries
114
124
 
115
- ⛁ ⛁ ⛁ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ 93% tokens saved
125
+ ⛁ ⛁ ⛁ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ 94% tokens saved
116
126
 
117
127
  Without CCE 48.0k tokens $0.24
118
128
  With CCE 3.4k tokens $0.02
@@ -126,7 +136,7 @@ Multiple editors in the same project? All get configured in one command.
126
136
 
127
137
  ## Why this matters
128
138
 
129
- Input tokens are 85-95% of your Claude Code bill. CCE cuts them by 93% ([benchmarked on FastAPI](#benchmark-fastapi-independently-verified)).
139
+ Input tokens are 85-95% of your Claude Code bill. CCE cuts them by 94% ([benchmarked on FastAPI](#benchmark-fastapi-independently-verified)).
130
140
 
131
141
  ```
132
142
  Without CCE: Claude reads payments.py + shipping.py = 45,000 tokens
@@ -144,17 +154,16 @@ With CCE: context_search "payment flow" = 800 tokens
144
154
 
145
155
  ## Benchmark: FastAPI (independently verified)
146
156
 
147
- We benchmarked CCE against [FastAPI](https://github.com/fastapi/fastapi) (48 source files, 19K lines of Python) with 20 real coding questions. No cherry-picking, no synthetic queries.
157
+ We benchmarked CCE against [FastAPI](https://github.com/fastapi/fastapi) (53 source files, 180K tokens) with 20 real coding questions. No cherry-picking, no synthetic queries.
148
158
 
149
159
  **Methodology:** For each query, "without CCE" means reading the full content of every file the query touches. "With CCE" means the relevant chunks after compression. This is conservative (agents often read more files than needed).
150
160
 
151
161
  | Metric | Result |
152
162
  |--------|--------|
153
- | **Retrieval** | **93%** savings (75,3555,381 tokens/query) |
154
- | **+ Compression** | **90%** additional (5,381541 tokens/query) |
155
- | **Combined** | **99.3%** (75,355541 tokens/query) |
156
- | Recall@10 (found the right files) | 0.80 |
157
- | Precision@10 | 0.30 |
163
+ | **Retrieval** | **94%** savings (83,6814,927 tokens/query) |
164
+ | **+ Compression** | **89%** additional (4,927523 tokens/query) |
165
+ | **Combined** | **99.4%** (83,681523 tokens/query) |
166
+ | Recall@10 (found the right files) | 0.90 |
158
167
  | Latency p50 | 0.4ms |
159
168
  | Queries tested | 20 |
160
169
 
@@ -162,8 +171,8 @@ We benchmarked CCE against [FastAPI](https://github.com/fastapi/fastapi) (48 sou
162
171
 
163
172
  | Layer | What it does | Savings | Method |
164
173
  |-------|-------------|---------|--------|
165
- | **Retrieval** | Full files → relevant code chunks | 93% | measured |
166
- | **Chunk Compression** | Raw chunks → signatures + docstrings | 90% | measured |
174
+ | **Retrieval** | Full files → relevant code chunks | 94% | measured |
175
+ | **Chunk Compression** | Raw chunks → signatures + docstrings | 89% | measured |
167
176
  | **Output Compression** | Reduces Claude's reply length | 65% | estimated |
168
177
  | **Grammar** | Drops articles/fillers from memory text | 13% | measured |
169
178
 
@@ -210,6 +219,14 @@ cce savings --all # see savings across all projects
210
219
 
211
220
  ---
212
221
 
222
+ ## How is CCE different?
223
+
224
+ CCE is editor-agnostic, local-first, and gives you measurable token savings. Your code never leaves your machine. Unlike built-in indexing (Cursor, Continue), CCE works across Claude Code, VS Code, Cursor, Gemini CLI, and Codex with a single index. Unlike cloud tools (Greptile), it's free and private.
225
+
226
+ See the [full comparison with alternatives](docs/comparison.md) for an honest look at trade-offs.
227
+
228
+ ---
229
+
213
230
  ## How it works (the short version)
214
231
 
215
232
  1. **Index:** Tree-sitter parses your code into semantic chunks (functions, classes, modules). Stored as vector embeddings locally.
@@ -228,7 +245,7 @@ Re-indexing after edits takes under 1 second (96% embedding cache hit rate). Git
228
245
 
229
246
  Output compression tools (like Caveman) save 20-75% on output tokens. Output is 5-15% of your bill. Net savings: ~11%.
230
247
 
231
- CCE saves on **input** tokens (93% retrieval + 90% compression on FastAPI, [independently benchmarked](#benchmark-fastapi-independently-verified)). Input is 85-95% of your bill.
248
+ CCE saves on **input** tokens (94% retrieval + 89% compression on FastAPI, [independently benchmarked](#benchmark-fastapi-independently-verified)). Input is 85-95% of your bill.
232
249
 
233
250
  ### It actually understands your code
234
251
 
@@ -398,7 +415,7 @@ No GPU required. Embedding model runs on CPU via ONNX Runtime.
398
415
  - [x] Clean uninstall (removes all CCE artifacts)
399
416
  - [x] AST-aware chunking for PHP, Go, Rust, Java (tree-sitter)
400
417
  - [x] Multi-editor support (Cursor, VS Code/Copilot, Gemini CLI)
401
- - [x] Reproducible benchmark suite (93% savings on FastAPI, per-layer breakdown)
418
+ - [x] Reproducible benchmark suite (94% savings on FastAPI, per-layer breakdown)
402
419
  - [x] Session savings visibility (shown at every session start)
403
420
  - [ ] Tree-sitter support for C, C++, Ruby, Swift, Kotlin
404
421
  - [ ] Docker support for remote mode
@@ -5,10 +5,11 @@
5
5
  <h1 align="center">Code Context Engine</h1>
6
6
 
7
7
  <p align="center">
8
- <strong>Index your codebase. AI searches instead of re-reading files. 93% token savings, benchmarked.</strong>
8
+ <strong>Index your codebase. AI searches instead of re-reading files. 94% token savings, benchmarked.</strong>
9
9
  </p>
10
10
 
11
11
  <p align="center">
12
+ <a href="https://github.com/elara-labs/code-context-engine/actions/workflows/ci.yml"><img src="https://github.com/elara-labs/code-context-engine/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
12
13
  <a href="https://pypi.org/project/code-context-engine/"><img src="https://img.shields.io/pypi/v/code-context-engine?color=blue&label=PyPI" alt="PyPI"></a>
13
14
  <a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/python-3.11+-blue.svg" alt="Python 3.11+"></a>
14
15
  <a href="https://modelcontextprotocol.io"><img src="https://img.shields.io/badge/MCP-compatible-green.svg" alt="MCP Compatible"></a>
@@ -39,6 +40,14 @@
39
40
 
40
41
  ---
41
42
 
43
+ ## System requirements
44
+
45
+ - Python 3.11+
46
+ - A C compiler and `cmake` (needed to build tree-sitter grammars)
47
+ - **macOS:** `xcode-select --install`
48
+ - **Ubuntu/Debian:** `sudo apt install build-essential cmake`
49
+ - **Windows:** Visual Studio Build Tools (C++ workload)
50
+
42
51
  ## Install and see savings in 60 seconds
43
52
 
44
53
  ```bash
@@ -64,7 +73,7 @@ Multiple editors in the same project? All get configured in one command.
64
73
  ```
65
74
  my-project · 38 queries
66
75
 
67
- ⛁ ⛁ ⛁ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ 93% tokens saved
76
+ ⛁ ⛁ ⛁ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ 94% tokens saved
68
77
 
69
78
  Without CCE 48.0k tokens $0.24
70
79
  With CCE 3.4k tokens $0.02
@@ -78,7 +87,7 @@ Multiple editors in the same project? All get configured in one command.
78
87
 
79
88
  ## Why this matters
80
89
 
81
- Input tokens are 85-95% of your Claude Code bill. CCE cuts them by 93% ([benchmarked on FastAPI](#benchmark-fastapi-independently-verified)).
90
+ Input tokens are 85-95% of your Claude Code bill. CCE cuts them by 94% ([benchmarked on FastAPI](#benchmark-fastapi-independently-verified)).
82
91
 
83
92
  ```
84
93
  Without CCE: Claude reads payments.py + shipping.py = 45,000 tokens
@@ -96,17 +105,16 @@ With CCE: context_search "payment flow" = 800 tokens
96
105
 
97
106
  ## Benchmark: FastAPI (independently verified)
98
107
 
99
- We benchmarked CCE against [FastAPI](https://github.com/fastapi/fastapi) (48 source files, 19K lines of Python) with 20 real coding questions. No cherry-picking, no synthetic queries.
108
+ We benchmarked CCE against [FastAPI](https://github.com/fastapi/fastapi) (53 source files, 180K tokens) with 20 real coding questions. No cherry-picking, no synthetic queries.
100
109
 
101
110
  **Methodology:** For each query, "without CCE" means reading the full content of every file the query touches. "With CCE" means the relevant chunks after compression. This is conservative (agents often read more files than needed).
102
111
 
103
112
  | Metric | Result |
104
113
  |--------|--------|
105
- | **Retrieval** | **93%** savings (75,3555,381 tokens/query) |
106
- | **+ Compression** | **90%** additional (5,381541 tokens/query) |
107
- | **Combined** | **99.3%** (75,355541 tokens/query) |
108
- | Recall@10 (found the right files) | 0.80 |
109
- | Precision@10 | 0.30 |
114
+ | **Retrieval** | **94%** savings (83,6814,927 tokens/query) |
115
+ | **+ Compression** | **89%** additional (4,927523 tokens/query) |
116
+ | **Combined** | **99.4%** (83,681523 tokens/query) |
117
+ | Recall@10 (found the right files) | 0.90 |
110
118
  | Latency p50 | 0.4ms |
111
119
  | Queries tested | 20 |
112
120
 
@@ -114,8 +122,8 @@ We benchmarked CCE against [FastAPI](https://github.com/fastapi/fastapi) (48 sou
114
122
 
115
123
  | Layer | What it does | Savings | Method |
116
124
  |-------|-------------|---------|--------|
117
- | **Retrieval** | Full files → relevant code chunks | 93% | measured |
118
- | **Chunk Compression** | Raw chunks → signatures + docstrings | 90% | measured |
125
+ | **Retrieval** | Full files → relevant code chunks | 94% | measured |
126
+ | **Chunk Compression** | Raw chunks → signatures + docstrings | 89% | measured |
119
127
  | **Output Compression** | Reduces Claude's reply length | 65% | estimated |
120
128
  | **Grammar** | Drops articles/fillers from memory text | 13% | measured |
121
129
 
@@ -162,6 +170,14 @@ cce savings --all # see savings across all projects
162
170
 
163
171
  ---
164
172
 
173
+ ## How is CCE different?
174
+
175
+ CCE is editor-agnostic, local-first, and gives you measurable token savings. Your code never leaves your machine. Unlike built-in indexing (Cursor, Continue), CCE works across Claude Code, VS Code, Cursor, Gemini CLI, and Codex with a single index. Unlike cloud tools (Greptile), it's free and private.
176
+
177
+ See the [full comparison with alternatives](docs/comparison.md) for an honest look at trade-offs.
178
+
179
+ ---
180
+
165
181
  ## How it works (the short version)
166
182
 
167
183
  1. **Index:** Tree-sitter parses your code into semantic chunks (functions, classes, modules). Stored as vector embeddings locally.
@@ -180,7 +196,7 @@ Re-indexing after edits takes under 1 second (96% embedding cache hit rate). Git
180
196
 
181
197
  Output compression tools (like Caveman) save 20-75% on output tokens. Output is 5-15% of your bill. Net savings: ~11%.
182
198
 
183
- CCE saves on **input** tokens (93% retrieval + 90% compression on FastAPI, [independently benchmarked](#benchmark-fastapi-independently-verified)). Input is 85-95% of your bill.
199
+ CCE saves on **input** tokens (94% retrieval + 89% compression on FastAPI, [independently benchmarked](#benchmark-fastapi-independently-verified)). Input is 85-95% of your bill.
184
200
 
185
201
  ### It actually understands your code
186
202
 
@@ -350,7 +366,7 @@ No GPU required. Embedding model runs on CPU via ONNX Runtime.
350
366
  - [x] Clean uninstall (removes all CCE artifacts)
351
367
  - [x] AST-aware chunking for PHP, Go, Rust, Java (tree-sitter)
352
368
  - [x] Multi-editor support (Cursor, VS Code/Copilot, Gemini CLI)
353
- - [x] Reproducible benchmark suite (93% savings on FastAPI, per-layer breakdown)
369
+ - [x] Reproducible benchmark suite (94% savings on FastAPI, per-layer breakdown)
354
370
  - [x] Session savings visibility (shown at every session start)
355
371
  - [ ] Tree-sitter support for C, C++, Ruby, Swift, Kotlin
356
372
  - [ ] Docker support for remote mode
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "code-context-engine"
3
- version = "0.4.4"
4
- description = "Index your codebase. AI searches instead of re-reading files. Save 70%+ on tokens. Works with Claude Code, Cursor, VS Code, Gemini CLI, and Codex."
3
+ version = "0.4.6"
4
+ description = "Index your codebase. AI searches instead of re-reading files. 94% token savings, benchmarked on FastAPI. Works with Claude Code, Cursor, VS Code, Gemini CLI, and Codex."
5
5
  readme = {file = "README.md", content-type = "text/markdown"}
6
6
  license = "MIT"
7
7
  authors = [
@@ -10,7 +10,7 @@ authors = [
10
10
  ]
11
11
  keywords = ["claude", "context", "mcp", "llm", "code-indexing", "vector-search"]
12
12
  classifiers = [
13
- "Development Status :: 3 - Alpha",
13
+ "Development Status :: 4 - Beta",
14
14
  "Intended Audience :: Developers",
15
15
  "Programming Language :: Python :: 3",
16
16
  "Programming Language :: Python :: 3.11",
@@ -42,6 +42,7 @@ dependencies = [
42
42
  # capture path without it. Was originally optional; promoted to core
43
43
  # because hooks are core to the memory feature.
44
44
  "aiohttp>=3.9",
45
+ "psutil>=5.9",
45
46
  ]
46
47
 
47
48
  [project.urls]
@@ -1,14 +1,14 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: code-context-engine
3
- Version: 0.4.4
4
- Summary: Index your codebase. AI searches instead of re-reading files. Save 70%+ on tokens. Works with Claude Code, Cursor, VS Code, Gemini CLI, and Codex.
3
+ Version: 0.4.6
4
+ Summary: Index your codebase. AI searches instead of re-reading files. 94% token savings, benchmarked on FastAPI. Works with Claude Code, Cursor, VS Code, Gemini CLI, and Codex.
5
5
  Author-email: Fazle Elahee <felahee@gmail.com>, Raj <rajkumar.sakti@gmail.com>
6
6
  License-Expression: MIT
7
7
  Project-URL: Homepage, https://github.com/elara-labs/code-context-engine
8
8
  Project-URL: Repository, https://github.com/elara-labs/code-context-engine
9
9
  Project-URL: Issues, https://github.com/elara-labs/code-context-engine/issues
10
10
  Keywords: claude,context,mcp,llm,code-indexing,vector-search
11
- Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Development Status :: 4 - Beta
12
12
  Classifier: Intended Audience :: Developers
13
13
  Classifier: Programming Language :: Python :: 3
14
14
  Classifier: Programming Language :: Python :: 3.11
@@ -37,6 +37,7 @@ Requires-Dist: httpx>=0.27
37
37
  Requires-Dist: fastapi>=0.110
38
38
  Requires-Dist: uvicorn>=0.29
39
39
  Requires-Dist: aiohttp>=3.9
40
+ Requires-Dist: psutil>=5.9
40
41
  Provides-Extra: dev
41
42
  Requires-Dist: pytest>=8.0; extra == "dev"
42
43
  Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
@@ -53,10 +54,11 @@ Dynamic: license-file
53
54
  <h1 align="center">Code Context Engine</h1>
54
55
 
55
56
  <p align="center">
56
- <strong>Index your codebase. AI searches instead of re-reading files. 93% token savings, benchmarked.</strong>
57
+ <strong>Index your codebase. AI searches instead of re-reading files. 94% token savings, benchmarked.</strong>
57
58
  </p>
58
59
 
59
60
  <p align="center">
61
+ <a href="https://github.com/elara-labs/code-context-engine/actions/workflows/ci.yml"><img src="https://github.com/elara-labs/code-context-engine/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
60
62
  <a href="https://pypi.org/project/code-context-engine/"><img src="https://img.shields.io/pypi/v/code-context-engine?color=blue&label=PyPI" alt="PyPI"></a>
61
63
  <a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/python-3.11+-blue.svg" alt="Python 3.11+"></a>
62
64
  <a href="https://modelcontextprotocol.io"><img src="https://img.shields.io/badge/MCP-compatible-green.svg" alt="MCP Compatible"></a>
@@ -87,6 +89,14 @@ Dynamic: license-file
87
89
 
88
90
  ---
89
91
 
92
+ ## System requirements
93
+
94
+ - Python 3.11+
95
+ - A C compiler and `cmake` (needed to build tree-sitter grammars)
96
+ - **macOS:** `xcode-select --install`
97
+ - **Ubuntu/Debian:** `sudo apt install build-essential cmake`
98
+ - **Windows:** Visual Studio Build Tools (C++ workload)
99
+
90
100
  ## Install and see savings in 60 seconds
91
101
 
92
102
  ```bash
@@ -112,7 +122,7 @@ Multiple editors in the same project? All get configured in one command.
112
122
  ```
113
123
  my-project · 38 queries
114
124
 
115
- ⛁ ⛁ ⛁ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ 93% tokens saved
125
+ ⛁ ⛁ ⛁ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ 94% tokens saved
116
126
 
117
127
  Without CCE 48.0k tokens $0.24
118
128
  With CCE 3.4k tokens $0.02
@@ -126,7 +136,7 @@ Multiple editors in the same project? All get configured in one command.
126
136
 
127
137
  ## Why this matters
128
138
 
129
- Input tokens are 85-95% of your Claude Code bill. CCE cuts them by 93% ([benchmarked on FastAPI](#benchmark-fastapi-independently-verified)).
139
+ Input tokens are 85-95% of your Claude Code bill. CCE cuts them by 94% ([benchmarked on FastAPI](#benchmark-fastapi-independently-verified)).
130
140
 
131
141
  ```
132
142
  Without CCE: Claude reads payments.py + shipping.py = 45,000 tokens
@@ -144,17 +154,16 @@ With CCE: context_search "payment flow" = 800 tokens
144
154
 
145
155
  ## Benchmark: FastAPI (independently verified)
146
156
 
147
- We benchmarked CCE against [FastAPI](https://github.com/fastapi/fastapi) (48 source files, 19K lines of Python) with 20 real coding questions. No cherry-picking, no synthetic queries.
157
+ We benchmarked CCE against [FastAPI](https://github.com/fastapi/fastapi) (53 source files, 180K tokens) with 20 real coding questions. No cherry-picking, no synthetic queries.
148
158
 
149
159
  **Methodology:** For each query, "without CCE" means reading the full content of every file the query touches. "With CCE" means the relevant chunks after compression. This is conservative (agents often read more files than needed).
150
160
 
151
161
  | Metric | Result |
152
162
  |--------|--------|
153
- | **Retrieval** | **93%** savings (75,3555,381 tokens/query) |
154
- | **+ Compression** | **90%** additional (5,381541 tokens/query) |
155
- | **Combined** | **99.3%** (75,355541 tokens/query) |
156
- | Recall@10 (found the right files) | 0.80 |
157
- | Precision@10 | 0.30 |
163
+ | **Retrieval** | **94%** savings (83,6814,927 tokens/query) |
164
+ | **+ Compression** | **89%** additional (4,927523 tokens/query) |
165
+ | **Combined** | **99.4%** (83,681523 tokens/query) |
166
+ | Recall@10 (found the right files) | 0.90 |
158
167
  | Latency p50 | 0.4ms |
159
168
  | Queries tested | 20 |
160
169
 
@@ -162,8 +171,8 @@ We benchmarked CCE against [FastAPI](https://github.com/fastapi/fastapi) (48 sou
162
171
 
163
172
  | Layer | What it does | Savings | Method |
164
173
  |-------|-------------|---------|--------|
165
- | **Retrieval** | Full files → relevant code chunks | 93% | measured |
166
- | **Chunk Compression** | Raw chunks → signatures + docstrings | 90% | measured |
174
+ | **Retrieval** | Full files → relevant code chunks | 94% | measured |
175
+ | **Chunk Compression** | Raw chunks → signatures + docstrings | 89% | measured |
167
176
  | **Output Compression** | Reduces Claude's reply length | 65% | estimated |
168
177
  | **Grammar** | Drops articles/fillers from memory text | 13% | measured |
169
178
 
@@ -210,6 +219,14 @@ cce savings --all # see savings across all projects
210
219
 
211
220
  ---
212
221
 
222
+ ## How is CCE different?
223
+
224
+ CCE is editor-agnostic, local-first, and gives you measurable token savings. Your code never leaves your machine. Unlike built-in indexing (Cursor, Continue), CCE works across Claude Code, VS Code, Cursor, Gemini CLI, and Codex with a single index. Unlike cloud tools (Greptile), it's free and private.
225
+
226
+ See the [full comparison with alternatives](docs/comparison.md) for an honest look at trade-offs.
227
+
228
+ ---
229
+
213
230
  ## How it works (the short version)
214
231
 
215
232
  1. **Index:** Tree-sitter parses your code into semantic chunks (functions, classes, modules). Stored as vector embeddings locally.
@@ -228,7 +245,7 @@ Re-indexing after edits takes under 1 second (96% embedding cache hit rate). Git
228
245
 
229
246
  Output compression tools (like Caveman) save 20-75% on output tokens. Output is 5-15% of your bill. Net savings: ~11%.
230
247
 
231
- CCE saves on **input** tokens (93% retrieval + 90% compression on FastAPI, [independently benchmarked](#benchmark-fastapi-independently-verified)). Input is 85-95% of your bill.
248
+ CCE saves on **input** tokens (94% retrieval + 89% compression on FastAPI, [independently benchmarked](#benchmark-fastapi-independently-verified)). Input is 85-95% of your bill.
232
249
 
233
250
  ### It actually understands your code
234
251
 
@@ -398,7 +415,7 @@ No GPU required. Embedding model runs on CPU via ONNX Runtime.
398
415
  - [x] Clean uninstall (removes all CCE artifacts)
399
416
  - [x] AST-aware chunking for PHP, Go, Rust, Java (tree-sitter)
400
417
  - [x] Multi-editor support (Cursor, VS Code/Copilot, Gemini CLI)
401
- - [x] Reproducible benchmark suite (93% savings on FastAPI, per-layer breakdown)
418
+ - [x] Reproducible benchmark suite (94% savings on FastAPI, per-layer breakdown)
402
419
  - [x] Session savings visibility (shown at every session start)
403
420
  - [ ] Tree-sitter support for C, C++, Ruby, Swift, Kotlin
404
421
  - [ ] Docker support for remote mode
@@ -17,6 +17,7 @@ httpx>=0.27
17
17
  fastapi>=0.110
18
18
  uvicorn>=0.29
19
19
  aiohttp>=3.9
20
+ psutil>=5.9
20
21
 
21
22
  [dev]
22
23
  pytest>=8.0
@@ -1674,12 +1674,10 @@ def search(ctx: click.Context, query: str, top_k: int) -> None:
1674
1674
  lines.append(f" {DOT} {dim('No results found')}")
1675
1675
  else:
1676
1676
  # Compute tokens
1677
- raw_tokens = 0
1678
1677
  served_tokens = 0
1679
1678
  seen_files: set[str] = set()
1680
1679
  for r in results:
1681
1680
  chunk_tokens = max(1, len(r.content) // 4)
1682
- raw_tokens += chunk_tokens
1683
1681
  served_tokens += chunk_tokens
1684
1682
  seen_files.add(r.file_path)
1685
1683
 
@@ -1702,7 +1700,8 @@ def search(ctx: click.Context, query: str, top_k: int) -> None:
1702
1700
  lines.append(f" {dim(first_line)}")
1703
1701
 
1704
1702
  lines.append("")
1705
- lines.append(f" {CHECK} {success(f'{len(results)} results')} {dim(f'{served_tokens} tokens served vs {full_file_tokens} full file tokens')}")
1703
+ savings_pct = int((1 - served_tokens / full_file_tokens) * 100) if full_file_tokens > 0 else 0
1704
+ lines.append(f" {CHECK} {success(f'{len(results)} results')} {dim(f'{served_tokens} tokens served vs {full_file_tokens} full file tokens ({savings_pct}% saved)')}")
1706
1705
 
1707
1706
  # Update stats
1708
1707
  stats_path = storage_dir / "stats.json"
@@ -1711,10 +1710,8 @@ def search(ctx: click.Context, query: str, top_k: int) -> None:
1711
1710
  except (json.JSONDecodeError, OSError):
1712
1711
  stats = {}
1713
1712
  stats["queries"] = stats.get("queries", 0) + 1
1714
- stats["raw_tokens"] = stats.get("raw_tokens", 0) + raw_tokens
1713
+ stats["full_file_tokens"] = stats.get("full_file_tokens", 0) + full_file_tokens
1715
1714
  stats["served_tokens"] = stats.get("served_tokens", 0) + served_tokens
1716
- stats.setdefault("full_file_tokens", 0)
1717
- stats["full_file_tokens"] = max(stats["full_file_tokens"], full_file_tokens)
1718
1715
  stats_path.write_text(json.dumps(stats))
1719
1716
 
1720
1717
  lines.append("")
@@ -1724,12 +1721,19 @@ def search(ctx: click.Context, query: str, top_k: int) -> None:
1724
1721
 
1725
1722
 
1726
1723
  @main.command()
1727
- def uninstall() -> None:
1724
+ @click.option("--yes", "-y", is_flag=True, help="Skip confirmation prompt")
1725
+ def uninstall(yes: bool) -> None:
1728
1726
  """Remove CCE from the current project (hooks, .mcp.json entry, CLAUDE.md block)."""
1729
1727
  from context_engine.cli_style import section, animate, value, dim, success, warn, CHECK, CROSS, DOT
1730
1728
 
1731
1729
  project_dir = Path.cwd()
1732
1730
  project_name = project_dir.name
1731
+
1732
+ if not yes:
1733
+ if not click.confirm(f"Remove CCE from {project_name}?", default=False):
1734
+ click.echo("Cancelled.")
1735
+ return
1736
+
1733
1737
  lines: list[str] = []
1734
1738
  lines.append("")
1735
1739
  lines.append(section(f"Uninstall · {project_name}"))
@@ -90,11 +90,8 @@ class Config:
90
90
  storage_path: str = str(_CCE_HOME / "projects")
91
91
 
92
92
  def detect_resource_profile(self) -> str:
93
- try:
94
- import psutil
95
- ram_gb = psutil.virtual_memory().total / (1024 ** 3)
96
- except ImportError:
97
- ram_gb = 16
93
+ import psutil
94
+ ram_gb = psutil.virtual_memory().total / (1024 ** 3)
98
95
  if ram_gb >= 32:
99
96
  return "full"
100
97
  if ram_gb >= 12:
@@ -14,8 +14,8 @@ import time
14
14
  from context_engine.models import Chunk
15
15
 
16
16
  _VECTOR_WEIGHT = 0.5
17
- _KEYWORD_WEIGHT = 0.3
18
- _RECENCY_WEIGHT = 0.2
17
+ _KEYWORD_WEIGHT = 0.4
18
+ _RECENCY_WEIGHT = 0.1
19
19
  _MAX_KEYWORD_DISTANCE = 5
20
20
  _RECENCY_HALF_LIFE = 7 * 24 * 3600 # 1 week
21
21
 
@@ -15,6 +15,9 @@ _RRF_K = 60
15
15
  # [0,1] by the best score in the candidate set so an exact-match FTS rank-1 hit
16
16
  # scores the same as a vector rank-1 hit instead of being clamped to ~1.0.
17
17
  _CONFIDENCE_WEIGHT = 0.5
18
+ # Max chunks from the same file in the final result set. Prevents one large
19
+ # file from dominating results and improves file-level precision.
20
+ _MAX_CHUNKS_PER_FILE = 3
18
21
  # When the parsed query looks like a code lookup, give FTS more pull because
19
22
  # exact-identifier hits are usually what the user wants.
20
23
  _FTS_BOOST_CODE_LOOKUP = 1.5
@@ -129,7 +132,20 @@ class HybridRetriever:
129
132
  scored.append((chunk, final_score))
130
133
 
131
134
  scored.sort(key=lambda x: x[1], reverse=True)
132
- ranked = [chunk for chunk, _ in scored[:top_k]]
135
+
136
+ # File diversity: cap chunks per file so one large file doesn't
137
+ # dominate the result set. This improves precision by letting
138
+ # chunks from more files surface into the top-k.
139
+ file_counts: dict[str, int] = {}
140
+ diverse: list[Chunk] = []
141
+ for chunk, _ in scored:
142
+ count = file_counts.get(chunk.file_path, 0)
143
+ if count < _MAX_CHUNKS_PER_FILE:
144
+ diverse.append(chunk)
145
+ file_counts[chunk.file_path] = count + 1
146
+ if len(diverse) >= top_k:
147
+ break
148
+ ranked = diverse
133
149
 
134
150
  # Graph expansion: fetch 1-2 bonus chunks from files reachable via
135
151
  # CALLS/IMPORTS edges from the top results.
@@ -31,7 +31,7 @@ def _run_uninstall_in(runner, project_dir: Path):
31
31
  original = Path.cwd()
32
32
  try:
33
33
  os.chdir(project_dir)
34
- return runner.invoke(main, ["uninstall"])
34
+ return runner.invoke(main, ["uninstall", "--yes"])
35
35
  finally:
36
36
  os.chdir(original)
37
37