@sashabogi/argus-mcp 2.0.1 → 2.0.2

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 +135 -446
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,570 +1,259 @@
1
1
  # Argus
2
2
 
3
- ![Argus Banner](assets/argus-banner.jpg)
3
+ **Understand Any Codebase, Regardless of Size**
4
4
 
5
- **Codebase Intelligence Beyond Context Limits**
5
+ Argus solves a fundamental problem: **your codebase is too big to fit in an LLM's context window**. You can't just paste 50,000 lines of code into Claude and ask "how does authentication work?" - it won't fit, and even if it did, the AI would get lost in the noise.
6
6
 
7
- Argus is an AI-powered codebase analysis tool that understands your entire project, regardless of size. Using a hybrid approach of zero-cost structural queries and AI-powered reasoning, Argus provides intelligent answers about code architecture, patterns, and relationships that would be impossible with traditional context-limited approaches.
7
+ Argus creates intelligent **snapshots** of your codebase and provides tools that let Claude explore them efficiently. Instead of trying to load everything at once, Claude can search, navigate, and analyze your code piece by piece - just like a human developer would.
8
8
 
9
- ## Key Features
10
-
11
- | Feature | Description |
12
- |---------|-------------|
13
- | **Zero-Cost Dependency Queries** | Find importers, symbols, and file dependencies instantly with pre-computed metadata |
14
- | **Progressive Disclosure Search** | 3-tier search architecture: `find_files` -> `search_codebase` -> `get_context` |
15
- | **Enhanced Snapshots** | Import graphs, export indexes, and symbol lookups built into every snapshot |
16
- | **Worker Service** | Persistent LRU caching for repeated queries (port 37778) |
17
- | **Web UI** | Interactive D3.js dependency graph visualization |
18
- | **Multi-Provider AI** | ZAI, Anthropic, OpenAI, DeepSeek, and Ollama support |
19
- | **Claude Code Integration** | Native MCP server with global instructions for all agents |
9
+ ![Codebase Explorer](docs/images/codebase-explorer.png)
20
10
 
21
- ## Quick Start
11
+ ## How It Works
22
12
 
23
- ```bash
24
- # 1. Install globally via npm
25
- npm install -g @sashabogi/argus-mcp
13
+ ### 1. Create a Snapshot
26
14
 
27
- # 2. Interactive setup (configures API keys and preferences)
28
- argus init
15
+ A snapshot is a single text file containing your entire codebase, organized for efficient searching:
29
16
 
30
- # 3. Add to Claude Code (installs MCP + global instructions)
31
- argus mcp install
32
-
33
- # 4. Set up any project
34
- argus setup .
17
+ ```bash
18
+ argus snapshot . -o .argus/snapshot.txt
35
19
  ```
36
20
 
37
- That's it! Argus is now integrated into Claude Code and will automatically be used for codebase exploration.
21
+ This creates a ~300KB file from a typical project that includes:
22
+ - All your source files with line numbers
23
+ - **Import graph** - which files depend on which
24
+ - **Export index** - where every function/class is defined
38
25
 
39
- ## Installation
40
-
41
- ### npm (Recommended)
42
-
43
- ```bash
44
- npm install -g @sashabogi/argus-mcp
45
- ```
26
+ ### 2. Claude Searches Before Reading
46
27
 
47
- ### Manual Installation
28
+ When you ask Claude about your code, it doesn't read the whole snapshot. Instead, it uses **progressive disclosure**:
48
29
 
49
- ```bash
50
- git clone https://github.com/sashabogi/argus.git
51
- cd argus
52
- npm install
53
- npm run build
54
- npm link
55
30
  ```
31
+ You: "How does the authentication flow work?"
56
32
 
57
- ### Update
58
-
59
- ```bash
60
- argus update
33
+ Claude's process:
34
+ 1. search_codebase("auth") → Finds 12 matches in 4 files (FREE - no AI)
35
+ 2. get_context("auth.ts", 42) → Gets 20 lines around the match (FREE)
36
+ 3. find_importers("auth.ts") → Sees what depends on it (FREE)
37
+ 4. analyze_codebase("...") → Deep analysis only if needed (~500 tokens)
61
38
  ```
62
39
 
63
- ---
40
+ **90% of questions are answered with FREE tools.** The AI-powered analysis is only used for complex architectural questions.
64
41
 
65
- ## Features
42
+ ### 3. Automatic Updates
66
43
 
67
- ### 1. Progressive Disclosure MCP Tools
44
+ You don't need to manually refresh snapshots. Argus integrates with Claude Code's lifecycle:
68
45
 
69
- Argus provides 6 MCP tools with a tiered cost structure, optimized for token efficiency:
46
+ - **Session start**: Checks if snapshot exists and is fresh
47
+ - **After file edits**: Flags snapshot as stale
48
+ - **On your command**: `argus snapshot .` to refresh
70
49
 
71
- | Tool | Cost | Use Case |
72
- |------|------|----------|
73
- | `search_codebase` | **FREE** | Fast regex search across the entire snapshot |
74
- | `find_files` | **FREE** | Glob pattern matching for file discovery |
75
- | `get_context` | **FREE** | Extract N lines around a specific location |
76
- | `find_importers` | **FREE** | Find all files that import a given module |
77
- | `find_symbol` | **FREE** | Locate where a symbol is exported from |
78
- | `get_file_deps` | **FREE** | Get all imports of a specific file |
79
- | `analyze_codebase` | ~500 tokens | AI-powered deep analysis for complex questions |
80
- | `semantic_search` | ~100 tokens | Natural language code search using FTS5 |
81
- | `create_snapshot` | ~100 tokens | Create or refresh a codebase snapshot |
50
+ ---
82
51
 
83
- **Workflow Example:**
52
+ ## Quick Start
84
53
 
85
54
  ```bash
