Skip to content

Commit da68f3c

Browse files
rushikeshmoreclaude
andcommitted
docs: update README and server comment for v0.6.0
Update tool count (13→5), add MCP resources/prompts sections, inline context injection docs, inject CLI command, coupling noise filter. Rewrote "What makes it unique" and "How It Works" sections. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4c9006b commit da68f3c

2 files changed

Lines changed: 31 additions & 26 deletions

File tree

README.md

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Every AI coding session starts with exploration — grepping, reading wrong file
2222

2323
## The Solution
2424

25-
CodeCortex eliminates the cold start. It pre-builds codebase knowledge — architecture, dependencies, risk areas, hidden coupling — so agents skip the exploration phase and go straight to the right files.
25+
CodeCortex eliminates the cold start. It pre-builds codebase knowledge — architecture, dependencies, risk areas, hidden coupling — and injects it directly into your agent's context (CLAUDE.md, .cursorrules, etc.) so agents have project knowledge from the first prompt.
2626

2727
**Not a middleware. Not a proxy. Just knowledge your agent loads on day one.**
2828

@@ -43,7 +43,7 @@ Three capabilities no other tool provides:
4343

4444
2. **Risk scores** — File X has been bug-fixed 7 times, has 6 hidden dependencies, and co-changes with 3 other files. Risk score: 35. You can't learn this from reading code.
4545

46-
3. **Cross-session memory**Decisions, patterns, observations persist. The agent doesn't start from zero each session.
46+
3. **Inline context injection**Project knowledge is injected directly into CLAUDE.md, .cursorrules, and other agent config files with architecture, risk map, and editing directives. Agents use it without any setup.
4747

4848
**Example from a real codebase:**
4949
- `schema.help.ts` and `schema.labels.ts` co-changed in 12/14 commits (86%) with **zero imports between them**
@@ -61,8 +61,8 @@ npm install -g codecortex-ai --legacy-peer-deps
6161
cd /path/to/your-project
6262
codecortex init
6363

