You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -20,7 +20,7 @@ Here's what codebase-context does:
20
20
21
21
One tool call returns all of it. Local-first - your code never leaves your machine.
22
22
23
-
<!-- TODO: Add demo GIF: search_codebase("How does this app attach the auth token to outgoing API calls?") → AuthInterceptor top result + preflight + agent proceeds or asks -->
23
+
<!-- TODO: Add demo GIF: search_codebase("How does this app attach the auth token to outgoing API calls?") -> AuthInterceptor top result + preflight + agent proceeds or asks -->
24
24
<!--  -->
25
25
26
26
## Quick Start
@@ -93,9 +93,57 @@ Open Settings > MCP and add:
93
93
}
94
94
```
95
95
96
-
## Codex
96
+
###Codex
97
97
98
-
Run codex mcp add codebase-context npx -y codebase-context "/path/to/your/project"
|`search_codebase`| Hybrid search + decision card. Pass `intent="edit"` to get `ready`, `nextAction`, patterns, caller coverage, and `whatWouldHelp`. |
213
+
|`get_team_patterns`| Pattern frequencies, golden files, conflict detection |
201
214
|`get_symbol_references`| Find concrete references to a symbol (usageCount + top snippets). `confidence: "syntactic"` = static/source-based only; no runtime or dynamic dispatch. |
202
-
|`remember`| Record a convention, decision, gotcha, or failure |
203
-
|`get_memory`| Query team memory with confidence decay scoring |
|`get_style_guide`| Style guide rules for the current project |
219
+
|`detect_circular_dependencies`| Import cycles between files |
220
+
|`refresh_index`| Re-index (full or incremental) + extract git memories |
221
+
|`get_indexing_status`| Progress and stats for the current index |
209
222
210
223
## Evaluation Harness (`npm run eval`)
211
224
@@ -229,7 +242,7 @@ npm run eval -- tests/fixtures/codebases/eval-controlled tests/fixtures/codebase
229
242
230
243
The retrieval pipeline is designed around one goal: give the agent the right context, not just any file that matches.
231
244
232
-
-**Definition-first ranking** - for exact-name lookups (e.g. a symbol name), the file that *defines* the symbol ranks above files that only use it.
245
+
-**Definition-first ranking** - for exact-name lookups (e.g. a symbol name), the file that _defines_ the symbol ranks above files that only use it.
233
246
-**Intent classification** - knows whether "AuthService" is a name lookup or "how does auth work" is conceptual. Adjusts keyword/semantic weights accordingly.
234
247
-**Hybrid fusion (RRF)** - combines keyword and semantic search using Reciprocal Rank Fusion instead of brittle score averaging.
npx codebase-context memory list --category conventions --type convention
330
-
npx codebase-context memory list --query "auth" --json
331
-
npx codebase-context memory add --type convention --category tooling --memory "Use pnpm, not npm" --reason "Workspace support and speed"
332
-
npx codebase-context memory remove <id>
342
+
npx -y codebase-context memory list
343
+
npx -y codebase-context memory list --category conventions --type convention
344
+
npx -y codebase-context memory list --query "auth" --json
345
+
npx -y codebase-context memory add --type convention --category tooling --memory "Use pnpm, not npm" --reason "Workspace support and speed"
346
+
npx -y codebase-context memory remove <id>
333
347
```
334
348
335
349
All commands accept `--json` for raw JSON output suitable for piping and scripting.
336
350
337
-
## Tip: Ensuring your AI Agent recalls memory:
351
+
## What to add to your CLAUDE.md / AGENTS.md
338
352
339
-
Add this to`.cursorrules`, `CLAUDE.md`, or `AGENTS.md`:
353
+
Paste this into`.cursorrules`, `CLAUDE.md`, `AGENTS.md`, or wherever your AI reads project instructions:
340
354
341
-
```
342
-
## Codebase Context
355
+
```markdown
356
+
## Codebase Context (MCP)
357
+
358
+
**Start of every task:** Call `get_memory` to load team conventions before writing any code.
343
359
344
-
**At start of each task:** Call `get_memory` to load team conventions.
360
+
**Before editing existing code:** Call `search_codebase` with `intent: "edit"`. If the preflight card says `ready: false`, read the listed files before touching anything.
345
361
346
-
**When user says "remember this" or "record this":**
347
-
- Call `remember` tool IMMEDIATELY before doing anything else.
362
+
**Before writing new code:** Call `get_team_patterns` to check how the team handles DI, state, testing, and library wrappers — don't introduce a new pattern if one already exists.
363
+
364
+
**When asked to "remember" or "record" something:** Call `remember` immediately, before doing anything else.
365
+
366
+
**When adding imports that cross module boundaries:** Call `detect_circular_dependencies` with the relevant scope after adding the import.
348
367
```
349
368
369
+
These are the behaviors that make the most difference day-to-day. Copy, trim what doesn't apply to your stack, and add it once.
370
+
350
371
## Links
351
372
352
373
-[Motivation](./MOTIVATION.md) - Research and design rationale
0 commit comments