maintaining-core-memory

maintaining-core-memory is a skill for Claude Code, Codex from letta-ai/letta-code. It costs 50 tokens per session (2,040 once invoked), scanned A, original, Apache-2.0.

A procedure for editing an agent's core memory, the part of its instructions that shapes behavior on every turn. It describes how these instructions are assembled from files.

In plain words
What is it for?
Use it to add, refine, merge, or replace core instructions and format the files that become the agent's system prompt.
Why use it?
It helps revise existing behavior rules cleanly instead of continually appending overlapping instructions.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents.

Good fit Use it to add, refine, merge, or replace core instructions and format the files that become the agent's system prompt.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/letta-ai/letta-code/maintaining-core-memory
About the project

letta-ai/letta-code is an agent harness for building assistants that retain memory, identity, and experience across interactions instead of treating each task as isolated. Developers use it through local, desktop, browser, or messaging interfaces for interactive or continuously running agents, and its catalogue entries configure the agents' skills, instructions, rules, and behavior.

letta-ai/letta-code · 3,935 stars · on GitHub · letta.com

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 letta-ai/letta-code --skill maintaining-core-memory
Clone the repo
git clone --depth 1 https://github.com/letta-ai/letta-code

Made for: Claude Code, Codex.

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 maintaining-core-memory

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/letta-ai/letta-code/maintaining-core-memory"><img src="https://agentmods.dev/badge/skills/letta-ai/letta-code/maintaining-core-memory.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 50 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,040 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00050 $0.02040
Opus 5.5 $0.00020 $0.00816
Sonnet 5.5 $0.00010 $0.00408
Haiku 4.5 $0.00005 $0.00204

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

Security

Grade A, and why

maintaining-core-memory 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 1mo 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.

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.

src/skills/builtin/maintaining-core-memory/SKILL.md · 123 lines

How it starts

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

Core memory is the agent's prompt, refined over its lifetime. Treat each change as a revision of that prompt, not an append to a log: the usual edit sharpens, merges, or replaces an existing principle, and a new one earns its place only when no existing one can absorb it.

Prompt format

The agent's system prompt is compiled from the Markdown files at the root of $MEMORY_DIR. Each root file except MEMORY.md becomes a block named after the file, in alphabetical order by filename, followed by the root MEMORY.md:

{{base system prompt}}

<human>
<description>{{description from human.md frontmatter}}</description>
{{body of human.md}}
</human>

<persona>
<description>{{description from persona.md frontmatter}}</description>
{{body of persona.md}}
</persona>

<memory>
{{body of root MEMORY.md}}
<deferred-memory>
<directory path="{{dir}}/" index="{{dir}}/MEMORY.md" />
</deferred-memory>
</memory>

Every root file except MEMORY.md starts with frontmatter containing exactly two fields:

---
name: human
description: Who the user is and how they want to work together.
---
  • The file name becomes the block name, so human.md renders as <human>. Choose short, stable names.
  • The description is rendered into the prompt. Write it for the agent: one line saying what the block holds.
  • Root MEMORY.md has no frontmatter. Its body is the only part of <memory> you write.
  • The <deferred-memory> list is generated: one entry per top-level directory that has its own MEMORY.md, showing only the path. skills/ is never listed; skills appear separately.
  • Edits take effect only after they are committed, and only in later system prompts. The current conversation keeps the prompt it started with.

Read $MEMORY_DIR/.memfs.config.json if it exists. The memory repository's pre-commit hook enforces it:

  • maxCoreMemoryCharacters caps the total size of all root Markdown (default 65,536 characters).
  • maxFileCharacters caps each memory file, frontmatter included (default 20,000 characters). fileCharacterLimits overrides it per glob; the first match wins and null removes the cap.
  • readOnlyFiles lists globs whose files cannot change. Do not edit them.

When the config file is absent, the defaults apply. Treat the limits as a ceiling, not a target: stay well below them. When an edit does not fit, move detail into deferred memory instead of raising a limit; change the config only when the user asks.

Read the full file on GitHub · 123 lines

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. 1mo ago Changed · +21 lines b4eb36f7a78b
  2. 1mo ago First seen · 102 lines · 50 tokens per session scan A 19b2857e9fe2

Subscribe to this mod's changes

maintaining-core-memory is a skill published in the GitHub repository letta-ai/letta-code (3,935 stars, last pushed today), licensed Apache-2.0. It adds 50 tokens to every session and 2,040 once invoked, about $0.0002 per session on Opus 5.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-10-20.

Related

maintaining-core-memory compared with skills from other repositories

maintaining-core-memory next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
maintaining-core-memoryletta-ai/letta-codeSkill3.9ktodayApache-2.0A50Claude Code, Codex
memory-systembojieli/ai-agent-bookSkill60kyesterdayApache-2.0A95Claude Code, Codex
memory-recallzilliztech/memsearchSkill3.0k3d agoMITA152Claude Code
memanto-companionmoorcheh-ai/memantoSkill2.4k2d agoApache-2.0A72Claude Code
openloreaakarim/OpenLoreSkill2.0k8d agoApache-2.0A42Claude Code, Codex
mnemonmnemon-dev/mnemonSkill7527d agoApache-2.0A25Claude Code, Codex
mnemonmnemon-dev/mnemonSkill7527d agoApache-2.0A30Claude Code, Codex