86
- # Step 1: Find files (FREE)
87
- find_files(".argus/snapshot.txt", "**/*auth*")
88
-
89
- # Step 2: Search for patterns (FREE)
90
- search_codebase(".argus/snapshot.txt", "handleAuth")
91
-
92
- # Step 3: Get context around a match (FREE)
93
- get_context(".argus/snapshot.txt", "src/auth.ts", 42, 10, 20)
94
-
95
- # Step 4: Only if needed - AI analysis (~500 tokens)
96
- analyze_codebase(".argus/snapshot.txt", "How does the authentication flow work?")
97
- ```
55
+ # Install
56
+ npm install -g @sashabogi/argus-mcp
98
57
 
99
- ### 2. Enhanced Snapshots
58
+ # Setup (configures AI provider for deep analysis)
59
+ argus init
100
60
 
101
- Every snapshot includes structural metadata that enables zero-cost dependency queries:
61
+ # Add to Claude Code
62
+ argus mcp install
102
63
 
103
- ```bash
104
- # Create an enhanced snapshot (default)
64
+ # Create your first snapshot
65
+ cd your-project
105
66
  argus snapshot . -o .argus/snapshot.txt
106
-
107
- # Create a basic snapshot (faster, smaller, no metadata)
108
- argus snapshot . -o .argus/snapshot.txt --basic
109
67
  ```
110
68
 
111
- **Metadata Included:**
112
-
113
- - **Import Graph** - Which files import which other files
114
- - **Export Index** - Symbol -> files that export it
115
- - **Who Imports Whom** - Reverse dependency graph for impact analysis
116
- - **Function Signatures** - With line numbers for precise navigation
117
-
118
- **Example Zero-Cost Queries:**
119
-
120
- ```typescript
121
- // Find where useAuth is exported from
122
- find_symbol(".argus/snapshot.txt", "useAuth")
123
- // -> { file: "contexts/auth-context.tsx", line: 42 }
124
-
125
- // Find all files that depend on auth-context
126
- find_importers(".argus/snapshot.txt", "auth-context")
127
- // -> ["app.tsx", "dashboard.tsx", "settings.tsx"]
128
-
129
- // Get dependencies of a specific file
130
- get_file_deps(".argus/snapshot.txt", "src/app.tsx")
131
- // -> ["./auth", "./theme", "@/components/ui"]
132
- ```
69
+ That's it. Now when you ask Claude about your code, it will automatically use Argus.
133
70
 
134
- ### 3. Worker Service
135
-
136
- For optimal performance, Argus includes a persistent worker service that caches parsed snapshots in memory:
71
+ ---
137
72
 
138
- ```bash
139
- # Start the worker service
140
- argus worker start
73
+ ## The Tools
141
74
 
