Skip to content

Commit 2b893d0

Browse files
committed
chore: regenerate .codecortex/ knowledge and inject CLAUDE.md
Dogfoods the v0.6.0 release + the Apr 19 manifest fix. Refreshed cortex.yaml is clean (no absolute root path). Adds missing AGENT.md and hotspots.md that were not committed with v0.6.0. Knowledge stats: 70 files, 1549 symbols, 7 modules, 52 commits, 21 hidden deps.
1 parent d2b84d5 commit 2b893d0

11 files changed

Lines changed: 953 additions & 370 deletions

.codecortex/AGENT.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# CodeCortex — Codebase Navigation & Risk Tools
2+
3+
This project uses CodeCortex. It gives you a pre-built map of the codebase — architecture, dependencies, risk areas, hidden coupling. Use it to navigate to the right files, then read those files with your normal tools.
4+
5+
**CodeCortex finds WHERE to look. You still read the code.**
6+
7+
## Navigation (start here)
8+
- `get_project_overview` — architecture, modules, risk map. Call this first.
9+
- `lookup_symbol` — precise symbol lookup with kind + file path filters. Use when you know exactly what you're looking for (e.g., "all interfaces in gateway/").
10+
- `get_dependency_graph` — import/export graph filtered by file or module.
11+
12+
## When to use grep instead
13+
- "How does X work?" → grep (searches file contents)
14+
- "Find all usage of X" → grep (finds every occurrence)
15+
- "Where is X defined?" → `lookup_symbol` (finds definitions with filters)
16+
17+
## Before Editing (ALWAYS call these)
18+
- `get_edit_briefing` — co-change risks, hidden dependencies, bug history for files you plan to edit. Prevents bugs from files that secretly change together.
19+
- `get_change_coupling` — files that historically change together. Missing one causes bugs.
20+
21+
## Static Knowledge (read directly, no tool needed)
22+
- `.codecortex/modules/*.md` — module docs (purpose, deps, API)
23+
- `.codecortex/hotspots.md` — files ranked by risk (churn + coupling + bugs)
24+
- `.codecortex/patterns.md` — coding conventions
25+
- `.codecortex/decisions/*.md` — architectural decision records
26+
27+
## Response Detail Control
28+
Most tools accept `detail: "brief"` (default) or `"full"`. Use brief for exploration, full only when you need exhaustive data.

.codecortex/constitution.md

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,60 +5,60 @@
55
## Project
66
- **Name:** codecortex-ai
77
- **Languages:** typescript
8-
- **Files:** 57
9-
- **Symbols:** 1313
8+
- **Files:** 70
9+
- **Symbols:** 1549
1010
- **Modules:** 7
11-
- **Last updated:** 2026-03-07T20:43:20.651Z
11+
- **Last updated:** 2026-04-21T10:10:23.420Z
1212

1313
## Architecture
1414

1515
**Entry points:** `dist/cli/index.js`
1616

17-
**Modules:**
18-
- **cli** (13 files, 1569 lines) — typescript
19-
- **core** (11 files, 974 lines) — typescript
17+
**Modules (7):**
18+
- **cli** (14 files, 1661 lines) — typescript
19+
- **core** (14 files, 1654 lines) — typescript
2020
- **extraction** (4 files, 1149 lines) — typescript
21-
- **git** (3 files, 359 lines) — typescript
22-
- **mcp** (3 files, 708 lines) — typescript
23-
- **types** (2 files, 226 lines) — typescript
24-
- **utils** (3 files, 210 lines) — typescript
21+
- **mcp** (4 files, 590 lines) — typescript
22+
- **git** (3 files, 440 lines) — typescript
23+
- **utils** (4 files, 283 lines) — typescript
24+
- **types** (2 files, 228 lines) — typescript
2525

