code-context-engine 0.4.3__tar.gz → 0.4.5__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.3/src/code_context_engine.egg-info → code_context_engine-0.4.5}/PKG-INFO +21 -3
  2. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/README.md +17 -0
  3. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/pyproject.toml +4 -3
  4. {code_context_engine-0.4.3 → code_context_engine-0.4.5/src/code_context_engine.egg-info}/PKG-INFO +21 -3
  5. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/code_context_engine.egg-info/requires.txt +1 -0
  6. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/cli.py +2 -2
  7. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/config.py +2 -5
  8. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/dashboard/server.py +2 -1
  9. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/LICENSE +0 -0
  10. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/setup.cfg +0 -0
  11. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/code_context_engine.egg-info/SOURCES.txt +0 -0
  12. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/code_context_engine.egg-info/dependency_links.txt +0 -0
  13. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/code_context_engine.egg-info/entry_points.txt +0 -0
  14. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/code_context_engine.egg-info/top_level.txt +0 -0
  15. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/__init__.py +0 -0
  16. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/cli_style.py +0 -0
  17. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/compression/__init__.py +0 -0
  18. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/compression/compressor.py +0 -0
  19. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/compression/ollama_client.py +0 -0
  20. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/compression/output_rules.py +0 -0
  21. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/compression/prompts.py +0 -0
  22. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/compression/quality.py +0 -0
  23. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/dashboard/__init__.py +0 -0
  24. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/dashboard/_page.py +0 -0
  25. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/editors.py +0 -0
  26. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/event_bus.py +0 -0
  27. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/indexer/__init__.py +0 -0
  28. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/indexer/chunker.py +0 -0
  29. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/indexer/embedder.py +0 -0
  30. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/indexer/embedding_cache.py +0 -0
  31. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/indexer/git_hooks.py +0 -0
  32. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/indexer/git_indexer.py +0 -0
  33. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/indexer/ignorefile.py +0 -0
  34. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/indexer/manifest.py +0 -0
  35. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/indexer/pipeline.py +0 -0
  36. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/indexer/secrets.py +0 -0
  37. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/indexer/watcher.py +0 -0
  38. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/integration/__init__.py +0 -0
  39. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/integration/bootstrap.py +0 -0
  40. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/integration/git_context.py +0 -0
  41. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/integration/mcp_server.py +0 -0
  42. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/integration/session_capture.py +0 -0
  43. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/memory/__init__.py +0 -0
  44. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/memory/compressor.py +0 -0
  45. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/memory/db.py +0 -0
  46. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/memory/extractive.py +0 -0
  47. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/memory/grammar.py +0 -0
  48. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/memory/hook_installer.py +0 -0
  49. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/memory/hook_server.py +0 -0
  50. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/memory/hooks.py +0 -0
  51. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/memory/migrate.py +0 -0
  52. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/models.py +0 -0
  53. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/pricing.py +0 -0
  54. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/project_commands.py +0 -0
  55. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/retrieval/__init__.py +0 -0
  56. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/retrieval/confidence.py +0 -0
  57. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/retrieval/query_parser.py +0 -0
  58. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/retrieval/retriever.py +0 -0
  59. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/serve_http.py +0 -0
  60. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/services.py +0 -0
  61. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/storage/__init__.py +0 -0
  62. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/storage/backend.py +0 -0
  63. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/storage/fts_store.py +0 -0
  64. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/storage/graph_store.py +0 -0
  65. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/storage/local_backend.py +0 -0
  66. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/storage/remote_backend.py +0 -0
  67. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/storage/vector_store.py +0 -0
  68. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/src/context_engine/utils.py +0 -0
  69. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/tests/test_cli_init_probe.py +0 -0
  70. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/tests/test_cli_mcp_config.py +0 -0
  71. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/tests/test_cli_savings.py +0 -0
  72. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/tests/test_cli_savings_buckets.py +0 -0
  73. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/tests/test_cli_savings_e2e.py +0 -0
  74. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/tests/test_cli_serve.py +0 -0
  75. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/tests/test_cli_sessions_export.py +0 -0
  76. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/tests/test_cli_sessions_status.py +0 -0
  77. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/tests/test_cli_smoke.py +0 -0
  78. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/tests/test_cli_uninstall.py +0 -0
  79. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/tests/test_config.py +0 -0
  80. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/tests/test_e2e.py +0 -0
  81. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/tests/test_event_bus.py +0 -0
  82. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/tests/test_models.py +0 -0
  83. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/tests/test_project_commands.py +0 -0
  84. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/tests/test_real_life.py +0 -0
  85. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/tests/test_services.py +0 -0
  86. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/tests/test_token_efficiency.py +0 -0
  87. {code_context_engine-0.4.3 → code_context_engine-0.4.5}/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.3
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.5
4
+ Summary: Index your codebase. AI searches instead of re-reading files. 93% 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"
@@ -57,6 +58,7 @@ Dynamic: license-file
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
@@ -210,6 +220,14 @@ cce savings --all # see savings across all projects
210
220
 