142
- # Check worker status
143
- argus worker status
75
+ Argus provides 6 MCP tools, organized by cost:
144
76
 
145
- # Stop the worker
146
- argus worker stop
147
- ```
77
+ ### Zero-Cost Tools (No AI, Instant Results)
148
78
 
149
- **Worker Features:**
79
+ | Tool | What It Does |
80
+ |------|--------------|
81
+ | `search_codebase` | Regex search across all files. Returns matches with line numbers. |
82
+ | `find_files` | Glob pattern matching. Find files by name pattern. |
83
+ | `get_context` | Extract lines around a specific location. Like `grep -C`. |
84
+ | `find_importers` | What files import this module? Uses pre-computed import graph. |
85
+ | `find_symbol` | Where is this function/class defined? Uses export index. |
86
+ | `get_file_deps` | What does this file import? |
150
87
 
151
- - **LRU Cache** - Keeps up to 5 parsed snapshots in memory
152
- - **File Watching** - Detects changes and invalidates cache automatically
153
- - **REST API** - Available on port 37778
88
+ ### AI-Powered Tools (Uses Tokens)
154
89
 
155
- **API Endpoints:**
90
+ | Tool | Cost | What It Does |
91
+ |------|------|--------------|
92
+ | `analyze_codebase` | ~500 tokens | Deep analysis using recursive reasoning. For complex questions. |
156
93
 
157
- | Endpoint | Method | Description |
158
- |----------|--------|-------------|
159
- | `/health` | GET | Health check and cache stats |
160
- | `/snapshot/load` | POST | Load a snapshot into cache |
161
- | `/search` | POST | Search using cached snapshot |
162
- | `/context` | POST | Get context from cached snapshot |
163
- | `/watch` | POST | Start watching a project |
164
- | `/watch` | DELETE | Stop watching a project |
94
+ **The key insight**: Most developer questions ("where is X defined?", "what calls Y?", "show me the auth code") can be answered with zero-cost tools. You only need AI for questions requiring reasoning across multiple files.
165
95
 
166
- ### 4. Web UI - Codebase Explorer
96
+ ---
167
97
 
168
- Argus includes a visual codebase explorer for understanding your project structure:
98
+ ## Snapshots: Basic vs Enhanced
169
99
 
170
100
  ```bash
171
- # Open the web UI
172
- argus ui
101
+ # Enhanced (default) - includes import graph and export index
102
+ argus snapshot .
173
103
 