26-
**External dependencies:** `node:path`, `node:fs`, `simple-git`, `node:child_process`, `commander`, `node:module`, `node:os`, `tree-sitter`, `@modelcontextprotocol/sdk`, `zod`, `yaml`, `vitest`, `express`, `tsup`
26+
**External dependencies (14):** `node:path`, `node:fs`, `simple-git`, `node:child_process`, `commander`, `node:module`, `node:os`, `tree-sitter`, `@modelcontextprotocol/sdk`, `zod`, `yaml`, `vitest`, `express`, `tsup`
2727

2828
## Risk Map
2929

3030
**Hottest files (most changes):**
31-
- `README.md`12 changes, VOLATILE
32-
- `src/mcp/server.ts`10 changes, VOLATILE
33-
- `CLAUDE.md`7 changes, STABILIZING
34-
- `tests/extraction/parser.test.ts`6 changes, STABILIZING
35-
- `src/extraction/parser.ts`5 changes, STABILIZING
31+
- `README.md`17 changes, MODERATE
32+
- `src/mcp/server.ts`14 changes, MODERATE
33+
- `CLAUDE.md`12 changes, MODERATE
34+
- `src/cli/commands/init.ts`9 changes, VOLATILE
35+
- `src/cli/commands/update.ts`7 changes, MODERATE
3636

3737
**Hidden dependencies (co-change but no import):**
38-
- `src/cli/commands/init.ts``src/cli/commands/update.ts`5 co-changes (100%)
39-
- `.gitignore``src/cli/commands/init.ts`3 co-changes (60%)
40-
- `.gitignore``src/cli/commands/update.ts` — 3 co-changes (60%)
41-
- `src/cli/commands/init.ts``tsup.config.ts` — 3 co-changes (60%)
42-
- `src/cli/commands/update.ts``tsup.config.ts` — 3 co-changes (60%)
38+
- `src/cli/commands/init.ts``src/cli/commands/update.ts`7 co-changes (78%)
39+
- `src/mcp/tools/read.ts``src/mcp/tools/write.ts`4 co-changes (67%)
40+
- `src/core/agent-instructions.ts``src/mcp/tools/read.ts` — 3 co-changes (50%)
41+
- `src/core/constitution.ts``src/mcp/tools/read.ts` — 3 co-changes (50%)
42+
- `src/git/temporal.ts``src/mcp/tools/read.ts` — 3 co-changes (50%)
4343

4444
**Bug-prone files:**
45-
- `README.md`3 fix commits
46-
- v0.4.3 — Node 20-22 engine restriction, fix broken README link
45+
- `CLAUDE.md`4 fix commits
46+
- revert to "knowledge layer" positioning, add cold-start framing
4747
- remove tree-sitter-liquid git dep that broke npm installs (v0.4.2)
48-
- Go type extraction, docs cleanup, npm publish as codecortex-ai
49-
- `src/mcp/server.ts` — 3 fix commits
48+
- align version and language count across all surfaces
49+
- `README.md` — 4 fix commits
50+
- revert to "knowledge layer" positioning, add cold-start framing
5051
- v0.4.3 — Node 20-22 engine restriction, fix broken README link
5152
- remove tree-sitter-liquid git dep that broke npm installs (v0.4.2)
52-
- align version and language count across all surfaces
53-
- `CLAUDE.md` — 3 fix commits
53+
- `src/mcp/server.ts` — 4 fix commits
54+
- revert to "knowledge layer" positioning, add cold-start framing
55+
- v0.4.3 — Node 20-22 engine restriction, fix broken README link
5456
- remove tree-sitter-liquid git dep that broke npm installs (v0.4.2)
55-
- align version and language count across all surfaces
56-
- Go type extraction, docs cleanup, npm publish as codecortex-ai
5757

5858
## Available Knowledge
5959

6060
**Module docs:** `cli`, `core`, `extraction`, `git`, `mcp`, `types`, `utils`
6161

