memory-engine

memory-engine is a skill for Claude Code from HelloRuru/claude-memory-engine. It costs 55 tokens per session (1,891 once invoked), scanned B, original, MIT.

A memory system for Claude Code that stores project context, session notes, learned mistakes, and handoff information in Markdown files. Hooks are automatic actions triggered by events such as a session starting or ending.

In plain words
What is it for?
It is for loading project memory, saving work and decisions, detecting repeated pitfalls, reflecting on sessions, handing work to a later session, and checking memory-related status.
Why use it?
It reduces the need to repeat project context and records corrections or recurring problems for later sessions.

Skill for Claude Code

Written for Claude Code: SessionStart hook event. Also seen: reads .claude/ paths; mentions Claude Code.

Good fit It is for loading project memory, saving work and decisions, detecting repeated pitfalls, reflecting on sessions, handing work to a later session, and checking memory-related status.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/helloruru/claude-memory-engine/skill
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add HelloRuru/claude-memory-engine --skill skill
Clone the repo
git clone --depth 1 https://github.com/HelloRuru/claude-memory-engine

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for memory-engine

README.md
[![agentmods](https://agentmods.dev/badge/skills/helloruru/claude-memory-engine/skill/github.svg)](https://agentmods.dev/skills/helloruru/claude-memory-engine/skill)
Your own site
<a href="https://agentmods.dev/skills/helloruru/claude-memory-engine/skill"><img src="https://agentmods.dev/badge/skills/helloruru/claude-memory-engine/skill/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for memory-engine

Your own site · 80×15
<a href="https://agentmods.dev/skills/helloruru/claude-memory-engine/skill"><img src="https://agentmods.dev/badge/skills/helloruru/claude-memory-engine/skill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 55 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,891 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00055 $0.01891
Opus 5.5 $0.00022 $0.00756
Sonnet 5.5 $0.00011 $0.00378
Haiku 4.5 $0.00006 $0.00189

Measured 3mo ago against content hash 60c81523347b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

memory-engine scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Unrestricted tool accessmediumExcessive agency

A wildcard tool grant or "run any command" leaves no least-privilege boundary at all.

You don't need to remember to run any command before closing.
skill/SKILL.md · 172 lines

How it starts

The opening of the file, as written. The whole thing — 172 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Memory Engine v1.6

A memory and learning system for Claude Code, built with hooks and markdown.

Modules

1. Smart Context

Auto-detects the current project from your working directory and loads its memory.

  • Resolves per-project memory directory automatically — no hardcoded paths
  • Implementation: ~/.claude/scripts/hooks/session-start.js
  • Config: references/smart-context.md

2. Auto Learn (Pitfall Detection)

Detects pitfall patterns before context compression — retries, errors followed by fixes, user corrections.

  • Saves both the problem and the fix to ~/.claude/skills/learned/
  • Same mistake 3+ times across different days → suggests writing it into permanent rules
  • Implementation: shared-utils.js → detectPitfalls() + savePitfalls()

3. Student Loop (/reflect)

8-step learning cycle. First 3 steps are automatic (every session). Last 5 via /reflect.

  1. Takes notes — records what was done, files changed, decisions made
  2. Links them — tags the project, connects to previous notes
  3. Spots patterns — scans for pitfall signals

There is no real "end" to a Claude Code conversation. Memory Engine saves at three points:

  • Every 20 messages (mid-session-checkpoint) — most reliable, self-counted
  • Before context compression (pre-compact) — pitfall detection runs here, context is fullest
  • When conversation ends (session-end) — best-effort, not guaranteed to fire

You don't need to remember to run any command before closing. 4. Review — read past 7 days, mark useful vs outdated 5. Refine — 4-question decision tree (Keep? Condense? Already covered? Delete as last resort) 6. Re-study — re-analyze cleaned data for buried patterns 7. Slim down — list removable items, wait for user confirmation 8. Wrap up — produce a report

4. Session Handoff (/handoff)

Pass context between Claude Code windows without losing progress.

  • /handoff saves a handoff-*.md file with progress, decisions, unfinished tasks
  • Next session auto-detects it on startup (session-start.js)
  • Mid-conversation detection via memory-sync.js
  • Each handoff is shown once, tracked by .handoff-read.json

Read the full file on GitHub · 172 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3mo ago First seen · 172 lines · 55 tokens per session scan B 60c81523347b

Subscribe to this mod's changes

memory-engine is a skill published in the GitHub repository HelloRuru/claude-memory-engine (133 stars, last pushed 6mo ago), licensed MIT. It adds 55 tokens to every session and 1,891 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it B with 1 finding (unrestricted tool access). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

memory-engine compared with skills from other repositories

memory-engine next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
memory-engineHelloRuru/claude-memory-engineSkill1336mo agoMITB55Claude Code
adr-ops0xDarkMatter/claude-modsSkill867d agoMITA62Claude Code
hive-mind-advancedfrankxai/claude-skills-librarySkill51todayMITA47Claude Code
creator-productivityfrankxai/claude-skills-librarySkill51todayMITA62Claude Code
memory-prunefrankxai/claude-skills-librarySkill51todayMITA67Claude Code
nav-compactqf-studio/navigatorSkill35815d agoMITB38Claude Code
Vizra ADK Memory Systemvizra-ai/vizra-adkSkill2951mo agoMITA24Claude Code, Codex