@sashabogi/argus-mcp 2.0.1 → 2.0.3
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 +143 -443
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,570 +1,270 @@
|
|
|
1
1
|
# Argus
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Understand Any Codebase, Regardless of Size**
|
|
4
4
|
|
|
5
|
-
**
|
|
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
|
|
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
|
-
|
|
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 |
|
|
20
|
-
|
|
21
|
-
## Quick Start
|
|
9
|
+

|
|
22
10
|
|
|
23
|
-
|
|
24
|
-
# 1. Install globally via npm
|
|
25
|
-
npm install -g @sashabogi/argus-mcp
|
|
11
|
+
## How It Works
|
|
26
12
|
|
|
27
|
-
|
|
28
|
-
argus init
|
|
13
|
+
### 1. Create a Snapshot
|
|
29
14
|
|
|
30
|
-
|
|
31
|
-
argus mcp install
|
|
15
|
+
A snapshot is a single text file containing your entire codebase, organized for efficient searching:
|
|
32
16
|
|
|
33
|
-
|
|
34
|
-
argus
|
|
17
|
+
```bash
|
|
18
|
+
argus snapshot . -o .argus/snapshot.txt
|
|
35
19
|
```
|
|
36
20
|
|
|
37
|
-
|
|
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
|
-
|
|
26
|
+
### 2. Claude Searches Before Reading
|
|
40
27
|
|
|
41
|
-
|
|
28
|
+
When you ask Claude about your code, it doesn't read the whole snapshot. Instead, it uses **progressive disclosure**:
|
|
42
29
|
|
|
43
|
-
```bash
|
|
44
|
-
npm install -g @sashabogi/argus-mcp
|
|
45
30
|
```
|
|
31
|
+
You: "How does the authentication flow work?"
|
|
46
32
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
npm install
|
|
53
|
-
npm run build
|
|
54
|
-
npm link
|
|
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)
|
|
55
38
|
```
|
|
56
39
|
|
|
57
|
-
|
|
40
|
+
**90% of questions are answered with FREE tools.** The AI-powered analysis is only used for complex architectural questions.
|
|
58
41
|
|
|
59
|
-
|
|
60
|
-
argus update
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
---
|
|
42
|
+
### 3. Automatic Updates
|
|
64
43
|
|
|
65
|
-
|
|
44
|
+
You don't need to manually refresh snapshots. Argus integrates with Claude Code's lifecycle:
|
|
66
45
|
|
|
67
|
-
|
|
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
|
|
68
49
|
|
|
69
|
-
|
|
70
|
-
|
|
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
|
-
|
|
52
|
+
## Quick Start
|
|
84
53
|
|
|
85
54
|
```bash
|
|
86
|
-
#
|
|
87
|
-
|
|
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
|
-
|
|
58
|
+
# Setup (configures AI provider for deep analysis)
|
|
59
|
+
argus init
|
|
100
60
|
|
|
101
|
-
|
|
61
|
+
# Add to Claude Code
|
|
62
|
+
argus mcp install
|
|
102
63
|
|
|
103
|
-
|
|
104
|
-
|
|
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
|
-
```
|
|
110
|
-
|
|
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
67
|
```
|
|
133
68
|
|
|
134
|
-
|
|
69
|
+
That's it. Now when you ask Claude about your code, it will automatically use Argus.
|
|
135
70
|
|
|
136
|
-
|
|
71
|
+
---
|
|
137
72
|
|
|
138
|
-
|
|
139
|
-
# Start the worker service
|
|
140
|
-
argus worker start
|
|
73
|
+
## The Tools
|
|
141
74
|
|
|
142
|
-
|
|
143
|
-
argus worker status
|
|
75
|
+
Argus provides 6 MCP tools, organized by cost:
|
|
144
76
|
|
|
145
|
-
|
|
146
|
-
argus worker stop
|
|
147
|
-
```
|
|
77
|
+
### Zero-Cost Tools (No AI, Instant Results)
|
|
148
78
|
|
|
149
|
-
|
|
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
|
-
|
|
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
|
-
|
|
90
|
+
| Tool | Cost | What It Does |
|
|
91
|
+
|------|------|--------------|
|
|
92
|
+
| `analyze_codebase` | ~500 tokens | Deep analysis using recursive reasoning. For complex questions. |
|
|
156
93
|
|
|
157
|
-
|
|
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
|
-
|
|
96
|
+
---
|
|
167
97
|
|
|
168
|
-
|
|
98
|
+
## Snapshots: Basic vs Enhanced
|
|
169
99
|
|
|
170
100
|
```bash
|
|
171
|
-
#
|
|
172
|
-
argus
|
|
101
|
+
# Enhanced (default) - includes import graph and export index
|
|
102
|
+
argus snapshot .
|
|
173
103
|
|
|
174
|
-
#
|
|
175
|
-
argus
|
|
104
|
+
# Basic - just the code, faster to create
|
|
105
|
+
argus snapshot . --basic
|
|
176
106
|
```
|
|
177
107
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
**Web UI Features:**
|
|
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.
|
|
181
109
|
|
|
182
|
-
|
|
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:
|
|
191
|
-
|
|
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
|
-
##
|
|
114
|
+
## Web UI: Codebase Explorer
|
|
203
115
|
|
|
204
|
-
|
|
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
|
-
```
|
|
231
|
-
|
|
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
|
-
```
|
|
116
|
+
Visualize your codebase structure:
|
|
246
117
|
|
|
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
|
-
|
|
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
|
|
257
127
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
```bash
|
|
261
|
-
argus mcp install
|
|
262
|
-
```
|
|
128
|
+
Drag and drop a snapshot file, or paste its contents directly.
|
|
263
129
|
|
|
264
|
-
|
|
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
|
-
|
|
132
|
+
## Keeping Snapshots Fresh
|
|
270
133
|
|
|
271
|
-
|
|
134
|
+
### Manual Refresh
|
|
272
135
|
|
|
273
136
|
```bash
|
|
274
|
-
|
|
275
|
-
|
|
137
|
+
# Check if snapshot is stale
|
|
138
|
+
argus status .
|
|
276
139
|
|
|
277
|
-
|
|
278
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
315
|
-
|
|
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
|
-
|
|
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
|
-
|
|
331
|
-
|
|
332
|
-
get_file_deps({
|
|
333
|
-
path: ".argus/snapshot.txt",
|
|
334
|
-
file: "src/app.tsx"
|
|
335
|
-
})
|
|
336
|
-
```
|
|
153
|
+
```markdown
|
|
154
|
+
## Codebase Intelligence
|
|
337
155
|
|
|
338
|
-
|
|
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
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
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
|
|
168
|
+
Argus stores config in `~/.argus/config.json`:
|
|
361
169
|
|
|
362
170
|
```json
|
|
363
171
|
{
|
|
364
|
-
"provider": "
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
193
|
+
**Note**: The AI provider is only used for `analyze_codebase`. All other tools are completely free.
|
|
412
194
|
|
|
413
|
-
|
|
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
|
-
```
|
|
195
|
+
---
|
|
426
196
|
|
|
427
|
-
|
|
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
|
-
```
|
|
197
|
+
## CLI Reference
|
|
433
198
|
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
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
|
-
##
|
|
212
|
+
## FAQ
|
|
461
213
|
|
|
462
|
-
|
|
214
|
+
**Q: Do I need to pay for an API?**
|
|
463
215
|
|
|
464
|
-
|
|
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
|
|
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.
|
|
470
217
|
|
|
471
|
-
|
|
218
|
+
**Q: How big can my codebase be?**
|
|
472
219
|
|
|
473
|
-
|
|
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.
|
|
474
221
|
|
|
475
|
-
|
|
222
|
+
**Q: Should I commit the snapshot to git?**
|
|
476
223
|
|
|
477
|
-
|
|
478
|
-
; Search
|
|
479
|
-
(grep "pattern") ; Find matching lines
|
|
480
|
-
(grep "error" "i") ; Case-insensitive search
|
|
224
|
+
Optional. Snapshots are deterministic, so you can regenerate them. But committing `.argus/snapshot.txt` means new contributors have it immediately.
|
|
481
225
|
|
|
482
|
-
|
|
483
|
-
(map RESULTS (lambda (x) ...)) ; Transform results
|
|
484
|
-
(filter RESULTS (lambda (x) ...)) ; Filter results
|
|
485
|
-
(sort RESULTS key) ; Sort results
|
|
226
|
+
**Q: How do I exclude files?**
|
|
486
227
|
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
(sum RESULTS) ; Sum numeric values
|
|
490
|
-
(first RESULTS) ; Get first item
|
|
491
|
-
(take RESULTS n) ; Get first n items
|
|
492
|
-
|
|
493
|
-
; Extract
|
|
494
|
-
(match str "pattern" group) ; Regex extraction
|
|
495
|
-
(split str delimiter) ; Split string
|
|
496
|
-
|
|
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
|
-
|
|
502
|
-
|
|
503
|
-
## Requirements
|
|
504
|
-
|
|
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
|
|
232
|
+
Or add patterns to your config file.
|
|
517
233
|
|
|
518
|
-
**
|
|
519
|
-
No! Use Ollama (free, local) or zero-cost tools like `search_codebase` (no AI at all).
|
|
234
|
+
**Q: Why not just use grep?**
|
|
520
235
|
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
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
|
|
245
|
+
Argus combines ideas from several projects:
|
|
535
246
|
|
|
536
|
-
|
|
247
|
+
### Matryoshka RLM
|
|
537
248
|
|
|
538
|
-
**
|
|
249
|
+
The core analysis engine is based on [Matryoshka](https://github.com/yogthos/Matryoshka) by [Dmitri Sotnikov (yogthos)](https://github.com/yogthos). It introduced **Recursive Language Models (RLM)** - using an LLM to generate symbolic commands via the [Nucleus DSL](https://github.com/michaelwhitford/nucleus) that navigate large documents. This achieves 93% token savings compared to naive approaches.
|
|
539
250
|
|
|
540
|
-
|
|
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.
|
|
251
|
+
The approach is described in the [RLM research paper](https://arxiv.org/abs/2512.24601).
|
|
550
252
|
|
|
551
253
|
### claude-mem
|
|
552
254
|
|
|
553
|
-
The
|
|
255
|
+
The progressive disclosure architecture and Claude Code integration patterns are inspired by [claude-mem](https://github.com/thedotmack/claude-mem) by [thedotmack](https://github.com/thedotmack). The idea of "search first, fetch details only when needed" dramatically reduces token usage.
|
|
554
256
|
|
|
555
257
|
---
|
|
556
258
|
|
|
557
|
-
##
|
|
558
|
-
|
|
559
|
-
MIT License - See [LICENSE](./LICENSE)
|
|
259
|
+
## Related Projects
|
|
560
260
|
|
|
561
|
-
|
|
261
|
+
- [Matryoshka RLM](https://github.com/yogthos/Matryoshka) - The original RLM implementation
|
|
262
|
+
- [Nucleus DSL](https://github.com/michaelwhitford/nucleus) - Symbolic language for document operations
|
|
263
|
+
- [claude-mem](https://github.com/thedotmack/claude-mem) - Progressive disclosure patterns for Claude Code
|
|
264
|
+
- [RLM Paper](https://arxiv.org/abs/2512.24601) - Academic research on Recursive Language Models
|
|
562
265
|
|
|
563
|
-
|
|
266
|
+
---
|
|
564
267
|
|
|
565
|
-
##
|
|
268
|
+
## License
|
|
566
269
|
|
|
567
|
-
|
|
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
|
|
270
|
+
MIT
|
package/package.json
CHANGED