62-
Use `get_module_context` to deep-dive into any module.
62+
Read `.codecortex/modules/*.md` directly for module deep-dives.
6363
Use `get_change_coupling` before editing a file to check what else must change.
6464
Use `lookup_symbol` to find any function, type, or class.

.codecortex/cortex.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
version: 1.0.0
22
project: codecortex-ai
3-
generated: 2026-03-07T12:52:20.783Z
4-
lastUpdated: 2026-03-07T20:43:20.651Z
3+
generated: 2026-04-21T10:10:23.420Z
4+
lastUpdated: 2026-04-21T10:10:23.420Z
55
languages:
66
- typescript
7-
totalFiles: 57
8-
totalSymbols: 1313
7+
totalFiles: 70
8+
totalSymbols: 1549
99
totalModules: 7
10+
projectSize: small
1011
tiers:
1112
hot:
1213
- cortex.yaml
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Decision: Initialized CodeCortex for codebase knowledge
2+
3+
**Date:** 2026-04-21
4+
**Status:** accepted
5+
6+
## Context
7+
AI agents need persistent knowledge to avoid re-learning the codebase each session.
8+
9+
## Decision
10+
Using CodeCortex to pre-analyze symbols, dependencies, coupling, and patterns.
11+
12+
## Alternatives Considered
13+
- Manual CLAUDE.md only
14+
- No codebase context for agents
15+
16+
## Consequences
17+
- AI agents start with knowledge
18+
- .codecortex/ added to repo
19+
- Knowledge needs periodic update via codecortex update

.codecortex/graph.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

.codecortex/hotspots.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Risk-Ranked Files
2+
3+
> Auto-generated by CodeCortex. 52 commits analyzed over 90 days.
4+
5+
| File | Changes | Couplings | Bugs | Risk | Stability |
6+
|------|---------|-----------|------|------|-----------|
7+
| `src/mcp/server.ts` | 14 | 9 | 4 | 30.08 | moderate |
8+
| `README.md` | 17 | 0 | 4 | 29 | moderate |
9+
| `src/cli/commands/init.ts` | 9 | 17 | 1 | 24.54 | volatile |
10+
| `CLAUDE.md` | 12 | 0 | 4 | 24 | moderate |
11+
| `src/cli/commands/update.ts` | 7 | 13 | 0 | 19.16 | moderate |
12+
| `src/mcp/tools/read.ts` | 6 | 11 | 0 | 16.8 | moderate |
13+
| `src/extraction/parser.ts` | 5 | 6 | 1 | 14.32 | moderate |
14+
| `src/extraction/symbols.ts` | 4 | 6 | 1 | 14.22 | moderate |
15+
| `src/git/temporal.ts` | 5 | 5 | 1 | 13.42 | moderate |
16+
| `src/extraction/calls.ts` | 3 | 6 | 0 | 11.22 | moderate |
17+
| `src/extraction/imports.ts` | 3 | 6 | 0 | 11.22 | moderate |
18+
| `tsup.config.ts` | 3 | 6 | 0 | 11.22 | moderate |
19+
| `src/types/index.ts` | 4 | 4 | 1 | 10.58 | moderate |
20+
| `src/core/discovery.ts` | 4 | 3 | 1 | 9.72 | moderate |
21+
| `tests/extraction/parser.test.ts` | 6 | 0 | 1 | 9 | moderate |
22+
| `src/mcp/tools/write.ts` | 4 | 5 | 0 | 8.48 | moderate |
23+
| `src/core/manifest.ts` | 3 | 2 | 1 | 8.16 | moderate |
24+
| `src/cli/index.ts` | 6 | 3 | 0 | 7.94 | moderate |
25+
| `src/core/constitution.ts` | 4 | 4 | 0 | 7.16 | moderate |
26+
| `src/core/agent-instructions.ts` | 3 | 3 | 0 | 6.42 | moderate |
27+
| `tests/core/agent-instructions.test.ts` | 3 | 3 | 0 | 6.42 | moderate |
28+
| `tests/fixtures/setup.ts` | 3 | 0 | 1 | 6 | moderate |
29+
| `src/core/graph.ts` | 3 | 0 | 1 | 6 | moderate |
30+
| `src/utils/files.ts` | 3 | 0 | 1 | 6 | moderate |
31+
| `.gitignore` | 4 | 2 | 0 | 5.52 | moderate |
32+
| `tests/mcp/read-tools.test.ts` | 4 | 2 | 0 | 5.42 | moderate |
33+
| `tests/mcp/simulation.test.ts` | 3 | 1 | 0 | 5 | moderate |
34+
| `tests/mcp/write-tools.test.ts` | 3 | 1 | 0 | 5 | moderate |
35+
| `.codecortex/cortex.yaml` | 2 | 0 | 1 | 5 | stable |
36+
| `tests/extraction/symbols.test.ts` | 2 | 0 | 1 | 5 | very_stable |
37+
38+
Generated: 2026-04-21T10:10:23.419Z

