memory-manager

A memory-maintenance workflow for recording lessons and decisions made during coding-agent tasks.

In plain words
What is it for?
Use it to reflect on completed work, search stored memories, consolidate recurring lessons, and archive working context.
Why use it?
It preserves useful information after major tasks or failures and makes earlier decisions easier to find later.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/codejunkie99/agentic-stack/memory-manager
Any agent
npx skills add codejunkie99/agentic-stack --skill memory-manager
Clone the repo
git clone --depth 1 https://github.com/codejunkie99/agentic-stack

Made for: Claude Code, Codex.

Per session 2 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 533 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00002 $0.00533
Opus 5 $0.00001 $0.00267
Sonnet 5 $0.00000 $0.00107
Haiku 4.5 $0.00000 $0.00053

Measured yesterday against content hash 966dddfc88a6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

memory-manager scanned grade A with 0 findings 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 yesterday.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agent/skills/memory-manager/SKILL.md · 51 lines

What it actually says

Memory Manager — the skill that reads the filing cabinet

After every major task or failure, call tools/memory_reflect.py to log what happened. Before important decisions, read the top entries from memory/semantic/LESSONS.md and memory/semantic/DECISIONS.md.

When to trigger full consolidation

  • On explicit reflect trigger from the user.
  • When the context window is getting full.
  • When episodic memory exceeds ~500 entries.

Consolidation steps

  1. Load top-5 episodic entries by salience score.
  2. Detect recurring patterns across the last 100 entries.
  3. For patterns appearing ≥3 times, promote to memory/semantic/LESSONS.md.
  4. Flag any skill with ≥3 failures in 14 days for rewrite (see on_failure.py).
  5. Archive resolved working context to memory/episodic/snapshots/.
  6. Commit via git so history is preserved: git log memory/ is the agent's autobiography.

Searching memory by keyword

When you need to find a specific memory by topic or keyword (not just the top-salience entries), use the FTS5 search tool:

python3 .agent/memory/memory_search.py <query>

This indexes all .md and .jsonl files under .agent/memory/ and returns ranked results with context snippets. Falls back to grep if FTS5 is not available. The index auto-rebuilds when files change.

Anti-patterns

  • Do not auto-merge personal/ into semantic/ — user preferences are not general knowledge.
  • Do not delete entries to "clean up" memory. Archive them.
  • Do not promote lessons from a single incident. Require recurrence.

Self-rewrite hook

Every 10 reflections, or when the same type of mistake appears 3+ times recently, this skill's approach to salience or distillation needs adjustment. Propose conservative edits and log the diff in memory/semantic/DECISIONS.md.

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. yesterday First seen · 51 lines · 2 tokens per session scan A 966dddfc88a6

Subscribe to this mod's changes

memory-manager is a skill published in the GitHub repository codejunkie99/agentic-stack (2,241 stars, last pushed 25d ago), licensed Apache-2.0. It adds 2 tokens to every session and 533 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

article-writing

Write articles, guides, blog posts, tutorials, newsletter issues, and other long-form content in a distinctive voice derived from supplied examples or brand guidance. Use when the user wants polished written content longer than a paragraph, especially when voice consistency, structure, and credibility matter.

affaan-m/ECC · 57 tokens

a-evolve

Apply A-Evolve's agentic evolution methodology to improve AI agent performance across runs. Use when the user wants to diagnose agent failures, generate targeted skills from error patterns, evolve system prompts, or accumulate episodic knowledge. Works standalone or inside AutoResearchClaw pipelines. Triggers on…

aiming-lab/AutoResearchClaw · 100 tokens

hive.chart-creation-foundations

Required reading whenever any chart tool is available. Teaches the one-tool embedding contract (call chartrender → live chart appears in chat AND a downloadable PNG lands in the queen session dir), the ECharts (data viz) vs Mermaid (structural diagrams) decision, the BI/financial-grade aesthetic baseline (no…

aden-hive/hive · 133 tokens

📝 任务完成后归档

重要提醒: 每次完成复杂调试或开发任务后,主动执行此流程! 将学到的经验归档为 skill,供以后参考。不要等用户提醒。.

Project-N-E-K-O/N.E.K.O · 49 tokens

deck-course-module

暖纸背景 + Playfair, 左侧学习目标常驻, 含 MCQ 自测页.

nexu-io/html-anything · 25 tokens

code-documenter

Use when adding docstrings, creating API documentation, or building documentation sites. Invoke for OpenAPI/Swagger specs, JSDoc, doc portals, tutorials, user guides.

zebbern/claude-code-guide · 39 tokens