contextl 1.2.48 → 1.2.49

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 (2) hide show
  1. package/README.md +54 -17
  2. package/package.json +2 -1
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # contextl
2
2
 
3
+ > **v1.2.49 is our most stable, thoroughly benchmarked release yet.**
4
+
3
5
  **Architecture intelligence for AI coding agents.**
4
6
 
5
7
  Stop letting your AI agent read your entire codebase to make one small change. `contextl` finds the exact files that matter — using graph theory, not guesswork.
@@ -12,23 +14,24 @@ lib/api.ts [high confidence]
12
14
  types/index.ts [medium confidence]
13
15
  ```
14
16
 
15
- No LLM. No embeddings. No API keys. No vector database. Pure dependency graph + text scoring — runs entirely on your machine, your code never leaves your laptop.
17
+ No LLM. No embeddings. No API keys. No vector database. Pure dependency graph + text scoring — runs entirely on your machine, your code never leaves your system.
16
18
 
17
19
  ---
18
20
 
19
21
  ## Install (60 seconds)
20
22
 
21
- **Requires Python 3.9+** on your PATH. Everything else (`networkx`, `mcp`) installs automatically on first run.
23
+ **Requires Python 3.9+** on your PATH. All required Python dependencies graph processing and tree-sitter parsers for 7 languages — install automatically on first run.
22
24
 
23
- ### Option 1: The AI Prompt Method (Recommended)
24
- Since you are using an AI IDE, you don't even need to edit the configuration yourself. Just open Cursor's Composer or Claude Code's chat and paste this prompt:
25
+ ```bash
26
+ npm install -g contextl && contextl install
27
+ ```
25
28
 
26
- > *"Hey, add the `contextl` MCP server to your configuration file. The command is `npx` and the args are `["-y", "contextl"]`."*
29
+ This will globally install the `contextl` CLI and automatically inject the correct configuration into your AI IDE (Cursor, Windsurf, Claude Code, etc.).
27
30
 
28
- The AI will find its own config file, inject the JSON, and reboot automatically.
31
+ Restart your IDE and the contextl tools will be instantly available to your agent!
29
32
 
30
- ### Option 2: The Manual Method
31
- If you prefer to configure it manually, add this to your IDE's MCP config file:
33
+ ### Manual Configuration (Fallback)
34
+ If the auto-installer doesn't detect your IDE, or if you prefer to configure it manually, add this to your IDE's MCP config file:
32
35
 
33
36
  ```json
34
37
  {
@@ -45,11 +48,13 @@ If you prefer to configure it manually, add this to your IDE's MCP config file:
45
48
 
46
49
  | IDE | Config path |
47
50
  |-----|-------------|
48
- | Gemini CLI | `~/.gemini/config/mcp_config.json` |
51
+ | Antigravity | `~/.gemini/config/mcp_config.json` |
52
+ | Claude Desktop | `~/.config/Claude/claude_desktop_config.json` (varies by OS) |
53
+ | Cline / Roo | `~/Documents/Cline/cline_mcp_settings.json` (varies by OS) |
49
54
  | Cursor | `~/.cursor/mcp.json` |
50
- | Windsurf | `~/.codeium/windsurf/mcp_config.json` |
51
55
  | Claude Code | `~/.claude.json` |
52
- | VS Code | `.vscode/mcp.json` |
56
+ | Windsurf | `~/.codeium/windsurf/mcp_config.json` |
57
+ | VS Code (Workspace) | `.vscode/mcp.json` |
53
58
 
54
59
  Restart your IDE. Done — no cloning, no Python setup beyond having it installed.
55
60
 
@@ -90,6 +95,8 @@ Walks the dependency graph upstream from any file to find every direct and trans
90
95
  Lists every source file `contextl` can see — useful for the agent to orient itself before doing anything else.
91
96
 
92
97
  ### `find_dead_files`
98
+ *"Which files are never imported by anything?"*
99
+
93
100
  Find files in the repository that are never imported by any other file (in-degree of 0 in the dependency graph).
94
101
 
95
102
  *Note: The engine automatically detects and excludes standard entry points (e.g. `src/index.ts`, `main.py`, `app.tsx`) and test files from these results, as they are intentionally not imported by other files.*
@@ -138,16 +145,43 @@ Extracts the structural skeleton (API surface) of a source file using Tree-sitte
138
145
  }
