code-context-engine 0.4.20__tar.gz → 0.4.22__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.
- {code_context_engine-0.4.20/src/code_context_engine.egg-info → code_context_engine-0.4.22}/PKG-INFO +76 -16
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/README.md +75 -15
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/pyproject.toml +1 -1
- {code_context_engine-0.4.20 → code_context_engine-0.4.22/src/code_context_engine.egg-info}/PKG-INFO +76 -16
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/code_context_engine.egg-info/SOURCES.txt +1 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/cli.py +326 -81
- code_context_engine-0.4.22/src/context_engine/compression/output_rules.py +146 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/editors.py +31 -4
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/indexer/embedder.py +58 -8
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/memory/db.py +8 -0
- code_context_engine-0.4.22/src/context_engine/pricing.py +148 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/storage/vector_store.py +17 -3
- code_context_engine-0.4.22/tests/test_cli_init_agents.py +155 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/tests/test_cli_savings.py +4 -4
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/tests/test_cli_savings_e2e.py +5 -5
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/tests/test_cli_smoke.py +41 -7
- code_context_engine-0.4.20/src/context_engine/compression/output_rules.py +0 -77
- code_context_engine-0.4.20/src/context_engine/pricing.py +0 -104
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/LICENSE +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/setup.cfg +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/code_context_engine.egg-info/dependency_links.txt +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/code_context_engine.egg-info/entry_points.txt +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/code_context_engine.egg-info/requires.txt +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/code_context_engine.egg-info/top_level.txt +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/__init__.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/cli_style.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/compression/__init__.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/compression/compressor.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/compression/ollama_client.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/compression/prompts.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/compression/quality.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/config.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/dashboard/__init__.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/dashboard/_page.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/dashboard/server.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/event_bus.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/indexer/__init__.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/indexer/chunker.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/indexer/embedding_cache.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/indexer/git_hooks.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/indexer/git_indexer.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/indexer/ignorefile.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/indexer/manifest.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/indexer/pipeline.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/indexer/secrets.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/indexer/watcher.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/integration/__init__.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/integration/bootstrap.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/integration/git_context.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/integration/mcp_server.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/integration/session_capture.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/memory/__init__.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/memory/compressor.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/memory/decision_extractor.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/memory/extractive.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/memory/grammar.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/memory/hook_installer.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/memory/hook_server.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/memory/hooks.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/memory/migrate.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/models.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/project_commands.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/retrieval/__init__.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/retrieval/confidence.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/retrieval/query_parser.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/retrieval/retriever.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/serve_http.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/services.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/storage/__init__.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/storage/backend.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/storage/fts_store.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/storage/graph_store.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/storage/local_backend.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/storage/remote_backend.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/src/context_engine/utils.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/tests/test_cli_init_probe.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/tests/test_cli_mcp_config.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/tests/test_cli_safe_cwd.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/tests/test_cli_savings_buckets.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/tests/test_cli_serve.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/tests/test_cli_sessions_export.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/tests/test_cli_sessions_status.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/tests/test_cli_uninstall.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/tests/test_config.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/tests/test_e2e.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/tests/test_editors_codex.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/tests/test_editors_opencode.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/tests/test_event_bus.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/tests/test_models.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/tests/test_project_commands.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/tests/test_real_life.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/tests/test_services.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/tests/test_token_efficiency.py +0 -0
- {code_context_engine-0.4.20 → code_context_engine-0.4.22}/tests/test_token_packing.py +0 -0
{code_context_engine-0.4.20/src/code_context_engine.egg-info → code_context_engine-0.4.22}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: code-context-engine
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.22
|
|
4
4
|
Summary: Save 94% on Claude Code tokens. Index your codebase locally, AI agents search instead of reading files. Reduce Claude API costs, save tokens on Cursor, VS Code, Gemini CLI. Free, open source MCP server.
|
|
5
5
|
Author-email: Fazle Elahee <felahee@gmail.com>, Raj <rajkumar.sakti@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -115,15 +115,17 @@ Dynamic: license-file
|
|
|
115
115
|
|
|
116
116
|
---
|
|
117
117
|
|
|
118
|
-
## Quick start
|
|
118
|
+
## Quick start
|
|
119
119
|
|
|
120
120
|
```bash
|
|
121
|
-
uv tool install code-context-engine
|
|
121
|
+
uv tool install "code-context-engine[local]" # or: pipx install "code-context-engine[local]"
|
|
122
122
|
cd /path/to/your/project
|
|
123
|
-
cce init
|
|
123
|
+
cce init # or: cce init --agent all
|
|
124
124
|
```
|
|
125
125
|
|
|
126
|
-
That's it.
|
|
126
|
+
That's it. Your AI coding agent now searches your index instead of reading entire files.
|
|
127
|
+
|
|
128
|
+
> **Already have Ollama?** You can skip `[local]` and use `uv tool install code-context-engine` instead. CCE auto-detects Ollama at localhost:11434 and uses `nomic-embed-text`.
|
|
127
129
|
|
|
128
130
|
---
|
|
129
131
|
|
|
@@ -143,35 +145,42 @@ Tested on all three platforms in CI (macOS, Linux, Windows × Python 3.11/3.12/3
|
|
|
143
145
|
|
|
144
146
|
## Install and see savings in 60 seconds
|
|
145
147
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
148
|
+
You need an embedding backend to index code. Pick one:
|
|
149
|
+
|
|
150
|
+
| Option | Install command | Size | Requires |
|
|
151
|
+
|--------|----------------|------|----------|
|
|
152
|
+
| **Local (recommended)** | `uv tool install "code-context-engine[local]"` | +60 MB | Nothing else |
|
|
153
|
+
| **Ollama** | `uv tool install code-context-engine` | Core only | Ollama running + `nomic-embed-text` pulled |
|
|
151
154
|
|
|
152
|
-
|
|
155
|
+
Then:
|
|
153
156
|
|
|
154
157
|
```bash
|
|
155
|
-
|
|
158
|
+
cd /path/to/your/project
|
|
159
|
+
cce init # index, install hooks, register MCP server
|
|
156
160
|
```
|
|
157
161
|
|
|
158
162
|
Restart your editor. Done. Every question now hits the index instead of re-reading files.
|
|
159
163
|
|
|
160
|
-
`cce init` auto-detects your editor and writes the right config
|
|
164
|
+
`cce init` auto-detects your editor and writes the right config. To target a
|
|
165
|
+
specific agent, use `--agent claude`, `--agent codex`, `--agent copilot`, or
|
|
166
|
+
`--agent all`.
|
|
161
167
|
|
|
162
168
|
| Editor | Config written | Instructions |
|
|
163
169
|
|--------|---------------|--------------|
|
|
164
170
|
| Claude Code | `.mcp.json` | `CLAUDE.md` |
|
|
165
|
-
| VS Code / Copilot | `.vscode/mcp.json` | |
|
|
171
|
+
| VS Code / Copilot | `.vscode/mcp.json` | `.github/copilot-instructions.md` |
|
|
166
172
|
| Cursor | `.cursor/mcp.json` | `.cursorrules` |
|
|
167
173
|
| Gemini CLI | `.gemini/settings.json` | `GEMINI.md` |
|
|
168
|
-
| OpenAI Codex | `~/.codex/config.toml` (user-global, per-project section) | |
|
|
174
|
+
| OpenAI Codex | `~/.codex/config.toml` (user-global, per-project section) | `AGENTS.md` |
|
|
169
175
|
| OpenCode | `opencode.json` | |
|
|
170
176
|
| Tabnine | `.tabnine/agent/settings.json` | `TABNINE.md` |
|
|
171
177
|
|
|
172
178
|
Multiple editors in the same project? All get configured in one command.
|
|
173
179
|
|
|
174
|
-
**Codex note:** Codex CLI reads MCP servers from `~/.codex/config.toml` only —
|
|
180
|
+
**Codex note:** Codex CLI reads MCP servers from `~/.codex/config.toml` only —
|
|
181
|
+
it has no per-project config. `cce init` adds one `[mcp_servers.cce-<project>-<hash>]`
|
|
182
|
+
section per project so multiple projects coexist; `cce uninstall` removes only
|
|
183
|
+
the section for the current project.
|
|
175
184
|
|
|
176
185
|
```
|
|
177
186
|
my-project · 38 queries
|
|
@@ -487,6 +496,57 @@ All other text files are chunked by line range. Binary files are skipped.
|
|
|
487
496
|
|
|
488
497
|
---
|
|
489
498
|
|
|
499
|
+
## FAQ
|
|
500
|
+
|
|
501
|
+
### Does CCE affect response quality?
|
|
502
|
+
|
|
503
|
+
No. Quality stays the same or slightly improves.
|
|
504
|
+
|
|
505
|
+
CCE replaces "dump the entire file" with "search for the relevant function." The model still gets the code it needs (0.90 Recall@10 in benchmarks). Less irrelevant context means less noise competing for attention, which can improve the model's focus on your actual question.
|
|
506
|
+
|
|
507
|
+
### How does output token savings work?
|
|
508
|
+
|
|
509
|
+
CCE writes output compression rules directly into your agent's instruction files (`CLAUDE.md`, `AGENTS.md`, `.cursorrules`, etc.) during `cce init`. These rules apply to the **entire session**, not just CCE tool responses, so every reply from the agent follows them.
|
|
510
|
+
|
|
511
|
+
Set the level in `cce.yaml`:
|
|
512
|
+
|
|
513
|
+
```yaml
|
|
514
|
+
compression:
|
|
515
|
+
output: max # off | lite | standard | max
|
|
516
|
+
```
|
|
517
|
+
|
|
518
|
+
Then re-run `cce init` to update instruction files. Or change at runtime:
|
|
519
|
+
|
|
520
|
+
```
|
|
521
|
+
set_output_level output_level=max
|
|
522
|
+
```
|
|
523
|
+
|
|
524
|
+
| Level | Savings | What it does |
|
|
525
|
+
|-------|---------|--------------|
|
|
526
|
+
| `off` | 0% | No compression |
|
|
527
|
+
| `lite` | ~25% | Removes filler/hedging/pleasantries + diff-only for code changes |
|
|
528
|
+
| `standard` | ~70% | Drops articles, fragments, short synonyms + diff-only for code |
|
|
529
|
+
| `max` | ~80% | Telegraphic style + diff-only for code |
|
|
530
|
+
|
|
531
|
+
Default is `standard`. All levels include **code output rules** that tell the model to show only changed lines (not full file rewrites), which is where most output tokens go in coding sessions. The `max` level produces very terse prose (similar to "caveman mode"). Code blocks, paths, and commands are never compressed regardless of level.
|
|
532
|
+
|
|
533
|
+
### Where do the savings come from?
|
|
534
|
+
|
|
535
|
+
Most savings are **input tokens** (what goes into the model):
|
|
536
|
+
|
|
537
|
+
| Layer | Type | Typical savings |
|
|
538
|
+
|-------|------|-----------------|
|
|
539
|
+
| Retrieval | Input | 94% (full files → relevant chunks) |
|
|
540
|
+
| Chunk compression | Input | 89% (chunks → signatures) |
|
|
541
|
+
| Grammar compression | Input | 13% (article/filler removal) |
|
|
542
|
+
| Turn summarization | Input | varies (session history) |
|
|
543
|
+
| Progressive disclosure | Input | varies (tool payloads) |
|
|
544
|
+
| Output compression | Output | 25-80% (depends on level) |
|
|
545
|
+
|
|
546
|
+
Output tokens cost 5x more per token (e.g. Opus: $15/1M input vs $75/1M output), so even a small output reduction has outsized cost impact.
|
|
547
|
+
|
|
548
|
+
---
|
|
549
|
+
|
|
490
550
|
## Roadmap
|
|
491
551
|
|
|
492
552
|
- [x] Multi-repo benchmarks (FastAPI, chi, fiber)
|
|
@@ -64,15 +64,17 @@
|
|
|
64
64
|
|
|
65
65
|
---
|
|
66
66
|
|
|
67
|
-
## Quick start
|
|
67
|
+
## Quick start
|
|
68
68
|
|
|
69
69
|
```bash
|
|
70
|
-
uv tool install code-context-engine
|
|
70
|
+
uv tool install "code-context-engine[local]" # or: pipx install "code-context-engine[local]"
|
|
71
71
|
cd /path/to/your/project
|
|
72
|
-
cce init
|
|
72
|
+
cce init # or: cce init --agent all
|
|
73
73
|
```
|
|
74
74
|
|
|
75
|
-
That's it.
|
|
75
|
+
That's it. Your AI coding agent now searches your index instead of reading entire files.
|
|
76
|
+
|
|
77
|
+
> **Already have Ollama?** You can skip `[local]` and use `uv tool install code-context-engine` instead. CCE auto-detects Ollama at localhost:11434 and uses `nomic-embed-text`.
|
|
76
78
|
|
|
77
79
|
---
|
|
78
80
|
|
|
@@ -92,35 +94,42 @@ Tested on all three platforms in CI (macOS, Linux, Windows × Python 3.11/3.12/3
|
|
|
92
94
|
|
|
93
95
|
## Install and see savings in 60 seconds
|
|
94
96
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
You need an embedding backend to index code. Pick one:
|
|
98
|
+
|
|
99
|
+
| Option | Install command | Size | Requires |
|
|
100
|
+
|--------|----------------|------|----------|
|
|
101
|
+
| **Local (recommended)** | `uv tool install "code-context-engine[local]"` | +60 MB | Nothing else |
|
|
102
|
+
| **Ollama** | `uv tool install code-context-engine` | Core only | Ollama running + `nomic-embed-text` pulled |
|
|
100
103
|
|
|
101
|
-
|
|
104
|
+
Then:
|
|
102
105
|
|
|
103
106
|
```bash
|
|
104
|
-
|
|
107
|
+
cd /path/to/your/project
|
|
108
|
+
cce init # index, install hooks, register MCP server
|
|
105
109
|
```
|
|
106
110
|
|
|
107
111
|
Restart your editor. Done. Every question now hits the index instead of re-reading files.
|
|
108
112
|
|
|
109
|
-
`cce init` auto-detects your editor and writes the right config
|
|
113
|
+
`cce init` auto-detects your editor and writes the right config. To target a
|
|
114
|
+
specific agent, use `--agent claude`, `--agent codex`, `--agent copilot`, or
|
|
115
|
+
`--agent all`.
|
|
110
116
|
|
|
111
117
|
| Editor | Config written | Instructions |
|
|
112
118
|
|--------|---------------|--------------|
|
|
113
119
|
| Claude Code | `.mcp.json` | `CLAUDE.md` |
|
|
114
|
-
| VS Code / Copilot | `.vscode/mcp.json` | |
|
|
120
|
+
| VS Code / Copilot | `.vscode/mcp.json` | `.github/copilot-instructions.md` |
|
|
115
121
|
| Cursor | `.cursor/mcp.json` | `.cursorrules` |
|
|
116
122
|
| Gemini CLI | `.gemini/settings.json` | `GEMINI.md` |
|
|
117
|
-
| OpenAI Codex | `~/.codex/config.toml` (user-global, per-project section) | |
|
|
123
|
+
| OpenAI Codex | `~/.codex/config.toml` (user-global, per-project section) | `AGENTS.md` |
|
|
118
124
|
| OpenCode | `opencode.json` | |
|
|
119
125
|
| Tabnine | `.tabnine/agent/settings.json` | `TABNINE.md` |
|
|
120
126
|
|
|
121
127
|
Multiple editors in the same project? All get configured in one command.
|
|
122
128
|
|
|
123
|
-
**Codex note:** Codex CLI reads MCP servers from `~/.codex/config.toml` only —
|
|
129
|
+
**Codex note:** Codex CLI reads MCP servers from `~/.codex/config.toml` only —
|
|
130
|
+
it has no per-project config. `cce init` adds one `[mcp_servers.cce-<project>-<hash>]`
|
|
131
|
+
section per project so multiple projects coexist; `cce uninstall` removes only
|
|
132
|
+
the section for the current project.
|
|
124
133
|
|
|
125
134
|
```
|
|
126
135
|
my-project · 38 queries
|
|
@@ -436,6 +445,57 @@ All other text files are chunked by line range. Binary files are skipped.
|
|
|
436
445
|
|
|
437
446
|
---
|
|
438
447
|
|
|
448
|
+
## FAQ
|
|
449
|
+
|
|
450
|
+
### Does CCE affect response quality?
|
|
451
|
+
|
|
452
|
+
No. Quality stays the same or slightly improves.
|
|
453
|
+
|
|
454
|
+
CCE replaces "dump the entire file" with "search for the relevant function." The model still gets the code it needs (0.90 Recall@10 in benchmarks). Less irrelevant context means less noise competing for attention, which can improve the model's focus on your actual question.
|
|
455
|
+
|
|
456
|
+
### How does output token savings work?
|
|
457
|
+
|
|
458
|
+
CCE writes output compression rules directly into your agent's instruction files (`CLAUDE.md`, `AGENTS.md`, `.cursorrules`, etc.) during `cce init`. These rules apply to the **entire session**, not just CCE tool responses, so every reply from the agent follows them.
|
|
459
|
+
|
|
460
|
+
Set the level in `cce.yaml`:
|
|
461
|
+
|
|
462
|
+
```yaml
|
|
463
|
+
compression:
|
|
464
|
+
output: max # off | lite | standard | max
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
Then re-run `cce init` to update instruction files. Or change at runtime:
|
|
468
|
+
|
|
469
|
+
```
|
|
470
|
+
set_output_level output_level=max
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
| Level | Savings | What it does |
|
|
474
|
+
|-------|---------|--------------|
|
|
475
|
+
| `off` | 0% | No compression |
|
|
476
|
+
| `lite` | ~25% | Removes filler/hedging/pleasantries + diff-only for code changes |
|
|
477
|
+
| `standard` | ~70% | Drops articles, fragments, short synonyms + diff-only for code |
|
|
478
|
+
| `max` | ~80% | Telegraphic style + diff-only for code |
|
|
479
|
+
|
|
480
|
+
Default is `standard`. All levels include **code output rules** that tell the model to show only changed lines (not full file rewrites), which is where most output tokens go in coding sessions. The `max` level produces very terse prose (similar to "caveman mode"). Code blocks, paths, and commands are never compressed regardless of level.
|
|
481
|
+
|
|
482
|
+
### Where do the savings come from?
|
|
483
|
+
|
|
484
|
+
Most savings are **input tokens** (what goes into the model):
|
|
485
|
+
|
|
486
|
+
| Layer | Type | Typical savings |
|
|
487
|
+
|-------|------|-----------------|
|
|
488
|
+
| Retrieval | Input | 94% (full files → relevant chunks) |
|
|
489
|
+
| Chunk compression | Input | 89% (chunks → signatures) |
|
|
490
|
+
| Grammar compression | Input | 13% (article/filler removal) |
|
|
491
|
+
| Turn summarization | Input | varies (session history) |
|
|
492
|
+
| Progressive disclosure | Input | varies (tool payloads) |
|
|
493
|
+
| Output compression | Output | 25-80% (depends on level) |
|
|
494
|
+
|
|
495
|
+
Output tokens cost 5x more per token (e.g. Opus: $15/1M input vs $75/1M output), so even a small output reduction has outsized cost impact.
|
|
496
|
+
|
|
497
|
+
---
|
|
498
|
+
|
|
439
499
|
## Roadmap
|
|
440
500
|
|
|
441
501
|
- [x] Multi-repo benchmarks (FastAPI, chi, fiber)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "code-context-engine"
|
|
3
|
-
version = "0.4.
|
|
3
|
+
version = "0.4.22"
|
|
4
4
|
description = "Save 94% on Claude Code tokens. Index your codebase locally, AI agents search instead of reading files. Reduce Claude API costs, save tokens on Cursor, VS Code, Gemini CLI. Free, open source MCP server."
|
|
5
5
|
readme = {file = "README.md", content-type = "text/markdown"}
|
|
6
6
|
license = "MIT"
|
{code_context_engine-0.4.20 → code_context_engine-0.4.22/src/code_context_engine.egg-info}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: code-context-engine
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.22
|
|
4
4
|
Summary: Save 94% on Claude Code tokens. Index your codebase locally, AI agents search instead of reading files. Reduce Claude API costs, save tokens on Cursor, VS Code, Gemini CLI. Free, open source MCP server.
|
|
5
5
|
Author-email: Fazle Elahee <felahee@gmail.com>, Raj <rajkumar.sakti@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -115,15 +115,17 @@ Dynamic: license-file
|
|
|
115
115
|
|
|
116
116
|
---
|
|
117
117
|
|
|
118
|
-
## Quick start
|
|
118
|
+
## Quick start
|
|
119
119
|
|
|
120
120
|
```bash
|
|
121
|
-
uv tool install code-context-engine
|
|
121
|
+
uv tool install "code-context-engine[local]" # or: pipx install "code-context-engine[local]"
|
|
122
122
|
cd /path/to/your/project
|
|
123
|
-
cce init
|
|
123
|
+
cce init # or: cce init --agent all
|
|
124
124
|
```
|
|
125
125
|
|
|
126
|
-
That's it.
|
|
126
|
+
That's it. Your AI coding agent now searches your index instead of reading entire files.
|
|
127
|
+
|
|
128
|
+
> **Already have Ollama?** You can skip `[local]` and use `uv tool install code-context-engine` instead. CCE auto-detects Ollama at localhost:11434 and uses `nomic-embed-text`.
|
|
127
129
|
|
|
128
130
|
---
|
|
129
131
|
|
|
@@ -143,35 +145,42 @@ Tested on all three platforms in CI (macOS, Linux, Windows × Python 3.11/3.12/3
|
|
|
143
145
|
|
|
144
146
|
## Install and see savings in 60 seconds
|
|
145
147
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
148
|
+
You need an embedding backend to index code. Pick one:
|
|
149
|
+
|
|
150
|
+
| Option | Install command | Size | Requires |
|
|
151
|
+
|--------|----------------|------|----------|
|
|
152
|
+
| **Local (recommended)** | `uv tool install "code-context-engine[local]"` | +60 MB | Nothing else |
|
|
153
|
+
| **Ollama** | `uv tool install code-context-engine` | Core only | Ollama running + `nomic-embed-text` pulled |
|
|
151
154
|
|
|
152
|
-
|
|
155
|
+
Then:
|
|
153
156
|
|
|
154
157
|
```bash
|
|
155
|
-
|
|
158
|
+
cd /path/to/your/project
|
|
159
|
+
cce init # index, install hooks, register MCP server
|
|
156
160
|
```
|
|
157
161
|
|
|
158
162
|
Restart your editor. Done. Every question now hits the index instead of re-reading files.
|
|
159
163
|
|
|
160
|
-
`cce init` auto-detects your editor and writes the right config
|
|
164
|
+
`cce init` auto-detects your editor and writes the right config. To target a
|
|
165
|
+
specific agent, use `--agent claude`, `--agent codex`, `--agent copilot`, or
|
|
166
|
+
`--agent all`.
|
|
161
167
|
|
|
162
168
|
| Editor | Config written | Instructions |
|
|
163
169
|
|--------|---------------|--------------|
|
|
164
170
|
| Claude Code | `.mcp.json` | `CLAUDE.md` |
|
|
165
|
-
| VS Code / Copilot | `.vscode/mcp.json` | |
|
|
171
|
+
| VS Code / Copilot | `.vscode/mcp.json` | `.github/copilot-instructions.md` |
|
|
166
172
|
| Cursor | `.cursor/mcp.json` | `.cursorrules` |
|
|
167
173
|
| Gemini CLI | `.gemini/settings.json` | `GEMINI.md` |
|
|
168
|
-
| OpenAI Codex | `~/.codex/config.toml` (user-global, per-project section) | |
|
|
174
|
+
| OpenAI Codex | `~/.codex/config.toml` (user-global, per-project section) | `AGENTS.md` |
|
|
169
175
|
| OpenCode | `opencode.json` | |
|
|
170
176
|
| Tabnine | `.tabnine/agent/settings.json` | `TABNINE.md` |
|
|
171
177
|
|
|
172
178
|
Multiple editors in the same project? All get configured in one command.
|
|
173
179
|
|
|
174
|
-
**Codex note:** Codex CLI reads MCP servers from `~/.codex/config.toml` only —
|
|
180
|
+
**Codex note:** Codex CLI reads MCP servers from `~/.codex/config.toml` only —
|
|
181
|
+
it has no per-project config. `cce init` adds one `[mcp_servers.cce-<project>-<hash>]`
|
|
182
|
+
section per project so multiple projects coexist; `cce uninstall` removes only
|
|
183
|
+
the section for the current project.
|
|
175
184
|
|
|
176
185
|
```
|
|
177
186
|
my-project · 38 queries
|
|
@@ -487,6 +496,57 @@ All other text files are chunked by line range. Binary files are skipped.
|
|
|
487
496
|
|
|
488
497
|
---
|
|
489
498
|
|
|
499
|
+
## FAQ
|
|
500
|
+
|
|
501
|
+
### Does CCE affect response quality?
|
|
502
|
+
|
|
503
|
+
No. Quality stays the same or slightly improves.
|
|
504
|
+
|
|
505
|
+
CCE replaces "dump the entire file" with "search for the relevant function." The model still gets the code it needs (0.90 Recall@10 in benchmarks). Less irrelevant context means less noise competing for attention, which can improve the model's focus on your actual question.
|
|
506
|
+
|
|
507
|
+
### How does output token savings work?
|
|
508
|
+
|
|
509
|
+
CCE writes output compression rules directly into your agent's instruction files (`CLAUDE.md`, `AGENTS.md`, `.cursorrules`, etc.) during `cce init`. These rules apply to the **entire session**, not just CCE tool responses, so every reply from the agent follows them.
|
|
510
|
+
|
|
511
|
+
Set the level in `cce.yaml`:
|
|
512
|
+
|
|
513
|
+
```yaml
|
|
514
|
+
compression:
|
|
515
|
+
output: max # off | lite | standard | max
|
|
516
|
+
```
|
|
517
|
+
|
|
518
|
+
Then re-run `cce init` to update instruction files. Or change at runtime:
|
|
519
|
+
|
|
520
|
+
```
|
|
521
|
+
set_output_level output_level=max
|
|
522
|
+
```
|
|
523
|
+
|
|
524
|
+
| Level | Savings | What it does |
|
|
525
|
+
|-------|---------|--------------|
|
|
526
|
+
| `off` | 0% | No compression |
|
|
527
|
+
| `lite` | ~25% | Removes filler/hedging/pleasantries + diff-only for code changes |
|
|
528
|
+
| `standard` | ~70% | Drops articles, fragments, short synonyms + diff-only for code |
|
|
529
|
+
| `max` | ~80% | Telegraphic style + diff-only for code |
|
|
530
|
+
|
|
531
|
+
Default is `standard`. All levels include **code output rules** that tell the model to show only changed lines (not full file rewrites), which is where most output tokens go in coding sessions. The `max` level produces very terse prose (similar to "caveman mode"). Code blocks, paths, and commands are never compressed regardless of level.
|
|
532
|
+
|
|
533
|
+
### Where do the savings come from?
|
|
534
|
+
|
|
535
|
+
Most savings are **input tokens** (what goes into the model):
|
|
536
|
+
|
|
537
|
+
| Layer | Type | Typical savings |
|
|
538
|
+
|-------|------|-----------------|
|
|
539
|
+
| Retrieval | Input | 94% (full files → relevant chunks) |
|
|
540
|
+
| Chunk compression | Input | 89% (chunks → signatures) |
|
|
541
|
+
| Grammar compression | Input | 13% (article/filler removal) |
|
|
542
|
+
| Turn summarization | Input | varies (session history) |
|
|
543
|
+
| Progressive disclosure | Input | varies (tool payloads) |
|
|
544
|
+
| Output compression | Output | 25-80% (depends on level) |
|
|
545
|
+
|
|
546
|
+
Output tokens cost 5x more per token (e.g. Opus: $15/1M input vs $75/1M output), so even a small output reduction has outsized cost impact.
|
|
547
|
+
|
|
548
|
+
---
|
|
549
|
+
|
|
490
550
|
## Roadmap
|
|
491
551
|
|
|
492
552
|
- [x] Multi-repo benchmarks (FastAPI, chi, fiber)
|
|
@@ -65,6 +65,7 @@ src/context_engine/storage/graph_store.py
|
|
|
65
65
|
src/context_engine/storage/local_backend.py
|
|
66
66
|
src/context_engine/storage/remote_backend.py
|
|
67
67
|
src/context_engine/storage/vector_store.py
|
|
68
|
+
tests/test_cli_init_agents.py
|
|
68
69
|
tests/test_cli_init_probe.py
|
|
69
70
|
tests/test_cli_mcp_config.py
|
|
70
71
|
tests/test_cli_safe_cwd.py
|