kodelyth-ecc 1.3.0 → 1.4.1
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/.github/workflows/ci.yml +7 -8
- package/AGENTS.md +1 -1
- package/CHANGELOG.md +67 -0
- package/CLAUDE.md +5 -5
- package/KODELYTH.md +1 -1
- package/README.md +89 -14
- package/VERSION +1 -1
- package/agents/kodelyth-memory.md +87 -0
- package/bin/kodelyth-ecc.js +18 -12
- package/commands/memory.md +62 -0
- package/hooks/hooks.json +41 -0
- package/hooks/memory/auto-recall.js +141 -0
- package/hooks/memory/capture-stop.js +88 -0
- package/hooks/memory/inject-start.js +60 -0
- package/install.ps1 +20 -1
- package/install.sh +1 -1
- package/package.json +5 -2
- package/rules/common/memory-protocol.md +56 -0
- package/scripts/memory/cli.js +200 -0
- package/scripts/memory/extract.js +176 -0
- package/scripts/memory/inject.js +145 -0
- package/scripts/memory/store.js +300 -0
- package/skills/kodelyth-memory/SKILL.md +136 -0
- package/tests/memory/auto-recall.test.js +132 -0
- package/tests/memory/store.test.js +121 -0
package/.github/workflows/ci.yml
CHANGED
|
@@ -34,13 +34,12 @@ jobs:
|
|
|
34
34
|
- name: Run test suite
|
|
35
35
|
run: node tests/run-all.js
|
|
36
36
|
|
|
37
|
-
- name: Verify
|
|
38
|
-
run: node --check dashboard/server.js
|
|
39
|
-
|
|
40
|
-
- name: Verify all readers syntax
|
|
37
|
+
- name: Verify memory module syntax
|
|
41
38
|
run: |
|
|
42
|
-
node --
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
node --check scripts/memory/store.js
|
|
40
|
+
node --check scripts/memory/inject.js
|
|
41
|
+
node --check scripts/memory/extract.js
|
|
42
|
+
node --check scripts/memory/cli.js
|
|
43
|
+
node --check hooks/memory/inject-start.js
|
|
44
|
+
node --check hooks/memory/capture-stop.js
|
|
46
45
|
shell: bash
|
package/AGENTS.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# AGENTS.md
|
|
2
2
|
|
|
3
|
-
This file is read by AI agents (Cascade, Cursor, Codex, etc.) on every session. It tells them how to work in this repo and how to use the
|
|
3
|
+
This file is read by AI agents (Cascade, Cursor, Codex, etc.) on every session. It tells them how to work in this repo and how to use the 59 specialist agents and 188 skills shipped with Kodelyth ECC.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,73 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to Kodelyth ECC are documented here.
|
|
4
4
|
|
|
5
|
+
## v1.4.1 — Auto Chat Detection for Memory (May 2026)
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- **`UserPromptSubmit` hook: `hooks/memory/auto-recall.js`** — watches every prompt in real-time, runs BM25 search against your memory, and injects relevant matches into the AI's context **before it responds**
|
|
9
|
+
- **Per-session repeat suppression** — never surfaces the same memory twice in one session (state at `~/.kodelyth/memory/session-surfaced-<id>.json`)
|
|
10
|
+
- **Smart skip filters** — skips trivial prompts (`ok`, `yes`, `thanks`), agent invocations (`use foo`, `@bar`, `/help`), and prompts under 12 chars
|
|
11
|
+
- **9 new tests** for the auto-recall hook (47 total passing — 26 existing + 12 memory + 9 auto-recall)
|
|
12
|
+
|
|
13
|
+
### How it changes the experience
|
|
14
|
+
Before v1.4.1: memory only injected once at session start, then the AI had to consciously decide to query it.
|
|
15
|
+
|
|
16
|
+
After v1.4.1: every meaningful prompt the user types triggers an instant memory check. Relevant past solutions appear in the AI's context for that turn, automatically. No agent invocation needed. No `/memory recall` needed.
|
|
17
|
+
|
|
18
|
+
### Example
|
|
19
|
+
```
|
|
20
|
+
You: "I need to add Stripe webhooks for subscription renewals"
|
|
21
|
+
└─ Auto-recall fires → finds your March 2026 memory →
|
|
22
|
+
injects: "raw body parser, validate with constructEvent,
|
|
23
|
+
test with stripe-cli not curl"
|
|
24
|
+
AI: "I checked your memory — you solved this exact problem in March.
|
|
25
|
+
The approach that worked was raw body parser before
|
|
26
|
+
signature validation. Want me to apply the same pattern?"
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
You never typed `/memory recall`. The AI just knew.
|
|
30
|
+
|
|
31
|
+
### Honest limits
|
|
32
|
+
- The hook fires on Claude Code's `UserPromptSubmit` event. Other platforms (Cursor, Codex, Windsurf, Antigravity) don't currently expose an equivalent pre-prompt hook — auto-recall there is limited to SessionStart injection.
|
|
33
|
+
- Repeat suppression is per-session-id. If your platform doesn't pass a stable session_id, the same memory may surface twice across sessions (still better than none).
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## v1.4.0 — Local Self-Learning Memory (May 2026)
|
|
38
|
+
|
|
39
|
+
### Added — Kodelyth Memory
|
|
40
|
+
- **Local self-learning memory store** — captures problems and solutions from past sessions, recalls them when relevant in future sessions
|
|
41
|
+
- **Zero dependencies, zero telemetry** — all memory lives at `~/.kodelyth/memory/` (override with `KODELYTH_MEMORY_DIR`)
|
|
42
|
+
- **BM25 retrieval** — pure JS keyword + tag search, sub-millisecond, no embeddings, no network
|
|
43
|
+
- **Cache-friendly injection** — context block is structured with stable prefix → variable suffix to maximise prompt-cache hits on Anthropic and OpenAI models
|
|
44
|
+
- **Model-agnostic** — works for Claude, GPT, Gemini, Llama, any model. Prompt-cache savings apply where the provider supports it; recall quality applies everywhere
|
|
45
|
+
- **Privacy-first** — never auto-stores. Stop hook extracts candidates → user reviews via `/memory review-pending` → user confirms before storing
|
|
46
|
+
|
|
47
|
+
### New files
|
|
48
|
+
- `agents/kodelyth-memory.md` — agent persona and protocols
|
|
49
|
+
- `skills/kodelyth-memory/SKILL.md` — when and how to use the memory system
|
|
50
|
+
- `commands/memory.md` — `/memory` slash command
|
|
51
|
+
- `rules/common/memory-protocol.md` — mid-session recall + capture rules
|
|
52
|
+
- `scripts/memory/store.js` — BM25 storage + retrieval
|
|
53
|
+
- `scripts/memory/inject.js` — cache-friendly context block builder
|
|
54
|
+
- `scripts/memory/extract.js` — heuristic learning extractor for session JSONL
|
|
55
|
+
- `scripts/memory/cli.js` — CLI entry point
|
|
56
|
+
- `hooks/memory/inject-start.js` — SessionStart hook
|
|
57
|
+
- `hooks/memory/capture-stop.js` — Stop hook
|
|
58
|
+
- `tests/memory/store.test.js` — 12 new tests (38 total passing)
|
|
59
|
+
|
|
60
|
+
### Honest disclosure
|
|
61
|
+
- "Self-learning" means **better context retrieval over time**, not model fine-tuning. The LLM is unchanged. We give it smarter context.
|
|
62
|
+
- Cloud-AI platforms (Windsurf, Antigravity, partial Cursor) store sessions server-side. Auto-extract from past sessions doesn't work there. Manual `/memory remember` still does.
|
|
63
|
+
|
|
64
|
+
### Counts
|
|
65
|
+
- Agents: 58 → **59** (+kodelyth-memory)
|
|
66
|
+
- Skills: 187 → **188** (+kodelyth-memory)
|
|
67
|
+
- Commands: 79 (+`/memory`, total stays 79 — replaces no slash)
|
|
68
|
+
- Rules: 15 → **16** (+memory-protocol)
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
5
72
|
## v1.3.0 — God-Tier Intent Routing + 5 New Agents (May 2026)
|
|
6
73
|
|
|
7
74
|
### Removed
|
package/CLAUDE.md
CHANGED
|
@@ -6,11 +6,11 @@ Guidance for Claude Code when working with this repository.
|
|
|
6
6
|
|
|
7
7
|
**Kodelyth ECC** — a production-grade AI coding toolkit:
|
|
8
8
|
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
11
|
-
- **
|
|
12
|
-
- **
|
|
13
|
-
- **
|
|
9
|
+
- **59 specialist agents** — debug-detective, code-reviewer, security-reviewer, kodelyth-memory, etc.
|
|
10
|
+
- **188 skills** — domain knowledge, patterns, testing, security, intent routing, local memory
|
|
11
|
+
- **80 commands** — slash workflows (`/tdd`, `/plan`, `/code-review`, `/memory`, ...)
|
|
12
|
+
- **18+ hooks** — automated quality gates, session memory, memory inject + capture
|
|
13
|
+
- **16 rules** — always-on coding standards + intent routing + memory protocol
|
|
14
14
|
|
|
15
15
|
Works with Claude Code, Windsurf, Cursor, Codex CLI, Antigravity, and OpenCode.
|
|
16
16
|
|
package/KODELYTH.md
CHANGED
|
@@ -20,7 +20,7 @@ Now the user just describes their problem in plain words and the AI:
|
|
|
20
20
|
2. Behaves as that agent
|
|
21
21
|
3. Teaches the user the explicit form (`Tip: type "use <agent>"`)
|
|
22
22
|
|
|
23
|
-
No more memorizing
|
|
23
|
+
No more memorizing 59 agent names.
|
|
24
24
|
|
|
25
25
|
### Added: 5 New Specialist Agents
|
|
26
26
|
|
package/README.md
CHANGED
|
@@ -8,17 +8,19 @@
|
|
|
8
8
|

|
|
9
9
|

|
|
10
10
|

|
|
11
|
-

|
|
12
|
+

|
|
13
|
+

|
|
14
|
+

|
|
15
|
+

|
|
14
16
|
|
|
15
17
|
</div>
|
|
16
18
|
|
|
17
|
-
**Kodelyth ECC** is a production-grade AI coding toolkit — **
|
|
19
|
+
**Kodelyth ECC** is a production-grade AI coding toolkit — **59 specialist agents, 188 skills, 80 commands**, a god-tier **intent-routing system**, and **local self-learning memory** that gets smarter at helping *you* every session.
|
|
18
20
|
|
|
19
21
|
Works with **Claude Code**, **Windsurf**, **Cursor**, **Codex CLI**, **Google Antigravity**, and **OpenCode**.
|
|
20
22
|
|
|
21
|
-
> No dashboard. No telemetry. No cloud. Just rules, agents, and
|
|
23
|
+
> No dashboard. No telemetry. No cloud. Just rules, agents, skills, and your own private memory store — all on your disk.
|
|
22
24
|
|
|
23
25
|
---
|
|
24
26
|
|
|
@@ -151,25 +153,84 @@ See `skills/agent-handoff/SKILL.md` for the full handoff protocol and standard c
|
|
|
151
153
|
|
|
152
154
|
---
|
|
153
155
|
|
|
156
|
+
## Kodelyth Memory — Local Self-Learning (new in v1.4.0)
|
|
157
|
+
|
|
158
|
+
The first time you solve a hard problem, ECC remembers what worked. The next time you hit something similar, your AI surfaces the past solution before you ask.
|
|
159
|
+
|
|
160
|
+
```
|
|
161
|
+
Session 1 (March):
|
|
162
|
+
You: "Stripe webhook signatures are failing in production"
|
|
163
|
+
AI: [helps you debug, you discover raw body parser is required]
|
|
164
|
+
You: "Perfect, that worked, thanks"
|
|
165
|
+
→ ECC's Stop hook queues the lesson for review.
|
|
166
|
+
→ You confirm with /memory review-pending → stored locally.
|
|
167
|
+
|
|
168
|
+
Session 2 (August, new project):
|
|
169
|
+
You: "I need to add Stripe webhooks to checkout"
|
|
170
|
+
AI: I checked your memory — you solved this exact problem in March.
|
|
171
|
+
Raw body parser before signature validation, test with stripe-cli
|
|
172
|
+
not curl. Want me to apply the same pattern?
|
|
173
|
+
You: "Yes, do it"
|
|
174
|
+
→ 30 minutes of past debugging saved in 3 seconds.
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### How it works
|
|
178
|
+
|
|
179
|
+
| Layer | Mechanism |
|
|
180
|
+
|---|---|
|
|
181
|
+
| **Capture** | A Stop hook scans your session JSONL, extracts (problem, approach, gotchas, tags). Queues for your review — never auto-stores. |
|
|
182
|
+
| **Storage** | `~/.kodelyth/memory/memories.jsonl` — append-only log on your disk only. Override with `KODELYTH_MEMORY_DIR`. |
|
|
183
|
+
| **Retrieval** | BM25 keyword + tag search. Pure JS, sub-millisecond, no embeddings, no network. |
|
|
184
|
+
| **Session-start injection** | A SessionStart hook builds a cache-friendly context block: stable prefix (your patterns + recent project memories) → variable suffix (relevant to current task). |
|
|
185
|
+
| **Auto chat detection** *(v1.4.1)* | A `UserPromptSubmit` hook watches every message you type, runs BM25 search on it, and injects relevant memories **before the AI responds**. Per-session repeat suppression. Skips trivial / agent-command prompts. |
|
|
186
|
+
| **Cost win** | The stable prefix sits in the prompt cache. Anthropic charges 10% on cached tokens (5-min TTL); OpenAI auto-caches prefixes ≥1024 tokens. Long sessions become dramatically cheaper. |
|
|
187
|
+
|
|
188
|
+
### Privacy
|
|
189
|
+
|
|
190
|
+
Every byte stays on your machine. Verify any time with `ls -la ~/.kodelyth/memory/`. Sync across machines is opt-in (Dropbox/iCloud/git on that folder).
|
|
191
|
+
|
|
192
|
+
### Slash command
|
|
193
|
+
|
|
194
|
+
```
|
|
195
|
+
/memory # Stats and recent memories
|
|
196
|
+
/memory recall <query> # BM25 search
|
|
197
|
+
/memory remember "<title>" # Capture (interactive — confirms before storing)
|
|
198
|
+
/memory review-pending # Review Stop-hook candidates
|
|
199
|
+
/memory forget <id> # Soft-delete a memory
|
|
200
|
+
/memory inject [--query <text>] # Print what your AI sees about you
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Honest limits
|
|
204
|
+
|
|
205
|
+
- It is **not** model fine-tuning. The LLM never changes. We give it smarter context.
|
|
206
|
+
- Cache savings apply to Anthropic and OpenAI. Other models (Gemini, Llama, Mistral) get the recall quality without the discount.
|
|
207
|
+
- Cloud-AI platforms (Windsurf, Antigravity, partial Cursor) store sessions server-side. Auto-extract from past sessions doesn't work there. Manual `/memory remember` still does.
|
|
208
|
+
|
|
209
|
+
See `skills/kodelyth-memory/SKILL.md` for the full design + CLI reference.
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
154
213
|
## What's Inside
|
|
155
214
|
|
|
156
215
|
| Component | Count | Description |
|
|
157
216
|
|---|---|---|
|
|
158
|
-
| Agents | **
|
|
159
|
-
| Skills | **
|
|
160
|
-
| Commands | **
|
|
161
|
-
| Hooks | **
|
|
162
|
-
| Rules | **
|
|
217
|
+
| Agents | **59** | Specialist subagents — reviewers, planners, debuggers, architects, doctors, memory curator |
|
|
218
|
+
| Skills | **188** | Domain knowledge — patterns, testing, security, DevOps, intent routing, memory |
|
|
219
|
+
| Commands | **80** | Slash command workflows (`/tdd`, `/plan`, `/memory`, etc.) |
|
|
220
|
+
| Hooks | **18+** | Quality gates, secret scanning, branch checks, memory inject + capture |
|
|
221
|
+
| Rules | **16** | Always-on coding standards + intent routing + memory protocol |
|
|
222
|
+
| Memory | **local** | BM25-indexed personal memory at `~/.kodelyth/memory/` (zero deps) |
|
|
163
223
|
|
|
164
224
|
---
|
|
165
225
|
|
|
166
226
|
## Agent Arsenal
|
|
167
227
|
|
|
168
|
-
### Kodelyth Exclusives — The
|
|
228
|
+
### Kodelyth Exclusives — The 13 Agents That Make ECC
|
|
169
229
|
|
|
170
230
|
| Agent | One-line job |
|
|
171
231
|
|---|---|
|
|
172
232
|
| `kodelyth-advisor` | Master guide — picks the right tool when you don't know where to start |
|
|
233
|
+
| `kodelyth-memory` | Curates your local memory — recalls past solutions, captures new ones |
|
|
173
234
|
| `pair-programmer` | The engineer who sits next to you **before** you write the code |
|
|
174
235
|
| `debug-detective` | Never guesses — traces every bug to root cause |
|
|
175
236
|
| `silent-failure-hunter` | Finds bugs that don't throw errors |
|
|
@@ -282,8 +343,8 @@ The intent router will route you to the right one. The AI announces who's taking
|
|
|
282
343
|
|
|
283
344
|
| Source | Destination | What it does |
|
|
284
345
|
|---|---|---|
|
|
285
|
-
| `agents/` | `~/.claude/agents/` | All
|
|
286
|
-
| `skills/` | `~/.claude/skills/` | All
|
|
346
|
+
| `agents/` | `~/.claude/agents/` | All 59 subagents available globally |
|
|
347
|
+
| `skills/` | `~/.claude/skills/` | All 188 skills loadable via commands |
|
|
287
348
|
| `hooks/hooks.json` | `~/.claude/hooks/` | Automated quality gates |
|
|
288
349
|
| `rules/` | `~/.claude/rules/` | Always-on standards + intent routing |
|
|
289
350
|
| `commands/` | `~/.claude/commands/` | Slash commands (`/tdd`, `/plan`, etc.) |
|
|
@@ -394,7 +455,21 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for templates, checklists, and the full K
|
|
|
394
455
|
|
|
395
456
|
## Changelog
|
|
396
457
|
|
|
397
|
-
See [CHANGELOG.md](CHANGELOG.md). v1.
|
|
458
|
+
See [CHANGELOG.md](CHANGELOG.md). v1.4.1 highlights:
|
|
459
|
+
|
|
460
|
+
- **Added:** Auto chat detection — `UserPromptSubmit` hook watches every prompt, auto-injects relevant memories
|
|
461
|
+
- **Added:** Per-session repeat suppression (no memory shown twice in same session)
|
|
462
|
+
- **Added:** 9 new tests (47 total passing)
|
|
463
|
+
|
|
464
|
+
v1.4.0 highlights:
|
|
465
|
+
|
|
466
|
+
- **Added:** `kodelyth-memory` — local self-learning memory (BM25, zero deps, cache-friendly)
|
|
467
|
+
- **Added:** SessionStart hook injects relevant past memories; Stop hook queues candidates for review
|
|
468
|
+
- **Added:** `/memory` slash command + `kodelyth-memory` agent + `memory-protocol` rule
|
|
469
|
+
- **Added:** 12 new tests (38 total passing)
|
|
470
|
+
- **Honest disclosure:** "Self-learning" means smarter context retrieval, not model fine-tuning
|
|
471
|
+
|
|
472
|
+
v1.3.0 highlights:
|
|
398
473
|
|
|
399
474
|
- **Removed:** Lens dashboard (was inaccurate across cloud-AI platforms)
|
|
400
475
|
- **Added:** God-tier `agent-intent-routing` rule — 10 priority tiers, 50+ patterns
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.
|
|
1
|
+
1.4.1
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kodelyth-memory
|
|
3
|
+
description: Manages the local Kodelyth Memory store — captures patterns and solutions from past sessions, recalls them when relevant, and shapes context for prompt-cache savings. Use PROACTIVELY at session start to recall relevant memories, and at session end to capture what worked. Model-agnostic.
|
|
4
|
+
tools: Read, Write, Edit, Bash, Grep, Glob
|
|
5
|
+
model: sonnet
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Kodelyth Memory
|
|
9
|
+
|
|
10
|
+
You are **Kodelyth Memory** — the curator of the user's local AI memory. Everything you store stays on the user's machine. Nothing leaves.
|
|
11
|
+
|
|
12
|
+
## Your job
|
|
13
|
+
|
|
14
|
+
You do four things:
|
|
15
|
+
|
|
16
|
+
1. **Recall** — at the start of work on a new task, search past memories for relevant patterns and surface them to the user before they ask.
|
|
17
|
+
2. **Capture** — when the user solves a real problem, extract the lesson and store it.
|
|
18
|
+
3. **Curate** — keep memory honest. Forget stale entries, dedupe duplicates, escalate contradictions to the user.
|
|
19
|
+
4. **Shape context** — structure the injected memory block so it sits in the cacheable prefix of the model's context, maximising prompt-cache hits.
|
|
20
|
+
|
|
21
|
+
## Recall protocol
|
|
22
|
+
|
|
23
|
+
When invoked at session start (or when the user begins describing a new task):
|
|
24
|
+
|
|
25
|
+
1. Run `node scripts/memory/cli.js inject --query "<task summary>"` to get the relevant memory block
|
|
26
|
+
2. If `relevantCount > 0`, surface the memories naturally:
|
|
27
|
+
> "I see you solved a similar problem before — `<problem>` — using `<approach>`. Want me to apply the same pattern here, or is this case different?"
|
|
28
|
+
3. If no matches, stay quiet. Don't fabricate "you usually..." patterns from nothing.
|
|
29
|
+
4. Never recall a memory more than once per session — the user has already seen it.
|
|
30
|
+
|
|
31
|
+
## Capture protocol
|
|
32
|
+
|
|
33
|
+
When the user signals success (`"that worked"`, `"perfect"`, `"thanks"`, `"fixed it"`), or after a long iteration converges on a solution:
|
|
34
|
+
|
|
35
|
+
1. Identify:
|
|
36
|
+
- **Problem** (one sentence — what the user originally asked)
|
|
37
|
+
- **Approach** (1-3 sentences — what actually worked, not what you tried)
|
|
38
|
+
- **Gotchas** (specific traps, max 2)
|
|
39
|
+
- **Tags** (auto-extract from the conversation: `api-integration`, `auth`, `database`, etc.)
|
|
40
|
+
- **Files touched**
|
|
41
|
+
- **Language**
|
|
42
|
+
2. Show the proposed memory to the user **before storing** — silent capture is how memory systems become noise.
|
|
43
|
+
3. On confirmation, run:
|
|
44
|
+
```bash
|
|
45
|
+
node scripts/memory/cli.js remember "<problem>" --approach "<approach>" --tags "<tags>" --language "<lang>"
|
|
46
|
+
```
|
|
47
|
+
4. Confirm: "Stored. I'll bring this up next time you hit something similar."
|
|
48
|
+
|
|
49
|
+
## Curate protocol
|
|
50
|
+
|
|
51
|
+
Run `node scripts/memory/cli.js stats` weekly. Surface to user when:
|
|
52
|
+
- Memory count exceeds 500 (offer to consolidate)
|
|
53
|
+
- A tag appears in 20+ memories (offer to extract a pattern note)
|
|
54
|
+
- Two memories contradict each other (ask which is current)
|
|
55
|
+
|
|
56
|
+
## Cache-shaping rules
|
|
57
|
+
|
|
58
|
+
The injected block from `cli.js inject` is structured into:
|
|
59
|
+
- **Stable prefix** — patterns + recent project memories (identical across calls in same project)
|
|
60
|
+
- **Variable suffix** — relevant-to-this-task memories (changes per query)
|
|
61
|
+
|
|
62
|
+
Anthropic's prompt cache (5-min TTL, 10% cost on hits) and OpenAI's automatic caching both reward stable prefixes. Do not modify the stable section per session — this defeats the cache. If you need to add session-specific notes, append them after the memory block.
|
|
63
|
+
|
|
64
|
+
## What you must never do
|
|
65
|
+
|
|
66
|
+
- Capture without explicit user confirmation
|
|
67
|
+
- Send memory data to any network endpoint (it's local-only by design)
|
|
68
|
+
- Inject memories that contradict the current task without flagging the contradiction
|
|
69
|
+
- Recall the same memory twice in one session
|
|
70
|
+
- Auto-store every interaction as a memory (signal-to-noise dies)
|
|
71
|
+
|
|
72
|
+
## Honest limits
|
|
73
|
+
|
|
74
|
+
- Retrieval is **BM25 keyword + tag matching**, not semantic. It finds memories that share vocabulary with the query. It will miss semantic matches with no shared words.
|
|
75
|
+
- Memory is **per-machine**. Sync across machines requires the user opting in (Dropbox/iCloud/git on `~/.kodelyth/memory/`).
|
|
76
|
+
- On cloud-AI platforms (Windsurf, Antigravity), session data is server-side. Memory still works for capture (manual `/memory remember`) but auto-extract from past sessions is unavailable there.
|
|
77
|
+
|
|
78
|
+
## Example interaction
|
|
79
|
+
|
|
80
|
+
User: "I need to add Stripe webhooks to this project"
|
|
81
|
+
|
|
82
|
+
You (after running inject):
|
|
83
|
+
> I checked your memory — you set up Stripe webhooks 4 months ago in `payments-api`. Key things you discovered then:
|
|
84
|
+
> - Express body parser must be `raw`, not `json`, before signature validation
|
|
85
|
+
> - Test with `stripe listen --forward-to`, not curl — curl can't sign requests
|
|
86
|
+
>
|
|
87
|
+
> Want me to apply the same pattern, or is this project's setup different?
|
package/bin/kodelyth-ecc.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// Kodelyth ECC — npx entry point
|
|
3
|
-
// Usage:
|
|
4
|
-
// npx
|
|
5
|
-
// npx
|
|
6
|
-
// npx
|
|
7
|
-
// npx
|
|
8
|
-
// npx
|
|
9
|
-
// npx
|
|
10
|
-
// npx
|
|
3
|
+
// Usage (from npm — recommended):
|
|
4
|
+
// npx kodelyth-ecc # Claude Code (default)
|
|
5
|
+
// npx kodelyth-ecc --target windsurf-project # Windsurf (project)
|
|
6
|
+
// npx kodelyth-ecc --target windsurf-home # Windsurf (global)
|
|
7
|
+
// npx kodelyth-ecc --target antigravity # Google Antigravity
|
|
8
|
+
// npx kodelyth-ecc --target cursor-project # Cursor IDE
|
|
9
|
+
// npx kodelyth-ecc --target codex-home # Codex CLI
|
|
10
|
+
// npx kodelyth-ecc --target opencode # OpenCode
|
|
11
|
+
//
|
|
12
|
+
// Usage (from GitHub — latest commit):
|
|
13
|
+
// npx github:sifxprime/kodelyth-ecc
|
|
11
14
|
|
|
12
15
|
'use strict';
|
|
13
16
|
|
|
@@ -26,7 +29,7 @@ if (args.includes('--help') || args.includes('-h')) {
|
|
|
26
29
|
Kodelyth ECC — AI Coding Toolkit installer
|
|
27
30
|
|
|
28
31
|
Usage:
|
|
29
|
-
npx
|
|
32
|
+
npx kodelyth-ecc [--target TARGET] [--profile PROFILE] [languages...]
|
|
30
33
|
|
|
31
34
|
Targets:
|
|
32
35
|
claude-home Claude Code — global install (default)
|
|
@@ -38,10 +41,13 @@ if (args.includes('--help') || args.includes('-h')) {
|
|
|
38
41
|
opencode OpenCode — project install (.opencode/)
|
|
39
42
|
|
|
40
43
|
Examples:
|
|
44
|
+
npx kodelyth-ecc
|
|
45
|
+
npx kodelyth-ecc --target windsurf-project
|
|
46
|
+
npx kodelyth-ecc --target antigravity --profile nextjs
|
|
47
|
+
npx kodelyth-ecc --target claude-home typescript python
|
|
48
|
+
|
|
49
|
+
# Always-latest unreleased commit:
|
|
41
50
|
npx github:sifxprime/kodelyth-ecc
|
|
42
|
-
npx github:sifxprime/kodelyth-ecc --target windsurf-project
|
|
43
|
-
npx github:sifxprime/kodelyth-ecc --target antigravity --profile nextjs
|
|
44
|
-
npx github:sifxprime/kodelyth-ecc --target claude-home typescript python
|
|
45
51
|
|
|
46
52
|
Flags:
|
|
47
53
|
--help, -h Show this help
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Manage local Kodelyth Memory — recall, capture, review, and curate what your AI knows about you
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# /memory
|
|
6
|
+
|
|
7
|
+
Local self-learning memory. Everything stays on this machine.
|
|
8
|
+
|
|
9
|
+
## Subcommands
|
|
10
|
+
|
|
11
|
+
### `/memory`
|
|
12
|
+
Show storage stats and the 5 most recent memories for this project.
|
|
13
|
+
|
|
14
|
+
### `/memory recall <query>`
|
|
15
|
+
Search memory for `<query>` using BM25 keyword + tag retrieval. Surfaces the top 5 relevant matches.
|
|
16
|
+
|
|
17
|
+
Example:
|
|
18
|
+
```
|
|
19
|
+
/memory recall stripe webhook signature
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### `/memory remember "<title>"`
|
|
23
|
+
Capture a new memory. The agent will:
|
|
24
|
+
1. Ask for the approach (what worked) and any gotchas
|
|
25
|
+
2. Auto-extract tags and language from the conversation
|
|
26
|
+
3. Show you the proposed memory
|
|
27
|
+
4. Store only after you confirm
|
|
28
|
+
|
|
29
|
+
### `/memory review-pending`
|
|
30
|
+
Show the queue of candidate memories extracted automatically by the Stop hook from your last session. Confirm each one to store, or skip.
|
|
31
|
+
|
|
32
|
+
### `/memory forget <id>`
|
|
33
|
+
Mark a memory deleted. It's a soft-delete (the row stays in the log marked `deleted: true`) so you can recover it by editing `~/.kodelyth/memory/memories.jsonl`.
|
|
34
|
+
|
|
35
|
+
### `/memory list`
|
|
36
|
+
Show all stored memories — id, date, language, problem, tags.
|
|
37
|
+
|
|
38
|
+
### `/memory rebuild`
|
|
39
|
+
Rebuild the BM25 index from `memories.jsonl`. Run this if search results look stale or if you've manually edited the log.
|
|
40
|
+
|
|
41
|
+
### `/memory inject [--query <text>]`
|
|
42
|
+
Print the cache-friendly context block that the SessionStart hook would inject. Useful for debugging what your AI sees about you.
|
|
43
|
+
|
|
44
|
+
## Implementation
|
|
45
|
+
|
|
46
|
+
This command delegates to:
|
|
47
|
+
```bash
|
|
48
|
+
node ~/.claude/scripts/memory/cli.js <subcommand> [args]
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Or invoke the agent directly:
|
|
52
|
+
```
|
|
53
|
+
use kodelyth-memory
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Storage location
|
|
57
|
+
|
|
58
|
+
`~/.kodelyth/memory/` (override with `KODELYTH_MEMORY_DIR` env var)
|
|
59
|
+
|
|
60
|
+
- `memories.jsonl` — the source of truth
|
|
61
|
+
- `index.json` — BM25 inverted index
|
|
62
|
+
- `pending-review.jsonl` — Stop-hook candidates awaiting confirmation
|
package/hooks/hooks.json
CHANGED
|
@@ -139,6 +139,21 @@
|
|
|
139
139
|
"id": "pre:mcp-health-check"
|
|
140
140
|
}
|
|
141
141
|
],
|
|
142
|
+
"UserPromptSubmit": [
|
|
143
|
+
{
|
|
144
|
+
"matcher": "*",
|
|
145
|
+
"hooks": [
|
|
146
|
+
{
|
|
147
|
+
"type": "command",
|
|
148
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/memory/auto-recall.js\"",
|
|
149
|
+
"async": false,
|
|
150
|
+
"timeout": 3
|
|
151
|
+
}
|
|
152
|
+
],
|
|
153
|
+
"description": "Kodelyth Memory: auto-detect topic from each user prompt and inject relevant past memories before the AI responds (suppresses repeats per session)",
|
|
154
|
+
"id": "kodelyth:user-prompt:memory-auto-recall"
|
|
155
|
+
}
|
|
156
|
+
],
|
|
142
157
|
"PreCompact": [
|
|
143
158
|
{
|
|
144
159
|
"matcher": "*",
|
|
@@ -163,6 +178,19 @@
|
|
|
163
178
|
],
|
|
164
179
|
"description": "Load previous context and detect package manager on new session",
|
|
165
180
|
"id": "session:start"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"matcher": "*",
|
|
184
|
+
"hooks": [
|
|
185
|
+
{
|
|
186
|
+
"type": "command",
|
|
187
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/memory/inject-start.js\"",
|
|
188
|
+
"async": true,
|
|
189
|
+
"timeout": 5
|
|
190
|
+
}
|
|
191
|
+
],
|
|
192
|
+
"description": "Kodelyth Memory: inject relevant past memories as cache-friendly context",
|
|
193
|
+
"id": "kodelyth:session:start:memory-inject"
|
|
166
194
|
}
|
|
167
195
|
],
|
|
168
196
|
"PostToolUse": [
|
|
@@ -325,6 +353,19 @@
|
|
|
325
353
|
"description": "Kodelyth: Suggest the next logical agent or command after each response based on what just happened",
|
|
326
354
|
"id": "kodelyth:stop:smart-suggest"
|
|
327
355
|
},
|
|
356
|
+
{
|
|
357
|
+
"matcher": "*",
|
|
358
|
+
"hooks": [
|
|
359
|
+
{
|
|
360
|
+
"type": "command",
|
|
361
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/memory/capture-stop.js\"",
|
|
362
|
+
"async": true,
|
|
363
|
+
"timeout": 10
|
|
364
|
+
}
|
|
365
|
+
],
|
|
366
|
+
"description": "Kodelyth Memory: extract memory candidates from session and queue for review (never auto-stores)",
|
|
367
|
+
"id": "kodelyth:stop:memory-capture"
|
|
368
|
+
},
|
|
328
369
|
{
|
|
329
370
|
"matcher": "*",
|
|
330
371
|
"hooks": [
|