139
146
  ```
140
147
 
148
+ ---
149
+
150
+ ## Benchmarks & Token Reduction
151
+
152
+ Instead of dumping an entire repository into your agent's context window, `contextl` surgically extracts only the relevant dependencies. Across 9 real-world open source repositories, this results in massive token savings while maintaining high relationship accuracy:
153
+
154
+ - **JavaScript (Express)**: 93.58% context reduction
155
+ - **C++ (JSON)**: 84.31% context reduction
156
+ - **Python (Flask)**: 52.69% context reduction
157
+
158
+ See the full live telemetry and methodology breakdown at our [official documentation and metrics dashboard](https://contextl-web.vercel.app).
159
+
141
160
 
142
161
 
143
162
 
144
163
 
145
164
  ## How the ranking works
146
165
 
147
- 1. **Keyword match** does the filename contain query terms?
148
- 2. **Content match** — does the file's source code mention the terms?
149
- 3. **Graph proximity** files connected to high-scoring files get a relevance boost
150
- 4. **Centrality (PageRank)** heavily-connected files rank higher when scores tie
166
+ `contextl` relies strictly on deterministic mathematical scoring based on Okapi BM25 and graph theory. There are no LLMs or embeddings involved.
167
+
168
+ 1. **Keyword Match (Path / Filename)**
169
+ - Exact filename matches receive a massive `4.0x` IDF multiplier.
170
+ - Exact path matches receive a `2.0x` IDF multiplier.
171
+ - Substring and canonical abbreviation matches (e.g., `db` matching `database.py`) also receive significant boosts.
172
+ 2. **Content Match (BM25 TF-IDF & Structural Analysis)**
173
+ - Calculates Okapi BM25 Term Frequency (`k1=1.5`, `b=0.75`), using Document Length Normalization to aggressively penalize huge files (e.g., 5,000-line god classes) and normalize token counts.
174
+ - **TypeScript Exports**: Matches on `export const / class / function` receive a permanent `8.0x` multiplier.
175
+ - **Classes / Interfaces**: Matches on OOP class definitions receive up to a `10.0x` structural multiplier for short vibe queries.
176
+ - **Functions / Annotations**: Matches on method signatures and annotations receive a `4.0x` or `5.0x` boost.
177
+ 3. **Graph Proximity Bonus**
178
+ - Files directly adjacent in the dependency graph to high-scoring files receive a `0.2x` recursive relevance boost, pulling tightly coupled dependencies up the ranking.
179
+ 4. **Centrality Tiebreaker**
180
+ - The engine calculates PageRank across the entire repository graph. When files have identical or highly similar relevance scores, highly-central files heavily depended on by the rest of the codebase (like core `utils.py` or base classes) rank slightly higher.
181
+
182
+ *(Note: Test files are automatically penalized by 50% unless the natural language query explicitly contains words like "test" or "spec".)*
183
+
184
+ No machine learning involved — every score is fully explainable and traceable back to a specific signal.
151
185
 
152
186
  ---
153
187
 
@@ -174,7 +208,7 @@ contextl search ./my-repo "fix the auth flow"
174
208
  contextl impact ./my-repo src/api.ts
175
209
 
176
210
  # 3. Find dead unused files
177
- contextl dead-code ./my-repo
211
+ contextl standalone ./my-repo
178
212
 
179
213
  # 4. Generate an Obsidian vault
180
214
  contextl obsidian ./my-repo ./my_vault
@@ -189,7 +223,9 @@ contextl review ./my-repo
189
223
 
190
224
  ## Why this exists
191
225
 
192
- AI coding agents are increasingly good at writing code. They're still bad at knowing *where* to look. On a 5,000-file repo, an agent might read 100+ files just to change a logo. `contextl` exists to fix that and to eventually give agents a real model of your codebase's architecture, not just a file list.
226
+ AI coding agents are increasingly good at writing code. They're still bad at knowing *where* to look. On a massive monorepo, an agent might blindly read 100+ files just to change a logo. `contextl` exists to fix that by giving agents a deterministic, graph-based map of your architecture.
227
+
228
+ And it scales. We rigorously benchmark against massive open source repositories to ensure it can handle your monorepo. On `typeorm` (3,572 TypeScript files), the engine scans, parses, graphs, and searches the entire architecture in under 3 seconds. On Apache `superset` (5,897 mixed language files), the full end-to-end pipeline executes in ~44 seconds. No vector DBs, no cloud latency, just pure on-device intelligence.
193
229
 
194
230
  ---
195
231
 
@@ -205,6 +241,7 @@ Same engine, same tools — installable via PyPI for Python-first workflows.
205
241
 
206
242
  ## Links
207
243
 
244
+ - [Official Documentation & Benchmarks](https://contextl-web.vercel.app)
208
245
  - [Creator GitHub](https://github.com/DS0710-coder)
209
246
  - [PyPI package](https://pypi.org/project/contextl-mcp)
210
247
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contextl",
3
- "version": "1.2.48",
3
+ "version": "1.2.49",
4
4
  "description": "contextl — finds the most relevant files in your codebase for any change request. MCP server for AI coding agents.",
5
5
  "keywords": [
6
6
  "mcp",
@@ -28,6 +28,7 @@
28
28
  "bin": {
29
29
  "contextl": "bin/contextl.js"
30
30
  },
31
+ "preferGlobal": true,
31
32
  "files": [
32
33
  "bin/",
33
34
  "python/",