174
- # Specify a custom port
175
- argus ui --port 4000
104
+ # Basic - just the code, faster to create
105
+ argus snapshot . --basic
176
106
  ```
177
107
 
178
- ![Codebase Explorer](docs/images/codebase-explorer.png)
179
-
180
- **Web UI Features:**
181
-
182
- - **Dependency Graph** - D3.js force-directed visualization of file relationships
183
- - **File Tree Explorer** - Navigate your codebase with line counts
184
- - **Full-Text Search** - Search across all files with highlighting
185
- - **Code Viewer** - View file contents with syntax highlighting
186
- - **Stats Dashboard** - Overview of files, imports, and exports
187
-
188
- ### 5. Claude Lifecycle Hooks
189
-
190
- Argus can automatically update snapshots using Claude Code's lifecycle hooks:
108
+ **Enhanced snapshots** enable the zero-cost dependency tools (`find_importers`, `find_symbol`, `get_file_deps`). They take slightly longer to create but make queries much more efficient.
191
109
 
192
- **Session Start Hook:**
193
- - Checks for `.argus/snapshot.txt` on session start
194
- - Warns if snapshot is stale (>1 hour old)
195
-
196
- **Post-Tool Hook:**
197
- - Fires after Write/Edit operations
198
- - Notifies worker service of file changes for cache invalidation
110
+ **Basic snapshots** only support regex search. Use these for very large codebases where you don't need dependency analysis.
199
111
 
200
112
  ---
201
113
 
202
- ## CLI Commands
114
+ ## Web UI: Codebase Explorer
203
115
 
204
- | Command | Description |
205
- |---------|-------------|
206
- | `argus init` | Interactive setup wizard for API keys and preferences |
207
- | `argus setup [path]` | One-command project setup (snapshot + CLAUDE.md + .gitignore) |
208
- | `argus snapshot <path>` | Create a codebase snapshot |
209
- | `argus analyze <path> <query>` | Analyze codebase with AI |
210
- | `argus query <snapshot> <query>` | Query an existing snapshot |
211
- | `argus search <snapshot> <pattern>` | Fast grep search (no AI) |
212
- | `argus status [path]` | Check if snapshot is up to date |
213
- | `argus mcp install` | Install MCP server for Claude Code |
214
- | `argus mcp uninstall` | Remove from Claude Code |
215
- | `argus context generate <path>` | Generate architecture summary |
216
- | `argus context inject <path>` | Add architecture section to CLAUDE.md |
217
- | `argus config [key] [value]` | View or modify configuration |
218
- | `argus ui` | Open the web UI for visualization |
219
- | `argus update` | Update Argus to the latest version |
220
-
221
- ### Command Options
222
-
223
- **`argus snapshot`**
224
- ```bash
225
- argus snapshot ./my-project -o .argus/snapshot.txt
226
- --extensions, -e File extensions to include (comma-separated)
227
- --exclude Patterns to exclude (comma-separated)
228
- --output, -o Output file path
229
- --basic Skip structural metadata (faster, smaller)
230
- ```
116
+ Visualize your codebase structure:
231
117
 
232
- **`argus analyze`**
233
- ```bash
234
- argus analyze ./my-project "What are the main modules?"
235
- --provider, -p Override default provider
236
- --max-turns, -t Maximum reasoning turns (default: 15)
237
- --verbose, -v Show detailed execution logs
238
- ```
239
-
240
- **`argus search`**
241
- ```bash
242
- argus search .argus/snapshot.txt "authentication"
243
- --ignore-case, -i Case-insensitive search
244
- --max-results, -n Maximum results (default: 50)
245
- ```
246
-
247
- **`argus ui`**
248
118
  ```bash
249
119
  argus ui
250
- --port, -p Port to serve on (default: 3333)
251
- --no-open Do not open browser automatically
252
120
  ```
253
121
 
254
- ---
255
-
256
- ## MCP Server Setup
257
-
258
- ### Automatic Installation
122
+ Opens a browser with:
123
+ - **Dependency graph** - Interactive D3.js visualization of imports
124
+ - **File explorer** - Browse files with line counts
125
+ - **Search** - Full-text search with highlighting
126
+ - **Code viewer** - Read any file from the snapshot
259
127
 
260
- ```bash
261
- argus mcp install
262
- ```
128
+ Drag and drop a snapshot file, or paste its contents directly.
263
129
 
264
- This command:
265
- 1. Creates a wrapper script at `~/.argus/argus-mcp-wrapper`
266
- 2. Registers the MCP server with Claude Code
267
- 3. Injects Argus instructions into `~/.claude/CLAUDE.md` (global for all projects)
130
+ ---
268
131
 
269
- ### Manual Installation
132
+ ## Keeping Snapshots Fresh
270
133
 
271
- If automatic installation fails, add manually:
134
+ ### Manual Refresh
272
135
 
273
136
  ```bash