64-
# Check knowledge freshness
65-
codecortex status
64+
# Regenerate inline context in CLAUDE.md and agent config files
65+
codecortex inject
6666
```
6767

6868
### Connect to Claude Code
@@ -101,7 +101,7 @@ Add to `.cursor/mcp.json`:
101101

102102
## What Gets Generated
103103

104-
All knowledge lives in `.codecortex/` as flat files in your repo:
104+
All knowledge lives in `.codecortex/` as flat files in your repo, plus inline context is injected into agent config files:
105105

106106
```
107107
.codecortex/
@@ -111,11 +111,16 @@ All knowledge lives in `.codecortex/` as flat files in your repo:
111111
graph.json # dependency graph (imports, calls, modules)
112112
symbols.json # full symbol index (functions, classes, types...)
113113
temporal.json # git coupling, hotspots, bug history
114+
hotspots.md # risk-ranked files (static, always available)
114115
AGENT.md # tool usage guide for AI agents
115116
modules/*.md # per-module structural analysis
116117
decisions/*.md # architectural decision records
117118
sessions/*.md # session change logs
118119
patterns.md # coding patterns and conventions
120+
121+
CLAUDE.md # ← inline context injected here
122+
.cursorrules # ← and here (if exists)
123+
.windsurfrules # ← and here (if exists)
119124
```
120125

121126
## Six Knowledge Layers
@@ -129,37 +134,34 @@ All knowledge lives in `.codecortex/` as flat files in your repo:
129134
| 5. Patterns | How code is written here | `patterns.md` |
130135
| 6. Sessions | What changed between sessions | `sessions/*.md` |
131136

132-
## MCP Tools (13)
137+
## MCP Tools (5)
133138

134-
### Navigation — "Where should I look?" (4 tools)
139+
Five focused tools that provide capabilities agents can't get from reading code:
135140

136141
| Tool | Description |
137142
|------|-------------|
138143
| `get_project_overview` | Architecture, modules, risk map. Call this first. |
139-
| `search_knowledge` | Find where a function/class/type is DEFINED by name. Ranked results. |
144+
| `get_dependency_graph` | Import/export graph filtered by module or file. |
140145
| `lookup_symbol` | Precise symbol lookup with kind and file path filters. |
141-
| `get_module_context` | Module files, deps, temporal signals. Zoom into a module. |
146+
| `get_change_coupling` | Files that must change together. Hidden dependencies flagged. |
147+
| `get_edit_briefing` | Pre-edit risk: co-change warnings, hidden deps, bug history. **Always call before editing.** |
142148

143-
### Risk — "What could go wrong?" (4 tools)
149+
### MCP Resources (3)
144150

145-
| Tool | Description |
146-
|------|-------------|
147-
| `get_edit_briefing` | Pre-edit risk: co-change warnings, hidden deps, bug history. **Always call before editing.** |
148-
| `get_hotspots` | Files ranked by risk (churn x coupling x bugs). |
149-
| `get_change_coupling` | Files that must change together. Hidden dependencies flagged. |
150-
| `get_dependency_graph` | Import/export graph filtered by module or file. |
151+
Static knowledge available without tool calls:
151152

152-
### Memory — "Remember this" (5 tools)
153+
| Resource | Description |
154+
|----------|-------------|
155+
| `codecortex://project/overview` | Full project constitution |
156+
| `codecortex://project/hotspots` | Risk-ranked file table |
157+
| `codecortex://module/{name}` | Per-module documentation |
153158

154-
| Tool | Description |
155-
|------|-------------|
156-
| `get_session_briefing` | What changed since the last session. |
157-
| `get_decision_history` | Why things were built this way. |
158-
| `record_decision` | Save an architectural decision. |
159-
| `update_patterns` | Document coding conventions. |
160-
| `record_observation` | Record anything you learned about the codebase. |
159+
### MCP Prompts (2)
161160

162-
All read tools include `_freshness` metadata and return context-safe responses (<10K chars) via size-adaptive caps.
161+
| Prompt | Description |
162+
|--------|-------------|
163+
| `start_session` | Returns constitution + latest session context |
164+
| `before_editing` | Takes file paths, returns risk/coupling/bug briefing |
163165

164166
## CLI Commands
165167

@@ -168,6 +170,7 @@ All read tools include `_freshness` metadata and return context-safe responses (
168170
| `codecortex init` | Discover project + extract symbols + analyze git history |
169171
| `codecortex serve` | Start MCP server (stdio transport) |
170172
| `codecortex update` | Re-extract changed files, update affected modules |
173+
| `codecortex inject` | Regenerate inline context in CLAUDE.md and agent config files |
171174
| `codecortex status` | Show knowledge freshness, stale modules, symbol counts |
172175
| `codecortex symbols [query]` | Browse and filter the symbol index |
173176
| `codecortex search <query>` | Search across symbols, file paths, and docs |
@@ -180,6 +183,8 @@ All read tools include `_freshness` metadata and return context-safe responses (
180183

181184
**Hybrid extraction:** tree-sitter native N-API for structure (symbols, imports, calls across 27 languages) + host LLM for semantics (what modules do, why they're built that way). Zero extra API keys.
182185

186+
**Inline context injection:** After analysis, CodeCortex injects a rich knowledge section directly into CLAUDE.md and other agent config files. This includes architecture overview, risk map with coupled file names, and editing directives — so agents have project context from the first prompt without needing MCP.
187+
183188
**Git hooks** keep knowledge fresh — `codecortex update` runs automatically on every commit, re-extracting changed files and updating temporal analysis.
184189

185190
**Size-adaptive responses** — CodeCortex classifies your project (micro → extra-large) and adjusts response caps accordingly. A 23-file project gets full detail. A 6,400-file project gets intelligent summaries. Every MCP tool response stays under 10K chars.

src/mcp/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* CodeCortex MCP Server
33
*
44
* Serves codebase knowledge to AI agents via Model Context Protocol.
5-
* 13 tools: 8 read + 5 write (navigation, risk, memory).
5+
* 5 tools + 3 resources + 2 prompts for navigation, risk, and editing safety.
66
*
77
* Usage:
88
* codecortex serve

0 commit comments

Comments
 (0)