.codecortex/overview.md

Lines changed: 6 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
**Type:** node
44
**Languages:** typescript
5-
**Files:** 55
5+
**Files:** 70
66

77
## Entry Points
88
- `dist/cli/index.js`
@@ -16,91 +16,9 @@
1616
- **types**
1717
- **utils**
1818

19-
## File Map
19+
## Directory Summary
20+
- **src/** — 45 files
21+
- **tests/** — 23 files
22+
- **./** — 2 files
2023

21-
### ./
22-
- tsup.config.ts
23-
- vitest.config.ts
24-
25-
### src/cli/
26-
- grouped-help.ts
27-
- index.ts
28-
29-
### src/cli/commands/
30-
- hook.ts
31-
- hotspots.ts
32-
- init.ts
33-
- modules.ts
34-
- search.ts
35-
- serve.ts
36-
- status.ts
37-
- symbols.ts
38-
- update.ts
39-
- upgrade.ts
40-
41-
### src/cli/utils/
42-
- version-check.ts
43-
44-
### src/core/
45-
- constitution.ts
46-
- decisions.ts
47-
- discovery.ts
48-
- graph.ts
49-
- manifest.ts
50-
- module-gen.ts
51-
- modules.ts
52-
- patterns.ts
53-
- search.ts
54-
- sessions.ts
55-
56-
### src/extraction/
57-
- calls.ts
58-
- imports.ts
59-
- parser.ts
60-
- symbols.ts
61-
62-
### src/git/
63-
- diff.ts
64-
- history.ts
65-
- temporal.ts
66-
67-
### src/mcp/
68-
- server.ts
69-
70-
### src/mcp/tools/
71-
- read.ts
72-
- write.ts
73-
74-
### src/types/
75-
- index.ts
76-
- schema.ts
77-
78-
### src/utils/
79-
- files.ts
80-
- markdown.ts
81-
- yaml.ts
82-
83-
### tests/cli/
84-
- hook.test.ts
85-
- version-check.test.ts
86-
87-
### tests/core/
88-
- decisions.test.ts
89-
- graph.test.ts
90-
- search.test.ts
91-
- sessions.test.ts
92-
93-
### tests/extraction/
94-
- calls.test.ts
95-
- imports.test.ts
96-
- parser.test.ts
97-
- symbols.test.ts
98-
99-
### tests/fixtures/
100-
- setup.ts
101-
102-
### tests/mcp/
103-
- read-tools.test.ts
104-
- server.test.ts
105-
- simulation.test.ts
106-
- write-tools.test.ts
24+
> For detailed file lists, use `search_knowledge` or `get_dependency_graph` MCP tools.

.codecortex/patterns.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Coding Patterns
22

3-
No patterns recorded yet. Use `update_patterns` to add patterns.
3+
No patterns recorded yet. Edit this file directly to add patterns.

.codecortex/symbols.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)