codecompass-mcp 2.6.0__tar.gz → 2.6.2__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.
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/PKG-INFO +29 -48
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/README.md +28 -47
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/codecompass_mcp.egg-info/PKG-INFO +29 -48
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/pyproject.toml +1 -1
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/LICENSE +0 -0
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/codecompass_mcp.egg-info/SOURCES.txt +0 -0
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/codecompass_mcp.egg-info/dependency_links.txt +0 -0
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/codecompass_mcp.egg-info/entry_points.txt +0 -0
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/codecompass_mcp.egg-info/requires.txt +0 -0
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/codecompass_mcp.egg-info/top_level.txt +0 -0
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/config.py +0 -0
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/graph/__init__.py +0 -0
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/graph/cli.py +0 -0
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/graph/code_graph_client.py +0 -0
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/graph/code_query_cli.py +0 -0
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/graph/setup.py +0 -0
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/ingestion/__init__.py +0 -0
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/ingestion/chunker.py +0 -0
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/ingestion/code_normalizer.py +0 -0
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/ingestion/code_parser.py +0 -0
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/ingestion/description_enricher.py +0 -0
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/ingestion/entity_resolver.py +0 -0
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/ingestion/file_watcher.py +0 -0
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/ingestion/graph_writer.py +0 -0
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/ingestion/hierarchy_builder.py +0 -0
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/ingestion/reader_agent.py +0 -0
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/ingestion/source_context.py +0 -0
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/main.py +0 -0
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/mcp_server.py +0 -0
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/models/__init__.py +0 -0
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/models/code_types.py +0 -0
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/models/types.py +0 -0
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/setup.cfg +0 -0
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/tests/test_batch_impact.py +0 -0
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/tests/test_blast_radius.py +0 -0
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/tests/test_code_parser.py +0 -0
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/tests/test_description_enricher.py +0 -0
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/tests/test_ingestion.py +0 -0
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/tests/test_lit_css_parser.py +0 -0
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/tests/test_mcp_server.py +0 -0
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/tests/test_php_parser.py +0 -0
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/utils/__init__.py +0 -0
- {codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/utils/formatting.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codecompass-mcp
|
|
3
|
-
Version: 2.6.
|
|
3
|
+
Version: 2.6.2
|
|
4
4
|
Summary: Structural code context for AI coding agents — a local code knowledge graph for blast radius, impact, deps, dead code, and flow tracing
|
|
5
5
|
Author: CodeCompass contributors
|
|
6
6
|
License: MIT
|
|
@@ -70,26 +70,8 @@ command, instead of opening a dozen files to follow the thread:
|
|
|
70
70
|

|
|
71
71
|
|
|
72
72
|
The `json` flow format hands each node its real signature, docstring, and source
|
|
73
|
-
snippet, plus the numbered call order
|
|
74
|
-
flow
|
|
75
|
-
|
|
76
|
-
> **How `ingest_code` works** (narrated by an agent from `--flow ... --format json`)
|
|
77
|
-
>
|
|
78
|
-
> 1. **`init_project`** — sets up the `.codecompass/` directory and registers the
|
|
79
|
-
> project's `AGENTS.md` rules before anything is parsed.
|
|
80
|
-
> 2. **`get_client`** — opens the local NetworkX graph that everything will be
|
|
81
|
-
> written into.
|
|
82
|
-
> 3. **`build_hierarchy`** — walks the repo and writes the Project → Folder → File
|
|
83
|
-
> skeleton nodes.
|
|
84
|
-
> 4. **`parse_directory`** — recursively parses every supported file, extracting
|
|
85
|
-
> functions, classes, imports, and call relationships.
|
|
86
|
-
> 5. **`normalize_triples`** — (optional) runs the Haiku pass to canonicalize
|
|
87
|
-
> entity names.
|
|
88
|
-
> 6. **`write_code_triples_batch`** — persists all extracted relationships into the
|
|
89
|
-
> graph, then reports the node count and refreshes `AGENTS.md`.
|
|
90
|
-
>
|
|
91
|
-
> Net effect: a repo goes from raw files to a queryable dependency graph in one
|
|
92
|
-
> pass, with the graph saved locally as JSON.
|
|
73
|
+
snippet, plus the numbered call order, so an agent can narrate the whole data
|
|
74
|
+
flow from that single query instead of opening a dozen files.
|
|
93
75
|
|
|
94
76
|
---
|
|
95
77
|
|
|
@@ -183,7 +165,9 @@ That's it. Two commands:
|
|
|
183
165
|
- Writes a `## Code graph` section into the project's `AGENTS.md` with mandatory rules for agents:
|
|
184
166
|
- Run `--blast-radius` before editing any file
|
|
185
167
|
- Run `--impact` before calling unfamiliar symbols
|
|
186
|
-
- Re-ingest after
|
|
168
|
+
- Re-ingest after any code change
|
|
169
|
+
- Installs the Claude Code `PreToolUse` guardrail into `.claude/` (see
|
|
170
|
+
[Hard enforcement](#hard-enforcement-for-claude-code--pi-optional) below)
|
|
187
171
|
|
|
188
172
|
Any AI agent that reads `AGENTS.md` (Claude Code, OpenCode, Cursor, etc.) will follow these rules automatically.
|
|
189
173
|
|
|
@@ -197,32 +181,21 @@ actually blocked instead of just discouraged, both Claude Code and
|
|
|
197
181
|
[pi](https://pi.dev) support hard tool-call enforcement via hooks/extensions.
|
|
198
182
|
|
|
199
183
|
The block only covers what codecompass unambiguously replaces — searching or
|
|
200
|
-
reading code content (`
|
|
201
|
-
left alone; they have legitimate non-code uses
|
|
202
|
-
confirming a generated file exists, listing fixtures)
|
|
203
|
-
|
|
204
|
-
instructions rather than blocking it — see the `AGENTS.md` this tool
|
|
205
|
-
generates for the exact wording.
|
|
184
|
+
reading code content (`Grep`/`Glob` tools, `cat`/`grep`/`rg`/`sed`/`awk`/`head`/`tail`/`less`
|
|
185
|
+
inside `Bash`). `ls`/`find` are left alone; they have legitimate non-code uses
|
|
186
|
+
(checking build output, confirming a generated file exists, listing fixtures)
|
|
187
|
+
that the graph doesn't cover.
|
|
206
188
|
|
|
207
189
|
### Claude Code
|
|
208
190
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
]
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
`.claude/hooks/block-file-search.py` reads the tool call from stdin, blocks
|
|
223
|
-
`Grep` and `cat`/`grep`/`rg` inside `Bash` (exit code `2`, with the reason
|
|
224
|
-
printed to stderr so Claude sees it and redirects to codecompass), and
|
|
225
|
-
allows everything else.
|
|
191
|
+
`codecompass init` installs this automatically — no manual setup needed. It
|
|
192
|
+
writes `.claude/hooks/block-file-search.py` and merges the required
|
|
193
|
+
`PreToolUse` matchers (`Bash`, `Grep`, `Glob`) into `.claude/settings.json`,
|
|
194
|
+
without clobbering any hooks you've already configured. The hook reads the
|
|
195
|
+
tool call from stdin, blocks matches (exit code `2`, with the reason printed
|
|
196
|
+
to stderr so Claude sees it and redirects to codecompass), and allows
|
|
197
|
+
everything else. Start a new Claude Code session in the repo and accept the
|
|
198
|
+
trust prompt — hooks execute shell commands, so Claude Code asks first.
|
|
226
199
|
|
|
227
200
|
### Pi
|
|
228
201
|
|
|
@@ -298,14 +271,20 @@ Every format numbers each call by source line so call order is explicit. By defa
|
|
|
298
271
|
| Command | Purpose |
|
|
299
272
|
|---|---|
|
|
300
273
|
| `codecompass init [path]` | Create `.codecompass/` and register in `AGENTS.md` |
|
|
301
|
-
| `codecompass ingest-code [path]` | Parse source files and build/rebuild the graph |
|
|
274
|
+
| `codecompass ingest-code [path] [--normalize] [--dump-triples <out.json>] [--describe]` | Parse source files and build/rebuild the graph |
|
|
275
|
+
| `codecompass describe [path] [--batch-size N] [--force] [--apply]` | Stage entity descriptions for an agent swarm to fill in, then merge results back into the graph |
|
|
302
276
|
| `codecompass query <flags> [path]` | Query the graph (blast-radius, impact, deps, flow, tree, etc.) |
|
|
303
277
|
| `codecompass watch [path]` | Live re-index on file changes |
|
|
304
278
|
| `codecompass load-triples <file> <path>` | Load pre-processed triples from JSON |
|
|
279
|
+
| `codecompass mcp [path]` | Run the MCP server, defaulting to the given repo |
|
|
305
280
|
| `codecompass setup` | Copy instructions to `~/.config/opencode/codecompass/` |
|
|
306
281
|
|
|
307
282
|
All commands default to `.` (current directory) when path is omitted.
|
|
308
283
|
|
|
284
|
+
`--describe` (on `ingest-code`) and the standalone `describe` command are
|
|
285
|
+
**user-triggered only** — expensive, and not something an agent should run
|
|
286
|
+
automatically after a routine edit or re-ingest.
|
|
287
|
+
|
|
309
288
|
---
|
|
310
289
|
|
|
311
290
|
## MCP server
|
|
@@ -400,13 +379,15 @@ codecompass/
|
|
|
400
379
|
│ ├── code_parser.py tree-sitter entity + relationship extraction
|
|
401
380
|
│ ├── hierarchy_builder.py Project → Folder → File skeleton
|
|
402
381
|
│ ├── file_watcher.py incremental re-index on file changes
|
|
403
|
-
│
|
|
382
|
+
│ ├── code_normalizer.py optional entity name normalization (Haiku)
|
|
383
|
+
│ └── description_enricher.py agent-swarm description staging/apply (describe)
|
|
404
384
|
├── models/
|
|
405
385
|
│ └── code_types.py CodeTriple, FileNode, FolderNode
|
|
406
386
|
├── opencode/
|
|
407
387
|
│ └── instructions.md agent instructions for opencode integration
|
|
408
388
|
├── config.py env var config with fallback defaults
|
|
409
|
-
|
|
389
|
+
├── main.py CLI dispatch: init / ingest-code / describe / query / watch / mcp
|
|
390
|
+
└── mcp_server.py FastMCP server exposing the same queries as tools
|
|
410
391
|
```
|
|
411
392
|
|
|
412
393
|
Inside each indexed project:
|
|
@@ -32,26 +32,8 @@ command, instead of opening a dozen files to follow the thread:
|
|
|
32
32
|

|
|
33
33
|
|
|
34
34
|
The `json` flow format hands each node its real signature, docstring, and source
|
|
35
|
-
snippet, plus the numbered call order
|
|
36
|
-
flow
|
|
37
|
-
|
|
38
|
-
> **How `ingest_code` works** (narrated by an agent from `--flow ... --format json`)
|
|
39
|
-
>
|
|
40
|
-
> 1. **`init_project`** — sets up the `.codecompass/` directory and registers the
|
|
41
|
-
> project's `AGENTS.md` rules before anything is parsed.
|
|
42
|
-
> 2. **`get_client`** — opens the local NetworkX graph that everything will be
|
|
43
|
-
> written into.
|
|
44
|
-
> 3. **`build_hierarchy`** — walks the repo and writes the Project → Folder → File
|
|
45
|
-
> skeleton nodes.
|
|
46
|
-
> 4. **`parse_directory`** — recursively parses every supported file, extracting
|
|
47
|
-
> functions, classes, imports, and call relationships.
|
|
48
|
-
> 5. **`normalize_triples`** — (optional) runs the Haiku pass to canonicalize
|
|
49
|
-
> entity names.
|
|
50
|
-
> 6. **`write_code_triples_batch`** — persists all extracted relationships into the
|
|
51
|
-
> graph, then reports the node count and refreshes `AGENTS.md`.
|
|
52
|
-
>
|
|
53
|
-
> Net effect: a repo goes from raw files to a queryable dependency graph in one
|
|
54
|
-
> pass, with the graph saved locally as JSON.
|
|
35
|
+
snippet, plus the numbered call order, so an agent can narrate the whole data
|
|
36
|
+
flow from that single query instead of opening a dozen files.
|
|
55
37
|
|
|
56
38
|
---
|
|
57
39
|
|
|
@@ -145,7 +127,9 @@ That's it. Two commands:
|
|
|
145
127
|
- Writes a `## Code graph` section into the project's `AGENTS.md` with mandatory rules for agents:
|
|
146
128
|
- Run `--blast-radius` before editing any file
|
|
147
129
|
- Run `--impact` before calling unfamiliar symbols
|
|
148
|
-
- Re-ingest after
|
|
130
|
+
- Re-ingest after any code change
|
|
131
|
+
- Installs the Claude Code `PreToolUse` guardrail into `.claude/` (see
|
|
132
|
+
[Hard enforcement](#hard-enforcement-for-claude-code--pi-optional) below)
|
|
149
133
|
|
|
150
134
|
Any AI agent that reads `AGENTS.md` (Claude Code, OpenCode, Cursor, etc.) will follow these rules automatically.
|
|
151
135
|
|
|
@@ -159,32 +143,21 @@ actually blocked instead of just discouraged, both Claude Code and
|
|
|
159
143
|
[pi](https://pi.dev) support hard tool-call enforcement via hooks/extensions.
|
|
160
144
|
|
|
161
145
|
The block only covers what codecompass unambiguously replaces — searching or
|
|
162
|
-
reading code content (`
|
|
163
|
-
left alone; they have legitimate non-code uses
|
|
164
|
-
confirming a generated file exists, listing fixtures)
|
|
165
|
-
|
|
166
|
-
instructions rather than blocking it — see the `AGENTS.md` this tool
|
|
167
|
-
generates for the exact wording.
|
|
146
|
+
reading code content (`Grep`/`Glob` tools, `cat`/`grep`/`rg`/`sed`/`awk`/`head`/`tail`/`less`
|
|
147
|
+
inside `Bash`). `ls`/`find` are left alone; they have legitimate non-code uses
|
|
148
|
+
(checking build output, confirming a generated file exists, listing fixtures)
|
|
149
|
+
that the graph doesn't cover.
|
|
168
150
|
|
|
169
151
|
### Claude Code
|
|
170
152
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
]
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
`.claude/hooks/block-file-search.py` reads the tool call from stdin, blocks
|
|
185
|
-
`Grep` and `cat`/`grep`/`rg` inside `Bash` (exit code `2`, with the reason
|
|
186
|
-
printed to stderr so Claude sees it and redirects to codecompass), and
|
|
187
|
-
allows everything else.
|
|
153
|
+
`codecompass init` installs this automatically — no manual setup needed. It
|
|
154
|
+
writes `.claude/hooks/block-file-search.py` and merges the required
|
|
155
|
+
`PreToolUse` matchers (`Bash`, `Grep`, `Glob`) into `.claude/settings.json`,
|
|
156
|
+
without clobbering any hooks you've already configured. The hook reads the
|
|
157
|
+
tool call from stdin, blocks matches (exit code `2`, with the reason printed
|
|
158
|
+
to stderr so Claude sees it and redirects to codecompass), and allows
|
|
159
|
+
everything else. Start a new Claude Code session in the repo and accept the
|
|
160
|
+
trust prompt — hooks execute shell commands, so Claude Code asks first.
|
|
188
161
|
|
|
189
162
|
### Pi
|
|
190
163
|
|
|
@@ -260,14 +233,20 @@ Every format numbers each call by source line so call order is explicit. By defa
|
|
|
260
233
|
| Command | Purpose |
|
|
261
234
|
|---|---|
|
|
262
235
|
| `codecompass init [path]` | Create `.codecompass/` and register in `AGENTS.md` |
|
|
263
|
-
| `codecompass ingest-code [path]` | Parse source files and build/rebuild the graph |
|
|
236
|
+
| `codecompass ingest-code [path] [--normalize] [--dump-triples <out.json>] [--describe]` | Parse source files and build/rebuild the graph |
|
|
237
|
+
| `codecompass describe [path] [--batch-size N] [--force] [--apply]` | Stage entity descriptions for an agent swarm to fill in, then merge results back into the graph |
|
|
264
238
|
| `codecompass query <flags> [path]` | Query the graph (blast-radius, impact, deps, flow, tree, etc.) |
|
|
265
239
|
| `codecompass watch [path]` | Live re-index on file changes |
|
|
266
240
|
| `codecompass load-triples <file> <path>` | Load pre-processed triples from JSON |
|
|
241
|
+
| `codecompass mcp [path]` | Run the MCP server, defaulting to the given repo |
|
|
267
242
|
| `codecompass setup` | Copy instructions to `~/.config/opencode/codecompass/` |
|
|
268
243
|
|
|
269
244
|
All commands default to `.` (current directory) when path is omitted.
|
|
270
245
|
|
|
246
|
+
`--describe` (on `ingest-code`) and the standalone `describe` command are
|
|
247
|
+
**user-triggered only** — expensive, and not something an agent should run
|
|
248
|
+
automatically after a routine edit or re-ingest.
|
|
249
|
+
|
|
271
250
|
---
|
|
272
251
|
|
|
273
252
|
## MCP server
|
|
@@ -362,13 +341,15 @@ codecompass/
|
|
|
362
341
|
│ ├── code_parser.py tree-sitter entity + relationship extraction
|
|
363
342
|
│ ├── hierarchy_builder.py Project → Folder → File skeleton
|
|
364
343
|
│ ├── file_watcher.py incremental re-index on file changes
|
|
365
|
-
│
|
|
344
|
+
│ ├── code_normalizer.py optional entity name normalization (Haiku)
|
|
345
|
+
│ └── description_enricher.py agent-swarm description staging/apply (describe)
|
|
366
346
|
├── models/
|
|
367
347
|
│ └── code_types.py CodeTriple, FileNode, FolderNode
|
|
368
348
|
├── opencode/
|
|
369
349
|
│ └── instructions.md agent instructions for opencode integration
|
|
370
350
|
├── config.py env var config with fallback defaults
|
|
371
|
-
|
|
351
|
+
├── main.py CLI dispatch: init / ingest-code / describe / query / watch / mcp
|
|
352
|
+
└── mcp_server.py FastMCP server exposing the same queries as tools
|
|
372
353
|
```
|
|
373
354
|
|
|
374
355
|
Inside each indexed project:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codecompass-mcp
|
|
3
|
-
Version: 2.6.
|
|
3
|
+
Version: 2.6.2
|
|
4
4
|
Summary: Structural code context for AI coding agents — a local code knowledge graph for blast radius, impact, deps, dead code, and flow tracing
|
|
5
5
|
Author: CodeCompass contributors
|
|
6
6
|
License: MIT
|
|
@@ -70,26 +70,8 @@ command, instead of opening a dozen files to follow the thread:
|
|
|
70
70
|

|
|
71
71
|
|
|
72
72
|
The `json` flow format hands each node its real signature, docstring, and source
|
|
73
|
-
snippet, plus the numbered call order
|
|
74
|
-
flow
|
|
75
|
-
|
|
76
|
-
> **How `ingest_code` works** (narrated by an agent from `--flow ... --format json`)
|
|
77
|
-
>
|
|
78
|
-
> 1. **`init_project`** — sets up the `.codecompass/` directory and registers the
|
|
79
|
-
> project's `AGENTS.md` rules before anything is parsed.
|
|
80
|
-
> 2. **`get_client`** — opens the local NetworkX graph that everything will be
|
|
81
|
-
> written into.
|
|
82
|
-
> 3. **`build_hierarchy`** — walks the repo and writes the Project → Folder → File
|
|
83
|
-
> skeleton nodes.
|
|
84
|
-
> 4. **`parse_directory`** — recursively parses every supported file, extracting
|
|
85
|
-
> functions, classes, imports, and call relationships.
|
|
86
|
-
> 5. **`normalize_triples`** — (optional) runs the Haiku pass to canonicalize
|
|
87
|
-
> entity names.
|
|
88
|
-
> 6. **`write_code_triples_batch`** — persists all extracted relationships into the
|
|
89
|
-
> graph, then reports the node count and refreshes `AGENTS.md`.
|
|
90
|
-
>
|
|
91
|
-
> Net effect: a repo goes from raw files to a queryable dependency graph in one
|
|
92
|
-
> pass, with the graph saved locally as JSON.
|
|
73
|
+
snippet, plus the numbered call order, so an agent can narrate the whole data
|
|
74
|
+
flow from that single query instead of opening a dozen files.
|
|
93
75
|
|
|
94
76
|
---
|
|
95
77
|
|
|
@@ -183,7 +165,9 @@ That's it. Two commands:
|
|
|
183
165
|
- Writes a `## Code graph` section into the project's `AGENTS.md` with mandatory rules for agents:
|
|
184
166
|
- Run `--blast-radius` before editing any file
|
|
185
167
|
- Run `--impact` before calling unfamiliar symbols
|
|
186
|
-
- Re-ingest after
|
|
168
|
+
- Re-ingest after any code change
|
|
169
|
+
- Installs the Claude Code `PreToolUse` guardrail into `.claude/` (see
|
|
170
|
+
[Hard enforcement](#hard-enforcement-for-claude-code--pi-optional) below)
|
|
187
171
|
|
|
188
172
|
Any AI agent that reads `AGENTS.md` (Claude Code, OpenCode, Cursor, etc.) will follow these rules automatically.
|
|
189
173
|
|
|
@@ -197,32 +181,21 @@ actually blocked instead of just discouraged, both Claude Code and
|
|
|
197
181
|
[pi](https://pi.dev) support hard tool-call enforcement via hooks/extensions.
|
|
198
182
|
|
|
199
183
|
The block only covers what codecompass unambiguously replaces — searching or
|
|
200
|
-
reading code content (`
|
|
201
|
-
left alone; they have legitimate non-code uses
|
|
202
|
-
confirming a generated file exists, listing fixtures)
|
|
203
|
-
|
|
204
|
-
instructions rather than blocking it — see the `AGENTS.md` this tool
|
|
205
|
-
generates for the exact wording.
|
|
184
|
+
reading code content (`Grep`/`Glob` tools, `cat`/`grep`/`rg`/`sed`/`awk`/`head`/`tail`/`less`
|
|
185
|
+
inside `Bash`). `ls`/`find` are left alone; they have legitimate non-code uses
|
|
186
|
+
(checking build output, confirming a generated file exists, listing fixtures)
|
|
187
|
+
that the graph doesn't cover.
|
|
206
188
|
|
|
207
189
|
### Claude Code
|
|
208
190
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
]
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
`.claude/hooks/block-file-search.py` reads the tool call from stdin, blocks
|
|
223
|
-
`Grep` and `cat`/`grep`/`rg` inside `Bash` (exit code `2`, with the reason
|
|
224
|
-
printed to stderr so Claude sees it and redirects to codecompass), and
|
|
225
|
-
allows everything else.
|
|
191
|
+
`codecompass init` installs this automatically — no manual setup needed. It
|
|
192
|
+
writes `.claude/hooks/block-file-search.py` and merges the required
|
|
193
|
+
`PreToolUse` matchers (`Bash`, `Grep`, `Glob`) into `.claude/settings.json`,
|
|
194
|
+
without clobbering any hooks you've already configured. The hook reads the
|
|
195
|
+
tool call from stdin, blocks matches (exit code `2`, with the reason printed
|
|
196
|
+
to stderr so Claude sees it and redirects to codecompass), and allows
|
|
197
|
+
everything else. Start a new Claude Code session in the repo and accept the
|
|
198
|
+
trust prompt — hooks execute shell commands, so Claude Code asks first.
|
|
226
199
|
|
|
227
200
|
### Pi
|
|
228
201
|
|
|
@@ -298,14 +271,20 @@ Every format numbers each call by source line so call order is explicit. By defa
|
|
|
298
271
|
| Command | Purpose |
|
|
299
272
|
|---|---|
|
|
300
273
|
| `codecompass init [path]` | Create `.codecompass/` and register in `AGENTS.md` |
|
|
301
|
-
| `codecompass ingest-code [path]` | Parse source files and build/rebuild the graph |
|
|
274
|
+
| `codecompass ingest-code [path] [--normalize] [--dump-triples <out.json>] [--describe]` | Parse source files and build/rebuild the graph |
|
|
275
|
+
| `codecompass describe [path] [--batch-size N] [--force] [--apply]` | Stage entity descriptions for an agent swarm to fill in, then merge results back into the graph |
|
|
302
276
|
| `codecompass query <flags> [path]` | Query the graph (blast-radius, impact, deps, flow, tree, etc.) |
|
|
303
277
|
| `codecompass watch [path]` | Live re-index on file changes |
|
|
304
278
|
| `codecompass load-triples <file> <path>` | Load pre-processed triples from JSON |
|
|
279
|
+
| `codecompass mcp [path]` | Run the MCP server, defaulting to the given repo |
|
|
305
280
|
| `codecompass setup` | Copy instructions to `~/.config/opencode/codecompass/` |
|
|
306
281
|
|
|
307
282
|
All commands default to `.` (current directory) when path is omitted.
|
|
308
283
|
|
|
284
|
+
`--describe` (on `ingest-code`) and the standalone `describe` command are
|
|
285
|
+
**user-triggered only** — expensive, and not something an agent should run
|
|
286
|
+
automatically after a routine edit or re-ingest.
|
|
287
|
+
|
|
309
288
|
---
|
|
310
289
|
|
|
311
290
|
## MCP server
|
|
@@ -400,13 +379,15 @@ codecompass/
|
|
|
400
379
|
│ ├── code_parser.py tree-sitter entity + relationship extraction
|
|
401
380
|
│ ├── hierarchy_builder.py Project → Folder → File skeleton
|
|
402
381
|
│ ├── file_watcher.py incremental re-index on file changes
|
|
403
|
-
│
|
|
382
|
+
│ ├── code_normalizer.py optional entity name normalization (Haiku)
|
|
383
|
+
│ └── description_enricher.py agent-swarm description staging/apply (describe)
|
|
404
384
|
├── models/
|
|
405
385
|
│ └── code_types.py CodeTriple, FileNode, FolderNode
|
|
406
386
|
├── opencode/
|
|
407
387
|
│ └── instructions.md agent instructions for opencode integration
|
|
408
388
|
├── config.py env var config with fallback defaults
|
|
409
|
-
|
|
389
|
+
├── main.py CLI dispatch: init / ingest-code / describe / query / watch / mcp
|
|
390
|
+
└── mcp_server.py FastMCP server exposing the same queries as tools
|
|
410
391
|
```
|
|
411
392
|
|
|
412
393
|
Inside each indexed project:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "codecompass-mcp"
|
|
3
|
-
version = "2.6.
|
|
3
|
+
version = "2.6.2"
|
|
4
4
|
description = "Structural code context for AI coding agents — a local code knowledge graph for blast radius, impact, deps, dead code, and flow tracing"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
license = {text = "MIT"}
|
|
File without changes
|
|
File without changes
|
{codecompass_mcp-2.6.0 → codecompass_mcp-2.6.2}/codecompass_mcp.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|