smart-coding-mcp 2.2.0 → 2.3.0

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.
package/README.md CHANGED
@@ -5,18 +5,7 @@
5
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
6
6
  [![Node.js](https://img.shields.io/badge/Node.js-%3E%3D18-green.svg)](https://nodejs.org/)
7
7
 
8
- An extensible Model Context Protocol (MCP) server that provides intelligent semantic code search for AI assistants. Built with local AI models using Matryoshka Representation Learning (MRL) for flexible embedding dimensions (64-768d.
9
-
10
- ### Available Tools
11
-
12
- | Tool | Description | Example |
13
- | ---------------------- | ------------------------------------------------- | ----------------------------------------------- |
14
- | `semantic_search` | Find code by meaning, not just keywords | `"Where do we validate user input?"` |
15
- | `index_codebase` | Manually trigger reindexing | Use after major refactoring or branch switches |
16
- | `clear_cache` | Reset the embeddings cache | Useful when cache becomes corrupted |
17
- | `d_check_last_version` | Get latest version of any package (20 ecosystems) | `"express"`, `"npm:react"`, `"pip:requests"` |
18
- | `e_set_workspace` | Change project path at runtime | Switch to different project without restart |
19
- | `f_get_status` | Get server info: version, index status, config | Check indexing progress, model info, cache size |
8
+ An extensible Model Context Protocol (MCP) server that provides intelligent semantic code search for AI assistants. Built with local AI models using Matryoshka Representation Learning (MRL) for flexible embedding dimensions (64-768d).
20
9
 
21
10
  ## What This Does
22
11
 
@@ -26,95 +15,139 @@ This MCP server solves that by indexing your codebase with AI embeddings. Your A
26
15
 
27
16
  ![Example](example.png)
28
17
 
29
- ## Why Use This
18
+ ## Available Tools
30
19
 
31
- **Better Code Understanding**
20
+ ### 🔍 `a_semantic_search` - Find Code by Meaning
32
21
 
33
- - Search finds code by concept, not just matching words
34
- - Works with typos and variations in terminology
35
- - Natural language queries like "where do we validate user input?"
22
+ The primary tool for codebase exploration. Uses AI embeddings to understand what you're looking for, not just match keywords.
36
23
 
37
- **Performance**
24
+ **How it works:** Converts your natural language query into a vector, then finds code chunks with similar meaning using cosine similarity + exact match boosting.
38
25
 
39
- - Pre-indexed embeddings are faster than scanning files at runtime
40
- - Smart project detection skips dependencies automatically (node_modules, vendor, etc.)
41
- - Incremental updates - only re-processes changed files
26
+ **Best for:**
27
+ - Exploring unfamiliar codebases: `"How does authentication work?"`
28
+ - Finding related code: `"Where do we validate user input?"`
29
+ - Conceptual searches: `"error handling patterns"`
30
+ - Works even with typos: `"embeding modle initializashun"` still finds embedding code
42
31
 
43
- **Privacy**
32
+ **Example queries:**
33
+ ```
34
+ "Where do we handle cache persistence?"
35
+ "How is the database connection managed?"
36
+ "Find all API endpoint definitions"
37
+ ```
44
38
 
45
- - Everything runs locally on your machine
46
- - Your code never leaves your system
47
- - No API calls to external services
39
+ ---
48
40
 
49
- ## Performance & Resource Management
41
+ ### 📦 `d_check_last_version` - Package Version Lookup
50
42
 
51
- **Progressive Indexing**
43
+ Fetches the latest version of any package from its official registry. Supports 20+ ecosystems.
52
44
 
53
- - Search works immediately, even while indexing continues (like video buffering)
54
- - Incremental saves every 5 batches - no data loss if interrupted
55
- - Real-time indexing status shown when searching during indexing
45
+ **How it works:** Queries official package registries (npm, PyPI, Crates.io, etc.) in real-time. No guessing, no stale training data.
56
46
 
57
- **Resource Throttling**
47
+ **Supported ecosystems:** npm, PyPI, Crates.io, Maven, Go, RubyGems, NuGet, Packagist, Hex, pub.dev, Homebrew, Conda, and more.
58
48
 
59
- - CPU usage limited to 50% by default (configurable)
60
- - Your laptop stays responsive during indexing
61
- - Configurable delays between batches
62
- - Worker thread limits respect system resources
49
+ **Best for:**
50
+ - Before adding dependencies: `"express"` `4.18.2`
51
+ - Checking for updates: `"pip:requests"` → `2.31.0`
52
+ - Multi-ecosystem projects: `"npm:react"`, `"go:github.com/gin-gonic/gin"`
63
53
 
64
- **SQLite Cache**
54
+ **Example usage:**
55
+ ```
56
+ "What's the latest version of lodash?"
57
+ "Check if there's a newer version of axios"
58
+ ```
65
59
 
66
- - 5-10x faster than JSON for large codebases
67
- - Write-Ahead Logging (WAL) for better concurrency
68
- - Binary blob storage for smaller cache size
69
- - Automatic migration from JSON
60
+ ---
70
61
 
71
- **Optimized Defaults**
62
+ ### 🔄 `b_index_codebase` - Manual Reindexing
72
63
 
73
- - 128d embeddings by default (2x faster than 256d, minimal quality loss)
74
- - Smart batch sizing based on project size
75
- - Parallel processing with auto-tuned worker threads
64
+ Triggers a full reindex of your codebase. Normally not needed since indexing is automatic and incremental.
76
65
 
77
- ## Installation
66
+ **How it works:** Scans all files, generates new embeddings, and updates the SQLite cache. Uses progressive indexing so you can search while it runs.
67
+
68
+ **When to use:**
69
+ - After major refactoring or branch switches
70
+ - After pulling large changes from remote
71
+ - If search results seem stale or incomplete
72
+ - After changing embedding configuration (dimension, model)
73
+
74
+ ---
75
+
76
+ ### 🗑️ `c_clear_cache` - Reset Everything
77
+
78
+ Deletes the embeddings cache entirely, forcing a complete reindex on next search.
79
+
80
+ **How it works:** Removes the `.smart-coding-cache/` directory. Next search or index operation starts fresh.
81
+
82
+ **When to use:**
83
+ - Cache corruption (rare, but possible)
84
+ - Switching embedding models or dimensions
85
+ - Starting fresh after major codebase restructure
86
+ - Troubleshooting search issues
87
+
88
+ ---
89
+
90
+ ### 📂 `e_set_workspace` - Switch Projects
91
+
92
+ Changes the workspace path at runtime without restarting the server.
93
+
94
+ **How it works:** Updates the internal workspace reference, creates cache folder for new path, and optionally triggers reindexing.
95
+
96
+ **When to use:**
97
+ - Working on multiple projects in one session
98
+ - Monorepo navigation between packages
99
+ - Switching between related repositories
100
+
101
+ ---
102
+
103
+ ### ℹ️ `f_get_status` - Server Health Check
104
+
105
+ Returns comprehensive status information about the MCP server.
106
+
107
+ **What it shows:**
108
+ - Server version and uptime
109
+ - Workspace path and cache location
110
+ - Indexing status (ready, indexing, percentage complete)
111
+ - Files indexed and chunk count
112
+ - Model configuration (name, dimension, device)
113
+ - Cache size and type
78
114
 
79
- Install globally via npm:
115
+ **When to use:**
116
+ - Start of session to verify everything is working
117
+ - Debugging connection or indexing issues
118
+ - Checking indexing progress on large codebases
119
+
120
+ ---
121
+
122
+ ## Installation
80
123
 
81
124
  ```bash
82
125
  npm install -g smart-coding-mcp
83
126
  ```
84
127
 
85
- To update to the latest version:
128
+ To update:
86
129
 
87
130
  ```bash
88
131
  npm update -g smart-coding-mcp
89
132
  ```
90
133
 
91
- ## Configuration
92
-
93
134
  ## IDE Integration
94
135
 
95
136
  Detailed setup instructions for your preferred environment:
96
137
 
97
- | IDE / App | Setup Guide | Supported Variables |
98
- | ------------------ | -------------------------------------------------- | -------------------- |
99
- | **VS Code** | [**View Guide**](docs/ide-setup/vscode.md) | `${workspaceFolder}` |
100
- | **Cursor** | [**View Guide**](docs/ide-setup/cursor.md) | `${workspaceFolder}` |
101
- | **Windsurf** | [**View Guide**](docs/ide-setup/windsurf.md) | Absolute paths only |
102
- | **Claude Desktop** | [**View Guide**](docs/ide-setup/claude-desktop.md) | Absolute paths only |
103
- | **Raycast** | [**View Guide**](docs/ide-setup/raycast.md) | Absolute paths only |
104
- | **Antigravity** | [**View Guide**](docs/ide-setup/antigravity.md) | Absolute paths only |
105
-
106
- ### Common Configuration Paths
107
-
108
- | IDE | OS | Config Path |
109
- | ------------------ | ------- | ----------------------------------------------------------------- |
110
- | **Claude Desktop** | macOS | `~/Library/Application Support/Claude/claude_desktop_config.json` |
111
- | **Claude Desktop** | Windows | `%APPDATA%\Claude\claude_desktop_config.json` |
112
- | **Windsurf** | macOS | `~/.codeium/windsurf/mcp_config.json` |
113
- | **Windsurf** | Windows | `%USERPROFILE%\.codeium\windsurf\mcp_config.json` |
138
+ | IDE / App | Setup Guide | `${workspaceFolder}` Support |
139
+ | ------------------ | -------------------------------------------------- | ---------------------------- |
140
+ | **VS Code** | [**View Guide**](docs/ide-setup/vscode.md) | Yes |
141
+ | **Cursor** | [**View Guide**](docs/ide-setup/cursor.md) | Yes |
142
+ | **Windsurf** | [**View Guide**](docs/ide-setup/windsurf.md) | Absolute paths only |
143
+ | **Claude Desktop** | [**View Guide**](docs/ide-setup/claude-desktop.md) | Absolute paths only |
144
+ | **OpenCode** | [**View Guide**](docs/ide-setup/opencode.md) | Absolute paths only |
145
+ | **Raycast** | [**View Guide**](docs/ide-setup/raycast.md) | Absolute paths only |
146
+ | **Antigravity** | [**View Guide**](docs/ide-setup/antigravity.md) | ❌ Absolute paths only |
114
147
 
115
- Add the server configuration to the `mcpServers` object in your config file:
148
+ ### Quick Setup
116
149
 
117
- ### Option 1: Absolute Path (Recommended)
150
+ Add to your MCP config file:
118
151
 
119
152
  ```json
120
153
  {
@@ -127,16 +160,27 @@ Add the server configuration to the `mcpServers` object in your config file:
127
160
  }
128
161
  ```
129
162
 
130
- ### Option 2: Multi-Project Support
163
+ ### Config File Locations
164
+
165
+ | IDE | OS | Path |
166
+ | ------------------ | ------- | ----------------------------------------------------------------- |
167
+ | **Claude Desktop** | macOS | `~/Library/Application Support/Claude/claude_desktop_config.json` |
168
+ | **Claude Desktop** | Windows | `%APPDATA%\Claude\claude_desktop_config.json` |
169
+ | **OpenCode** | Global | `~/.config/opencode/opencode.json` |
170
+ | **OpenCode** | Project | `opencode.json` in project root |
171
+ | **Windsurf** | macOS | `~/.codeium/windsurf/mcp_config.json` |
172
+ | **Windsurf** | Windows | `%USERPROFILE%\.codeium\windsurf\mcp_config.json` |
173
+
174
+ ### Multi-Project Setup
131
175
 
132
176
  ```json
133
177
  {
134
178
  "mcpServers": {
135
- "smart-coding-mcp-frontend": {
179
+ "smart-coding-frontend": {
136
180
  "command": "smart-coding-mcp",
137
181
  "args": ["--workspace", "/path/to/frontend"]
138
182
  },
139
- "smart-coding-mcp-backend": {
183
+ "smart-coding-backend": {
140
184
  "command": "smart-coding-mcp",
141
185
  "args": ["--workspace", "/path/to/backend"]
142
186
  }
@@ -144,55 +188,28 @@ Add the server configuration to the `mcpServers` object in your config file:
144
188
  }
145
189
  ```
146
190
 
147
- ### Option 3: Auto-Detection (May Not Work)
148
-
149
- > ⚠️ **Warning:** Most MCP clients (including Antigravity and Claude Desktop) do NOT support `${workspaceFolder}` variable expansion. The server will exit with an error if the variable is not expanded.
150
-
151
- For clients that support dynamic variables (VS Code, Cursor):
152
-
153
- ```json
154
- {
155
- "mcpServers": {
156
- "smart-coding-mcp": {
157
- "command": "smart-coding-mcp",
158
- "args": ["--workspace", "${workspaceFolder}"]
159
- }
160
- }
161
- }
162
- ```
163
-
164
- | Client | Supports `${workspaceFolder}` |
165
- | ---------------- | ----------------------------- |
166
- | VS Code | Yes |
167
- | Cursor (Cascade) | Yes |
168
- | Antigravity | No ❌ |
169
- | Claude Desktop | No ❌ |
170
-
171
191
  ## Environment Variables
172
192
 
173
- Override configuration settings via environment variables in your MCP config:
174
-
175
- | Variable | Type | Default | Description |
176
- | ---------------------------------- | ------- | -------------------------------- | ------------------------------------------ |
177
- | `SMART_CODING_VERBOSE` | boolean | `false` | Enable detailed logging |
178
- | `SMART_CODING_BATCH_SIZE` | number | `100` | Files to process in parallel |
179
- | `SMART_CODING_MAX_FILE_SIZE` | number | `1048576` | Max file size in bytes (1MB) |
180
- | `SMART_CODING_CHUNK_SIZE` | number | `25` | Lines of code per chunk |
181
- | `SMART_CODING_MAX_RESULTS` | number | `5` | Max search results |
182
- | `SMART_CODING_SMART_INDEXING` | boolean | `true` | Enable smart project detection |
183
- | `SMART_CODING_WATCH_FILES` | boolean | `false` | Enable file watching for auto-reindex |
184
- | `SMART_CODING_SEMANTIC_WEIGHT` | number | `0.7` | Weight for semantic similarity (0-1) |
185
- | `SMART_CODING_EXACT_MATCH_BOOST` | number | `1.5` | Boost for exact text matches |
186
- | `SMART_CODING_EMBEDDING_MODEL` | string | `nomic-ai/nomic-embed-text-v1.5` | AI embedding model to use |
187
- | `SMART_CODING_EMBEDDING_DIMENSION` | number | `128` | MRL dimension (64, 128, 256, 512, 768) |
188
- | `SMART_CODING_DEVICE` | string | `cpu` | Inference device (`cpu`, `webgpu`, `auto`) |
189
- | `SMART_CODING_CHUNKING_MODE` | string | `smart` | Code chunking (`smart`, `ast`, `line`) |
190
- | `SMART_CODING_WORKER_THREADS` | string | `auto` | Worker threads (`auto` or 1-32) |
191
- | `SMART_CODING_MAX_CPU_PERCENT` | number | `50` | Max CPU usage during indexing (10-100%) |
192
- | `SMART_CODING_BATCH_DELAY` | number | `100` | Delay between batches in ms (0-5000) |
193
- | `SMART_CODING_MAX_WORKERS` | string | `auto` | Override max worker threads limit |
194
-
195
- **Example with environment variables:**
193
+ Customize behavior via environment variables:
194
+
195
+ | Variable | Default | Description |
196
+ | ---------------------------------- | -------------------------------- | ------------------------------------------ |
197
+ | `SMART_CODING_VERBOSE` | `false` | Enable detailed logging |
198
+ | `SMART_CODING_MAX_RESULTS` | `5` | Max search results returned |
199
+ | `SMART_CODING_BATCH_SIZE` | `100` | Files to process in parallel |
200
+ | `SMART_CODING_MAX_FILE_SIZE` | `1048576` | Max file size in bytes (1MB) |
201
+ | `SMART_CODING_CHUNK_SIZE` | `25` | Lines of code per chunk |
202
+ | `SMART_CODING_EMBEDDING_DIMENSION` | `128` | MRL dimension (64, 128, 256, 512, 768) |
203
+ | `SMART_CODING_EMBEDDING_MODEL` | `nomic-ai/nomic-embed-text-v1.5` | AI embedding model |
204
+ | `SMART_CODING_DEVICE` | `cpu` | Inference device (`cpu`, `webgpu`, `auto`) |
205
+ | `SMART_CODING_SEMANTIC_WEIGHT` | `0.7` | Weight for semantic vs exact matching |
206
+ | `SMART_CODING_EXACT_MATCH_BOOST` | `1.5` | Boost multiplier for exact text matches |
207
+ | `SMART_CODING_MAX_CPU_PERCENT` | `50` | Max CPU usage during indexing (10-100%) |
208
+ | `SMART_CODING_CHUNKING_MODE` | `smart` | Code chunking (`smart`, `ast`, `line`) |
209
+ | `SMART_CODING_WATCH_FILES` | `false` | Auto-reindex on file changes |
210
+ | `SMART_CODING_AUTO_INDEX_DELAY` | `5000` | Delay before background indexing (ms), `false` to disable |
211
+
212
+ **Example with env vars:**
196
213
 
197
214
  ```json
198
215
  {
@@ -202,15 +219,25 @@ Override configuration settings via environment variables in your MCP config:
202
219
  "args": ["--workspace", "/path/to/project"],
203
220
  "env": {
204
221
  "SMART_CODING_VERBOSE": "true",
205
- "SMART_CODING_BATCH_SIZE": "200",
206
- "SMART_CODING_MAX_FILE_SIZE": "2097152"
222
+ "SMART_CODING_MAX_RESULTS": "10",
223
+ "SMART_CODING_EMBEDDING_DIMENSION": "256"
207
224
  }
208
225
  }
209
226
  }
210
227
  }
211
228
  ```
212
229
 
213
- **Note**: The server starts instantly and indexes in the background, so your IDE won't be blocked waiting for indexing to complete.
230
+ ## Performance
231
+
232
+ **Progressive Indexing** - Search works immediately while indexing continues in the background. No waiting for large codebases.
233
+
234
+ **Resource Throttling** - CPU limited to 50% by default. Your machine stays responsive during indexing.
235
+
236
+ **SQLite Cache** - 5-10x faster than JSON. Automatic migration from older JSON caches.
237
+
238
+ **Incremental Updates** - Only changed files are re-indexed. Saves every 5 batches, so no data loss if interrupted.
239
+
240
+ **Optimized Defaults** - 128d embeddings (2x faster than 256d with minimal quality loss), smart batch sizing, parallel processing.
214
241
 
215
242
  ## How It Works
216
243
 
@@ -277,97 +304,23 @@ flowchart TB
277
304
  | **Inference** | transformers.js + ONNX Runtime |
278
305
  | **Chunking** | Smart regex / Tree-sitter AST |
279
306
  | **Search** | Cosine similarity + exact match boost |
280
-
281
- ### Search Flow
282
-
283
- Query → Vector embedding → Cosine similarity → Ranked results
284
-
285
- ## Examples
286
-
287
- **Natural language search:**
288
-
289
- Query: "How do we handle cache persistence?"
290
-
291
- Result:
292
-
293
- ```javascript
294
- // lib/cache.js (Relevance: 38.2%)
295
- async save() {
296
- await fs.writeFile(cacheFile, JSON.stringify(this.vectorStore));
297
- await fs.writeFile(hashFile, JSON.stringify(this.fileHashes));
298
- }
299
- ```
300
-
301
- **Typo tolerance:**
302
-
303
- Query: "embeding modle initializashun"
304
-
305
- Still finds embedding model initialization code despite multiple typos.
306
-
307
- **Conceptual search:**
308
-
309
- Query: "error handling and exceptions"
310
-
311
- Finds all try/catch blocks and error handling patterns.
307
+ | **Cache** | SQLite with WAL mode |
312
308
 
313
309
  ## Privacy
314
310
 
315
- - AI model runs entirely on your machine
316
- - No network requests to external services
317
- - No telemetry or analytics
318
- - Cache stored locally in `.smart-coding-cache/`
319
-
320
- ## Technical Details
321
-
322
- **Embedding Model**: nomic-embed-text-v1.5 via transformers.js v3
311
+ Everything runs **100% locally**:
323
312
 
324
- - Matryoshka Representation Learning (MRL) for flexible dimensions
325
- - Configurable output: 64, 128, 256, 512, or 768 dimensions
326
- - Longer context (8192 tokens vs 256 for MiniLM)
327
- - Better code understanding through specialized training
328
- - WebGPU support for up to 100x faster inference (when available)
329
-
330
- **Legacy Model**: all-MiniLM-L6-v2 (fallback)
331
-
332
- - Fast inference, small footprint (~100MB)
333
- - Fixed 384-dimensional output
334
-
335
- **Vector Similarity**: Cosine similarity
336
-
337
- - Efficient comparison of embeddings
338
- - Normalized vectors for consistent scoring
339
-
340
- **Hybrid Scoring**: Combines semantic similarity with exact text matching
341
-
342
- - Semantic weight: 0.7 (configurable)
343
- - Exact match boost: 1.5x (configurable)
313
+ - AI model runs on your machine (no API calls)
314
+ - Code never leaves your system
315
+ - No telemetry or analytics
316
+ - Cache stored in `.smart-coding-cache/`
344
317
 
345
318
  ## Research Background
346
319
 
347
- This project builds on research from Cursor showing that semantic search improves AI coding agent performance by 12.5% on average across question-answering tasks. The key insight is that AI assistants benefit more from relevant context than from large amounts of context.
348
-
349
- See: https://cursor.com/blog/semsearch
320
+ This project builds on [research from Cursor](https://cursor.com/blog/semsearch) showing that semantic search improves AI coding agent performance by 12.5% on average. The key insight: AI assistants benefit more from **relevant** context than from **large amounts** of context.
350
321
 
351
322
  ## License
352
323
 
353
- MIT License
354
-
355
- Copyright (c) 2025 Omar Haris
356
-
357
- Permission is hereby granted, free of charge, to any person obtaining a copy
358
- of this software and associated documentation files (the "Software"), to deal
359
- in the Software without restriction, including without limitation the rights
360
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
361
- copies of the Software, and to permit persons to whom the Software is
362
- furnished to do so, subject to the following conditions:
363
-
364
- The above copyright notice and this permission notice shall be included in all
365
- copies or substantial portions of the Software.
324
+ MIT License - Copyright (c) 2025 Omar Haris
366
325
 
367
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
368
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
369
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
370
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
371
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
372
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
373
- SOFTWARE.
326
+ See [LICENSE](LICENSE) for full text.
package/config.json CHANGED
@@ -68,5 +68,6 @@
68
68
  "exactMatchBoost": 1.5,
69
69
  "workerThreads": "auto",
70
70
  "maxCpuPercent": 50,
71
- "batchDelay": 100
71
+ "batchDelay": 100,
72
+ "autoIndexDelay": 5000
72
73
  }
@@ -75,9 +75,10 @@ Antigravity supports powerful agent rules to control AI behavior.
75
75
  **Trigger:** When asking about "how" something works, finding logic, or understanding architecture.
76
76
  **Action:**
77
77
 
78
- - **PREFER** `a_semantic_search` (Smart Coding) over `grep_search` or `find_by_name`.
79
- - Use `a_semantic_search` for natural language queries (e.g., "where is the auth logic").
80
- - Use standard tools (`grep`) only for exact string matching.
78
+ - **MUST** use `a_semantic_search` as the FIRST tool for any codebase research
79
+ - **DO NOT** use `Glob` or `Grep` for exploratory searches
80
+ - Use `Grep` ONLY for exact literal string matching (e.g., finding a specific error message)
81
+ - Use `Glob` ONLY when you already know the exact filename pattern
81
82
 
82
83
  ## 3. Environment & Status
83
84
 
@@ -62,9 +62,10 @@ Claude Desktop uses **Projects** with custom instructions.
62
62
  **Trigger:** When asking about "how" something works, finding logic, or understanding architecture.
63
63
  **Action:**
64
64
 
65
- - **PREFER** `a_semantic_search` (Smart Coding) over `grep_search` or `find_by_name`.
66
- - Use `a_semantic_search` for natural language queries (e.g., "where is the auth logic").
67
- - Use standard tools (`grep`) only for exact string matching.
65
+ - **MUST** use `a_semantic_search` as the FIRST tool for any codebase research
66
+ - **DO NOT** use `Glob` or `Grep` for exploratory searches
67
+ - Use `Grep` ONLY for exact literal string matching (e.g., finding a specific error message)
68
+ - Use `Glob` ONLY when you already know the exact filename pattern
68
69
 
69
70
  ## 3. Environment & Status
70
71
 
@@ -65,9 +65,10 @@ Cursor uses `.cursor/rules/` for project-specific AI rules.
65
65
  **Trigger:** When asking about "how" something works, finding logic, or understanding architecture.
66
66
  **Action:**
67
67
 
68
- - **PREFER** `a_semantic_search` (Smart Coding) over `grep_search` or `find_by_name`.
69
- - Use `a_semantic_search` for natural language queries (e.g., "where is the auth logic").
70
- - Use standard tools (`grep`) only for exact string matching.
68
+ - **MUST** use `a_semantic_search` as the FIRST tool for any codebase research
69
+ - **DO NOT** use `Glob` or `Grep` for exploratory searches
70
+ - Use `Grep` ONLY for exact literal string matching (e.g., finding a specific error message)
71
+ - Use `Glob` ONLY when you already know the exact filename pattern
71
72
 
72
73
  ## 3. Environment & Status
73
74