memory-persistence

memory-persistence is a skill for Claude Code from arturseo-geo/claude-code-skills. It costs 140 tokens per session (4,874 once invoked), scanned B, original, MIT.

A guide to giving Claude Code memory that survives after a session ends. It covers files and other storage patterns for keeping project facts, session summaries, and accumulated knowledge.

In plain words
What is it for?
Use it to save stable project instructions, resume unfinished work, record evolving knowledge, or build memory for multi-user agents.
Why use it?
It reduces the need to repeat project context when starting a new session, since Claude Code otherwise begins without the previous conversation.

Skill for Claude Code

Written for Claude Code: UserPromptSubmit hook event. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions subagents.

Good fit Use it to save stable project instructions, resume unfinished work, record evolving knowledge, or build memory for multi-user agents.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/arturseo-geo/claude-code-skills/memory-persistence
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 arturseo-geo/claude-code-skills --skill memory-persistence
Clone the repo
git clone --depth 1 https://github.com/arturseo-geo/claude-code-skills

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-persistence

README.md
[![agentmods](https://agentmods.dev/badge/skills/arturseo-geo/claude-code-skills/memory-persistence/github.svg)](https://agentmods.dev/skills/arturseo-geo/claude-code-skills/memory-persistence)
Your own site
<a href="https://agentmods.dev/skills/arturseo-geo/claude-code-skills/memory-persistence"><img src="https://agentmods.dev/badge/skills/arturseo-geo/claude-code-skills/memory-persistence/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-persistence

Your own site · 80×15
<a href="https://agentmods.dev/skills/arturseo-geo/claude-code-skills/memory-persistence"><img src="https://agentmods.dev/badge/skills/arturseo-geo/claude-code-skills/memory-persistence.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 140 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,874 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.00140 $0.04874
Opus 5 $0.00070 $0.02437
Sonnet 5 $0.00028 $0.00975
Haiku 4.5 $0.00014 $0.00487

Measured 9d ago against content hash 0c09dbebf517, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade B, and why

memory-persistence 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 9d 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

tail -20 .claude/memory.jsonl 2>/dev/null || true
skills/memory-persistence/SKILL.md · 583 lines

How it starts

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

Memory Persistence Skill

Memory Architecture Overview

Claude Code has no built-in cross-session memory — every new session starts blank. There are six patterns to solve this, ranging from simple to powerful:

Pattern Best for Complexity
CLAUDE.md injection Small, stable facts Low
Session summary files Resuming complex work Low
Append-only JSONL Evolving agent knowledge Medium
Graph-based memory Relationship-rich knowledge Medium
Hooks (stop/pre/post) Auto-saving and auto-loading Medium
MCP memory servers Production multi-user agents High

Pattern 1: CLAUDE.md Injection (Always-On Facts)

CLAUDE.md is Claude Code's built-in memory layer. It loads automatically at session start, making it the simplest persistence mechanism. There are three levels:

File Scope Loads when
~/.claude/CLAUDE.md All projects (global) Every session
CLAUDE.md (project root) This project only When in project dir
.claude/CLAUDE.md This project (hidden) When in project dir

All three merge at session start. Use the right level for each fact.

Example CLAUDE.md structure:

## Project Context
- Stack: Next.js 14, Supabase, Tailwind, Vercel
- Auth: Clerk (not NextAuth)
- Primary branch: main (never commit directly)
- Test command: pnpm test:unit
- Deployment: auto on push to main via Vercel

## Key Decisions
- We use Zod for all validation, not Yup
- All API routes live in /app/api, never /pages/api
- Error handling pattern: see /lib/errors.ts

CLAUDE.md Size Limits

Keep it under 150 lines — it loads every session, consuming tokens permanently. Move verbose details to reference files and @-import them only when needed.

Content type Put in CLAUDE.md? Alternative
Stack, tools, test commands Yes
Architectural decisions (< 10) Yes
Long reference tables No references/*.md + @-import
API docs No Separate file, load on demand
Session state No Session files (Pattern 2)

Read the full file on GitHub · 583 lines

Files

What ships with it

5 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. 9d ago First seen · 583 lines · 140 tokens per session scan B 0c09dbebf517

Subscribe to this mod's changes

memory-persistence is a skill published in the GitHub repository arturseo-geo/claude-code-skills (11 stars, last pushed 5mo ago), licensed MIT. It adds 140 tokens to every session and 4,874 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). 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

continuous-learning-v2

Instinct-based learning system that observes sessions via hooks, creates atomic instincts with confidence scoring, and evolves them into skills/commands/agents.

sangrokjung/claude-forge · 33 tokens

memory-hygiene

Keep agent-written memory files from rotting. Audits /.claude/projects/ /memory/ for facts the tree now contradicts — stale version pins, passed sequence facts, vanished paths — plus MEMORY.md index drift, and enforces the memory format contract at write time. Use when the user says "audit my memory", "memory is…

alexmond/alexmskills · 103 tokens

learn-on-failure

Save a learning to project memory. Invoke automatically (without the user asking) whenever a task required more than one fix cycle to resolve — e.g. a test failed and needed a second attempt, a compile error required a correction, an API behaved unexpectedly, or an assumption proved wrong mid-task. Also invoke when…

alexmond/alexmskills · 100 tokens

letter-hooker

Erweitert automation-self-care um Letter Hooks, Preflight-Bootloader, Dokument-Traversierungsregeln und selbstheilende Prompt-Kontext- Anreicherung für KI-Agenten und CLIs ohne native, ereignisgetriebene JSON-Lifecycle-Hooks (wie Antigravity / Gemini CLI). Nutzen, wenn ein Agent Preflight-Regeln injizieren, vor…

ellmos-ai/skills · 129 tokens

hive.note-taking

Maintain a free-form scratchpad of decisions, extracted values, and open questions so context pruning doesn't lose anything you still need.

aden-hive/hive · 30 tokens

security-compliance

Guides security professionals in implementing defense-in-depth security architectures, achieving compliance with industry frameworks (SOC2, ISO27001, GDPR, HIPAA), conducting threat modeling and risk assessments, managing security operations and incident response, and embedding security throughout the SDLC.

sangrokjung/claude-forge · 56 tokens