274
- claude mcp add argus -s user -- ~/.argus/argus-mcp-wrapper
275
- ```
276
-
277
- ### MCP Tool Reference
137
+ # Check if snapshot is stale
138
+ argus status .
278
139
 
279
- Once installed, Claude Code has access to these tools:
280
-
281
- **`search_codebase`** - Zero-cost regex search
282
- ```typescript
283
- search_codebase({
284
- path: ".argus/snapshot.txt",
285
- pattern: "handleAuth",
286
- caseInsensitive: true, // default: true
287
- maxResults: 50, // default: 50, max: 200
288
- offset: 0, // for pagination
289
- contextChars: 80 // truncate context
290
- })
140
+ # Refresh
141
+ argus snapshot . -o .argus/snapshot.txt
291
142
  ```
292
143
 
293
- **`find_files`** - Zero-cost glob matching
294
- ```typescript
295
- find_files({
296
- path: ".argus/snapshot.txt",
297
- pattern: "**/*.test.ts",
298
- caseInsensitive: true, // default: true
299
- limit: 100 // default: 100, max: 500
300
- })
301
- ```
144
+ ### Automatic (Claude Code Integration)
302
145
 
303
- **`get_context`** - Zero-cost context extraction
304
- ```typescript
305
- get_context({
306
- path: ".argus/snapshot.txt",
307
- file: "src/auth.ts",
308
- line: 42,
309
- before: 10, // lines before
310
- after: 20 // lines after
311
- })
312
- ```
146
+ When you run `argus mcp install`, Argus adds lifecycle hooks:
313
147
 
314
- **`find_importers`** - Zero-cost dependency query
315
- ```typescript
316
- find_importers({
317
- path: ".argus/snapshot.txt",
318
- target: "src/auth.ts"
319
- })
320
- ```
148
+ 1. **Session start**: If no snapshot exists or it's >24h old, prompts you to create one
149
+ 2. **After edits**: The snapshot is flagged as potentially stale
321
150
 
322
- **`find_symbol`** - Zero-cost symbol lookup
323
- ```typescript
324
- find_symbol({
325
- path: ".argus/snapshot.txt",
326
- symbol: "useAuth"
327
- })
328
- ```
151
+ You can also add to your project's `CLAUDE.md`:
329
152
 
330
- **`get_file_deps`** - Zero-cost import list
331
- ```typescript
332
- get_file_deps({
333
- path: ".argus/snapshot.txt",
334
- file: "src/app.tsx"
335
- })
336
- ```
153
+ ```markdown
154
+ ## Codebase Intelligence
337
155
 
338
- **`analyze_codebase`** - AI-powered analysis (~500 tokens)
339
- ```typescript
340
- analyze_codebase({
341
- path: ".argus/snapshot.txt",
342
- query: "How does authentication work?",
343
- maxTurns: 15 // default: 15
344
- })
345
- ```
156
+ This project uses Argus. The snapshot is at `.argus/snapshot.txt`.
346
157
 
347
- **`semantic_search`** - Natural language search
348
- ```typescript
349
- semantic_search({
350
- path: "/path/to/project",
351
- query: "authentication middleware",
352
- limit: 20 // default: 20
353
- })
158
+ Before answering questions about the code:
159
+ 1. Use `search_codebase` to find relevant files
160
+ 2. Use `get_context` to read specific sections
161
+ 3. Only use `analyze_codebase` for complex architectural questions
354
162
  ```
355
163
 
356
164
  ---
357
165
 
358
166
  ## Configuration
359
167
 
360
- Argus stores configuration in `~/.argus/config.json`. Run `argus init` for interactive setup.
168
+ Argus stores config in `~/.argus/config.json`:
361
169
 
