agent-memory
Skill by alirezarezvani
Agent Memory promotes facts through four tiers, and only after they recur across sessions and days. It is for Claude Code users whose agent keeps relearning the same correction or whose CLAUDE.md has become hard to read.
Install agent-memory
Built from the published package, never by AI.
git clone --depth 1 https://github.com/alirezarezvani/claude-skills /tmp/claude-skills && mkdir -p ~/.claude/skills && cp -r /tmp/claude-skills/engineering/agent-memory/skills/agent-memory ~/.claude/skills/agent-memoryRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/alirezarezvani/claude-skills /tmp/claude-skills && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/claude-skills/engineering/agent-memory/skills/agent-memory ~/.gemini/antigravity-cli/skills/agent-memoryAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
Agent Memory is a skill that replaces a single always-loaded CLAUDE.md with a four-tier promotion ladder. Facts start as raw transcripts (L0), become candidate atoms (L1), then project context (L2), and finally stable cross-project persona (L3). A claim moves up only when it recurs. Moving from L1 to L2 requires at least 3 distinct sessions spanning at least 2 calendar days. Moving from L2 to L3 requires use in at least 2 projects and an age of 30 days or more, with no contradiction.
The system is stdlib only, with no database, embeddings, network calls or LLM calls. Three hooks run the loop: SessionStart, UserPromptSubmit and SessionEnd. Promotions are staged for review, and a human runs an explicit adopt step before CLAUDE.md changes. It is intended for developers who want traceable, citable memory for their coding agent.
Written from the project's SKILL.md and checked against it.
What it can do
- Four-tier promotion ladderMoves facts from raw transcripts to candidate atoms, project context and cross-project persona based on recurrence.
- Recurrence gatesRequires distinct sessions and calendar days before a claim moves up, so one-off remarks do not get promoted.
- memory_inspect.py --whyShows where a remembered line came from, including sessions, days, transcript and quoted source.
- memory_inspect.py --tier and --contestedLists what is remembered at a tier, what blocks promotion, and every claim with an open contradiction.
- memory_promote.py dry runRuns the promotion pass in dry-run mode, which writes nothing.
- Session hooksSessionStart injects L2 and L3, UserPromptSubmit recalls relevant L1 atoms, and SessionEnd captures and stages.
- Redaction before writingPasses every atom through a filter before it reaches disk and quarantines altered claims from promotion.
- Staged promotions and adopt stepPlaces proposals in .memory/staged/ and changes CLAUDE.md only through an explicit adopt command that makes a backup.
What you need
- Python 3
- Claude Code with hooks support
Try asking
- Show me what is remembered at tier L1 and what blocks the next promotion.
- Explain where the remembered rule 'PR base branch is dev' came from.
- List every remembered claim that has an open contradiction.
Good to know
- Contested claims stay frozen at L1 until a human resolves the conflict.
- Claims altered by redaction never promote on evidence alone.
- Each hook can be disabled separately with an environment variable.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: engineering/agent-memory/skills/agent-memory/SKILL.md, engineering/agent-memory/skills/agent-memory/scripts/memory_core.py, engineering/agent-memory/skills/agent-memory/scripts/memory_extract.py, engineering/agent-memory/skills/agent-memory/scripts/memory_inspect.py, engineering/agent-memory/skills/agent-memory/scripts/memory_promote.py, engineering/agent-memory/skills/agent-memory/scripts/validate_examples.py. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md6 KB -
assets/memory_schema.json15 KB -
references/hook_capture_discipline.md7 KB -
references/promotion_gate_design.md7 KB -
references/tiered_memory_canon.md7 KB
Show all 10 files
-
scripts/memory_core.py15 KB -
scripts/memory_extract.py8 KB -
scripts/memory_inspect.py11 KB -
scripts/memory_promote.py10 KB -
scripts/validate_examples.py22 KB
Alternatives to agent-memory
All alternatives →Set up and diagnose a local agentmemory installation. It covers MCP connections, environment variables, ports, auth and feature flags, and is for users getting started or checking a connection.
Analyzes a Karpathy-pattern LLM wiki and builds an interactive knowledge graph with entities, implicit links and topic clusters. Built for people who maintain LLM-generated markdown wikis.
Saves and loads timestamped reports for AI assistants, with keyword routing for fast lookup. It also runs an Actionability Gate that checks report links before delivery. Intended for morning briefings, meeting digests and research reports.
Removes a personal fact, preference, relationship detail, topic or past event from Muse's active memory. It also stops existing copies and automations from bringing it back.
Git Context Controller (GCC) is a skill that stores agent memory as a versioned file system under .GCC/. It suits multi-step projects that need milestone tracking, branching and context recovery across sessions.
Guides an evidence-first reading of a book, article, PDF or document set. Built for readers who want claims, evidence and recall rather than a short summary.
Compare with agentmemory-config, understand-knowledge or reports
agent-memory: common questions
Does Agent Memory use an LLM or a database?
No. The source says it is stdlib only, with no database, no embeddings, no network and no LLM calls.
How many sessions does a fact need before it is promoted?
Moving from L1 to L2 needs at least 3 distinct sessions across at least 2 calendar days. A claim stated outright needs 2 sessions, and a verified claim can promote on one observation.
Can it edit CLAUDE.md on its own?
No. Promotions are staged in .memory/staged/, and only an explicit /cs-memory adopt command touches CLAUDE.md, after backing it up.
How do I install agent-memory?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is agent-memory free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is agent-memory safe to use?
It scores 91 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to agent-memory?
Similar skills: agentmemory-config, understand-knowledge, reports, forget.