211
221
  ---
212
222
 
223
+ ## How is CCE different?
224
+
225
+ 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.
226
+
227
+ See the [full comparison with alternatives](docs/comparison.md) for an honest look at trade-offs.
228
+
229
+ ---
230
+
213
231
  ## How it works (the short version)
214
232
 
215
233
  1. **Index:** Tree-sitter parses your code into semantic chunks (functions, classes, modules). Stored as vector embeddings locally.
@@ -9,6 +9,7 @@
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
@@ -162,6 +171,14 @@ cce savings --all # see savings across all projects
162
171
 
163
172
  ---
164
173
 
174
+ ## How is CCE different?
175
+
176
+ 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.
177
+
178
+ See the [full comparison with alternatives](docs/comparison.md) for an honest look at trade-offs.
179
+
180
+ ---
181
+
165
182
  ## How it works (the short version)
166
183
 
167
184
  1. **Index:** Tree-sitter parses your code into semantic chunks (functions, classes, modules). Stored as vector embeddings locally.
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "code-context-engine"
3
- version = "0.4.3"
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.5"
4
+ description = "Index your codebase. AI searches instead of re-reading files. 93% 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.3
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.5
4
+ Summary: Index your codebase. AI searches instead of re-reading files. 93% 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"
@@ -57,6 +58,7 @@ Dynamic: license-file
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
@@ -210,6 +220,14 @@ cce savings --all # see savings across all projects
210
220
 
211
221
  ---
212
222
 
223
+ ## How is CCE different?
224
+
225
+ 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.
226
+
227
+ See the [full comparison with alternatives](docs/comparison.md) for an honest look at trade-offs.
228
+
229
+ ---
230
+
213
231
  ## How it works (the short version)
214
232
 
215
233
  1. **Index:** Tree-sitter parses your code into semantic chunks (functions, classes, modules). Stored as vector embeddings locally.
@@ -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
@@ -1249,8 +1249,8 @@ def _run_savings_report(config, *, as_json: bool = False, all_projects: bool = F
1249
1249
  baseline = max(full_file, raw) if full_file > 0 else raw
1250
1250
  served = served_legacy
1251
1251
 
1252
- tokens_saved = max(0, baseline - served)
1253
- saved_pct = int(tokens_saved / baseline * 100) if baseline > 0 else 0
1252
+ tokens_saved = max(0, baseline - served) if queries > 0 else 0
1253
+ saved_pct = int(tokens_saved / baseline * 100) if baseline > 0 and queries > 0 else 0
1254
1254
 
1255
1255
  q_label = "query" if queries == 1 else "queries"
1256
1256
 
@@ -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:
@@ -142,8 +142,9 @@ def create_app(config: Config, project_dir: Path) -> FastAPI:
142
142
 
143
143
  full_file = stats.get("full_file_tokens", 0)
144
144
  served = stats.get("served_tokens", 0)
145
+ queries = stats.get("queries", 0)
145
146
  baseline = full_file if full_file > 0 else stats.get("raw_tokens", 0)
146
- saved_pct = max(0, int((1 - served / baseline) * 100)) if baseline > 0 else 0
147
+ saved_pct = max(0, int((1 - served / baseline) * 100)) if baseline > 0 and queries > 0 else 0
147
148
 
148
149
  output_level = state.get("output_level", config.output_compression)
149
150