Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Kodelyth Memory

ASecurity

Local self-learning memory for AI coding sessions. Captures what works, recalls it next time, shapes context for prompt-cache savings. Zero dependencies, zero telemetry, model-agnostic.

11 stars
0 votes
0 copies
0 views
Added 10/5/2026
ai-agentstypescriptbashnodegitapidatabase

Works with

claude codecursorcliapi

Security Analysis

A100/100

Scanned 10/5/2026

$npx -y skills add sifxprime/kodelyth-ecc --skill kodelyth-memory --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Kodelyth Memory?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Kodelyth Memory
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/sifxprime-kodelyth-memory/badge)](https://www.skillsdirectory.com/skills/sifxprime-kodelyth-memory)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: kodelyth-memory
description: Local self-learning memory for AI coding sessions. Captures what works, recalls it next time, shapes context for prompt-cache savings. Zero dependencies, zero telemetry, model-agnostic.
---

# Kodelyth Memory — Skill

## When to use

- **At session start** when the task touches a domain the user has worked in before (auth, payments, database, deployment, API integration)
- **When the user says "that worked"** or signals success after struggle — capture the lesson
- **When the user asks "have I done this before?"** or seems to be repeating past work
- **When starting a new feature** in a project with existing memory

## How it works

```
┌─────────────────┐    capture    ┌─────────────────┐    inject    ┌─────────────────┐
│  Past session   │ ─────────────→│  ~/.kodelythecc/   │─────────────→│  Next session   │
│  (you solved X) │               │  memory/        │              │  (X comes up)   │
└─────────────────┘               └─────────────────┘              └─────────────────┘
                                          │
                                          │  BM25 keyword + tag retrieval
                                          │  No embeddings, no network
                                          ↓
                                  Cache-friendly context block
                                  (stable prefix → cheap re-reads)
```

## Storage layout

All under `~/.kodelythecc/memory/` (override with `KODELYTH_MEMORY_DIR`):

| File | Purpose |
|---|---|
| `memories.jsonl` | Append-only log — every captured memory |
| `index.json` | Inverted BM25 index for fast retrieval |
| `patterns.json` | User-level recurring patterns (auto-derived) |
| `projects/<hash>.json` | Per-project shortcut indexes |

## Why BM25 instead of embeddings

| Embeddings (OpenAI/local) | BM25 (what we use) |
|---|---|
| Semantic match — finds related ideas with no shared words | Keyword + tag match |
| Requires either network calls or 50MB+ local model | Pure JS, ~3KB |
| Adds 200-2000ms latency per query | Sub-millisecond |
| Cost per session | Free forever |
| Privacy: leaks query text to provider | Stays local |

For coding memory, the things you want to recall **almost always share vocabulary** with the trigger — file paths, library names, error strings, framework terms. BM25 nails this. We deliberately chose worse semantic match for vastly better latency, privacy, and cost.

## CLI cheatsheet

```bash
# Add a memory manually
node scripts/memory/cli.js remember "Stripe webhook signature failed in production" \
  --approach "Switched body parser from json to raw, validated with constructEvent" \
  --tags payments,stripe,webhooks \
  --language typescript

# Search
node scripts/memory/cli.js search "stripe webhook"

# Show what would be injected at session start
node scripts/memory/cli.js inject --query "add stripe payments"

# Extract memory candidates from a Claude Code session log
node scripts/memory/cli.js extract ~/.claude/projects/<project>/<session>.jsonl

# List all memories
node scripts/memory/cli.js list

# Storage stats
node scripts/memory/cli.js stats

# Forget one
node scripts/memory/cli.js forget <id>
```

## Slash command

In Claude Code:

```
/memory                          # Show stats and recent memories
/memory recall <query>           # Search and surface matches
/memory remember <title>         # Capture a new memory (interactive)
/memory forget <id>              # Delete one
/memory review-session           # Extract candidates from current session
```

## Cache-friendly injection

The injected context block is structured for prompt cache reuse:

```
[STABLE PREFIX — cached after first call, ~10% cost on subsequent calls]
  ## Your recurring patterns (built from N sessions)
  ## Recent solutions in this project
  ## Detected stack: typescript, next, postgres

[VARIABLE SUFFIX — varies per query]
  ## Relevant to your current task: "<query>"
```

For Anthropic models the cache TTL is 5 minutes — typing back-to-back during a coding session keeps the prefix warm. For OpenAI models the prefix is automatically cached when ≥1024 tokens. Other models (Gemini, Llama, Mistral) do not currently cache, so for them the benefit is purely the recall quality, not cost reduction.

## Honest limits

- **Not "the model learns"** — the model is unchanged. We're just feeding it better context.
- **Per-machine by default** — sync via Dropbox/iCloud/git on `~/.kodelythecc/memory/` if needed.
- **Cloud-AI platforms** (Windsurf, Antigravity, partial Cursor) — session data is server-side. Auto-extract from past sessions doesn't work there. Manual `/memory remember` still does.
- **Privacy** — every byte stays on your disk. Verify with `ls -la ~/.kodelythecc/memory/`.

## Anti-patterns

| Don't | Do |
|---|---|
| Auto-capture every conversation | Capture only when user signals success |
| Inject all memories on every session | Inject relevant + recent + patterns only |
| Capture without showing user the draft | Always confirm before storing |
| Recall the same memory twice in one session | Track surfaced memories per session |
| Treat memory as ground truth | Memory is a hint — current task may differ |

## Files in this skill

- `agents/kodelyth-memory.md` — the agent persona and protocols
- `scripts/memory/store.js` — storage + BM25 retrieval
- `scripts/memory/inject.js` — cache-friendly context block builder
- `scripts/memory/extract.js` — heuristic learning extractor for session logs
- `scripts/memory/cli.js` — command-line entry point
- `hooks/memory/capture-stop.js` — Stop hook that runs extractor on session end
- `hooks/memory/inject-start.js` — SessionStart hook that runs `inject`
- `commands/memory.md` — `/memory` slash command
- `rules/common/memory-protocol.md` — when AI should query memory mid-session

Attribution

sifxprimesifxprime
View sourceSee grades on GitHubMore from sifxprime →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Terse caveman voice: answer first, fluff gone, every technical fact kept. Use for /caveman, "caveman mode", "talk like caveman", "be brief", "less tokens". Stays on until "stop caveman" or "normal mode".

1100021 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

698621 votes

Writing Skills

Create and manage Claude Code skills in HASH repository following Anthropic best practices. Use when creating new skills, modifying skill-rules.json, understanding trigger patterns, working with hooks, debugging skill activation, or implementing progressive disclosure. Covers skill structure, YAML frontmatter, trigger types (keywords, intent patterns), UserPromptSubmit hook, and the 500-line rule. Includes validation and debugging with SKILL_DEBUG. Examples include rust-error-stack, cargo-dep...

3931 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3421 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Amp, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Grok Build, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

741 votes
View all in ai-agents →