362
170
  ```json
363
171
  {
364
- "provider": "anthropic",
172
+ "provider": "ollama",
365
173
  "providers": {
366
- "anthropic": {
367
- "apiKey": "sk-ant-...",
368
- "model": "claude-sonnet-4-20250514"
369
- },
370
- "zai": {
371
- "apiKey": "your-api-key",
372
- "model": "glm-4.7",
373
- "endpoint": "https://api.z.ai/api/coding/paas/v4"
374
- },
375
- "openai": {
376
- "apiKey": "sk-...",
377
- "model": "gpt-4o"
378
- },
379
- "deepseek": {
380
- "apiKey": "your-api-key",
381
- "model": "deepseek-chat"
382
- },
383
174
  "ollama": {
384
- "baseUrl": "http://localhost:11434",
385
175
  "model": "qwen2.5-coder:7b"
386
176
  }
387
- },
388
- "defaults": {
389
- "maxTurns": 15,
390
- "turnTimeoutMs": 60000,
391
- "snapshotExtensions": ["ts", "tsx", "js", "jsx", "rs", "py", "go", "java"],
392
- "excludePatterns": ["node_modules", ".git", "dist", "build"]
393
177
  }
394
178
  }
395
179
  ```
396
180
 
397
- ### Supported Providers
398
-
399
- | Provider | Models | Best For |
400
- |----------|--------|----------|
401
- | **ZAI** | GLM-4.7, GLM-4.6 | Best value, excellent coding |
402
- | **Anthropic** | Claude Sonnet/Opus | Highest quality reasoning |
403
- | **OpenAI** | GPT-4o, GPT-4 | General purpose |
404
- | **DeepSeek** | DeepSeek Chat/Coder | Budget-friendly |
405
- | **Ollama** | Qwen, CodeLlama, etc. | Free, local, private |
181
+ Run `argus init` to configure interactively.
406
182
 
407
- ---
183
+ ### Supported Providers
408
184
 
409
- ## API Reference
185
+ | Provider | Cost | Best For |
186
+ |----------|------|----------|
187
+ | **Ollama** | Free (local) | Development, privacy-sensitive code |
188
+ | **ZAI (GLM-4.7)** | ~$3/month | Cost-effective cloud option |
189
+ | **DeepSeek** | Low | Good balance of cost/quality |
190
+ | **Anthropic** | Medium | High-quality analysis |
191
+ | **OpenAI** | Medium | High-quality analysis |
410
192
 
411
- ### Worker Service (Port 37778)
193
+ **Note**: The AI provider is only used for `analyze_codebase`. All other tools are completely free.
412
194
 
413
- **Health Check**
414
- ```bash
415
- curl http://localhost:37778/health
416
- ```
417
- Response:
418
- ```json
419
- {
420
- "status": "ok",
421
- "version": "2.0.0",
422
- "cached": 2,
423
- "watching": 1
424
- }
425
- ```
426
-
427
- **Load Snapshot**
428
- ```bash
429
- curl -X POST http://localhost:37778/snapshot/load \
430
- -H "Content-Type: application/json" \
431
- -d '{"path": "/path/to/.argus/snapshot.txt"}'
432
- ```
195
+ ---
433
196
 
434
- **Search**
435
- ```bash
436
- curl -X POST http://localhost:37778/search \
437
- -H "Content-Type: application/json" \
438
- -d '{
439
- "path": "/path/to/.argus/snapshot.txt",
440
- "pattern": "handleAuth",
441
- "options": {"caseInsensitive": true, "maxResults": 50}
442
- }'
443
- ```
197
+ ## CLI Reference
444
198
 
445
- **Get Context**
446
- ```bash
447
- curl -X POST http://localhost:37778/context \
448
- -H "Content-Type: application/json" \
449
- -d '{
450
- "path": "/path/to/.argus/snapshot.txt",
451
- "file": "src/auth.ts",
452
- "line": 42,
453
- "before": 10,
454
- "after": 20
455
- }'
456
- ```
199
+ | Command | Description |
200
+ |---------|-------------|
201
+ | `argus init` | Interactive setup wizard |
202
+ | `argus snapshot <path>` | Create a codebase snapshot |
203
+ | `argus analyze <snapshot> <query>` | AI-powered analysis |
204
+ | `argus search <snapshot> <pattern>` | Regex search (no AI) |
205
+ | `argus ui` | Open the web visualizer |
206
+ | `argus mcp install` | Add to Claude Code |
207
+ | `argus status <path>` | Check snapshot freshness |
208
+ | `argus config` | View/edit configuration |
457
209
 
458
210
  ---
459
211
 
460
- ## How It Works
461
-
462
- Argus uses a **Recursive Language Model (RLM)** approach:
463
-
464
- 1. **Snapshot Creation** - Your codebase is compiled into an optimized text snapshot with structural metadata
465
- 2. **Query Analysis** - The LLM receives your question and the Nucleus DSL reference
466
- 3. **Iterative Exploration** - The LLM generates symbolic commands (grep, filter, map, etc.)
467
- 4. **Command Execution** - Commands run against the full snapshot in a sandbox
468
- 5. **Reasoning Loop** - Results feed back to the LLM for further analysis
469
- 6. **Final Answer** - Once sufficient information is gathered, a comprehensive answer is provided
212
+ ## FAQ
470
213
 
471
- This allows analysis of codebases **far exceeding** typical context limits (2M+ characters) while using minimal tokens per query.
214
+ **Q: Do I need to pay for an API?**
472
215
 
473
- ### Nucleus DSL Reference
216
+ No. Use Ollama for free local AI, or just use the zero-cost tools (search, find_importers, etc.) which don't use AI at all.
474
217
 
475
- Argus uses the [Nucleus DSL](https://github.com/michaelwhitford/nucleus) for document operations:
218
+ **Q: How big can my codebase be?**
476
219
 
477
- ```lisp
478
- ; Search
479
- (grep "pattern") ; Find matching lines
480
- (grep "error" "i") ; Case-insensitive search
220
+ Argus has been tested on codebases with 100k+ lines. The snapshot file grows linearly (~3KB per 100 lines of code), and search remains fast because it's just regex.
481
221
 
482
- ; Transform
483
- (map RESULTS (lambda (x) ...)) ; Transform results
484
- (filter RESULTS (lambda (x) ...)) ; Filter results
485
- (sort RESULTS key) ; Sort results
222
+ **Q: Should I commit the snapshot to git?**
486
223
 
487
- ; Aggregate
488
- (count RESULTS) ; Count items
489
- (sum RESULTS) ; Sum numeric values
490
- (first RESULTS) ; Get first item
491
- (take RESULTS n) ; Get first n items
224
+ Optional. Snapshots are deterministic, so you can regenerate them. But committing `.argus/snapshot.txt` means new contributors have it immediately.
492
225
 
493
- ; Extract
494
- (match str "pattern" group) ; Regex extraction
495
- (split str delimiter) ; Split string
226
+ **Q: How do I exclude files?**
496
227
 
497
- ; Final Answer
498
- <<<FINAL>>>your answer here<<<END>>>
228
+ ```bash
229
+ argus snapshot . --exclude "node_modules,dist,*.test.ts"
499
230
  ```
500
231
 
501
- ---
232
+ Or add patterns to your config file.
502
233
 
503
- ## Requirements
234
+ **Q: Why not just use grep?**
504
235
 
505
- - Node.js 18+
506
- - npm or pnpm
507
- - API key for your chosen provider (or Ollama for free local usage)
508
-
509
- ---
510
-
511
- ## FAQ & Documentation
512
-
513
- - **[FAQ](./docs/FAQ.md)** - Common questions about costs, workflow, and troubleshooting
514
- - **[CLAUDE.md Integration](./docs/CLAUDE_MD_INTEGRATION.md)** - How to add Argus to your project's CLAUDE.md
515
-
516
- ### Quick Answers
517
-
518
- **"Do I need to pay for another API?"**
519
- No! Use Ollama (free, local) or zero-cost tools like `search_codebase` (no AI at all).
520
-
521
- **"I'm starting a fresh project - how does Argus help?"**
522
- Argus works from Day 0. Snapshot your PRD/TDD, then refresh as you build. See [FAQ](./docs/FAQ.md#im-starting-a-brand-new-project---theres-nothing-to-scan-yet).
523
-
524
- **"How do I keep the snapshot updated?"**
525
- Run `argus status .` to check freshness, then `argus snapshot .` to refresh. See [FAQ](./docs/FAQ.md#how-do-i-keep-the-snapshot-up-to-date).
526
-
527
- **"What's the difference between basic and enhanced snapshots?"**
528
- Enhanced snapshots (default) include import graphs and export indexes that enable zero-cost dependency queries. Basic snapshots are faster to create but only support regex search.
236
+ You can! `search_codebase` is essentially grep. But Argus also gives you:
237
+ - Pre-computed import graph for dependency queries
238
+ - Export index for "where is X defined?"
239
+ - AI analysis when you need deeper understanding
529
240
 
530
241
  ---
531
242
 
532
243
  ## Acknowledgments
533
244
 
534
- Argus builds upon and extends the innovative work of [Matryoshka RLM](https://github.com/yogthos/Matryoshka) by [Dmitri Sotnikov (yogthos)](https://github.com/yogthos).
535
-
536
- The Matryoshka project introduced the brilliant concept of **Recursive Language Models (RLM)** - using an LLM to generate symbolic commands (via the [Nucleus DSL](https://github.com/michaelwhitford/nucleus)) that are executed against documents, enabling analysis of files far exceeding context window limits. This approach achieves **93% token savings** compared to traditional methods.
245
+ Argus combines ideas from two projects:
537
246
 
538
- **What Argus adds:**
247
+ ### Matryoshka RLM
539
248
 
540
- | Matryoshka | Argus |
541
- |------------|-------|
542
- | Single file analysis | Full codebase analysis |
543
- | CLI-only | CLI + MCP Server + Web UI |
544
- | Ollama/DeepSeek providers | Multi-provider (ZAI, Anthropic, OpenAI, Ollama, DeepSeek) |
545
- | Manual configuration | Interactive setup wizard |
546
- | Document-focused | Code-aware with structural metadata |
547
- | No caching | Worker service with LRU cache |
548
-
549
- We encourage you to explore the original [Matryoshka](https://github.com/yogthos/Matryoshka) project and the [RLM research paper](https://arxiv.org/abs/2512.24601) that inspired this approach.
249
+ The core analysis engine is based on [Matryoshka](https://github.com/yogthos/Matryoshka) by Dmitri Sotnikov. It introduced **Recursive Language Models** - using an LLM to generate symbolic commands that navigate large documents. This achieves 93% token savings compared to naive approaches.
550
250
 
551
251
  ### claude-mem
552
252
 
553
- The Argus 2.0 upgrade was heavily inspired by [claude-mem](https://github.com/thedotmack/claude-mem) by [thedotmack](https://github.com/thedotmack). The progressive disclosure architecture, self-documenting MCP tools, and Claude Code integration patterns were adapted from claude-mem's innovative approach to context management.
253
+ The progressive disclosure architecture and Claude Code integration patterns are inspired by [claude-mem](https://github.com/thedotmack/claude-mem) by thedotmack. The idea of "search first, fetch details only when needed" dramatically reduces token usage.
554
254
 
555
255
  ---
556
256
 
557
257
  ## License
558
258
 
559
- MIT License - See [LICENSE](./LICENSE)
560
-
561
- ## Contributing
562
-
563
- Contributions are welcome! Please read our contributing guidelines before submitting PRs.
564
-
565
- ## Related Projects
566
-
567
- - [Matryoshka RLM](https://github.com/yogthos/Matryoshka) - The original RLM implementation that inspired Argus
568
- - [claude-mem](https://github.com/thedotmack/claude-mem) - Progressive disclosure and MCP patterns that inspired Argus 2.0
569
- - [Nucleus DSL](https://github.com/michaelwhitford/nucleus) - The symbolic language used for document operations
570
- - [RLM Paper](https://arxiv.org/abs/2512.24601) - Academic research on Recursive Language Models
259
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sashabogi/argus-mcp",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "Codebase Intelligence Beyond Context Limits - AI-powered analysis for entire projects",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",