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.
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.
npx skills add letta-ai/letta-code --skill maintaining-core-memorygit clone --depth 1 https://github.com/letta-ai/letta-codeWrote 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.
[](https://agentmods.dev/skills/letta-ai/letta-code/maintaining-core-memory)<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.
<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>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.
| Model | Per session | Once 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 |
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.
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.mdrenders as<human>. Choose short, stable names. - The
descriptionis rendered into the prompt. Write it for the agent: one line saying what the block holds. - Root
MEMORY.mdhas 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 ownMEMORY.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:
maxCoreMemoryCharacterscaps the total size of all root Markdown (default 65,536 characters).maxFileCharacterscaps each memory file, frontmatter included (default 20,000 characters).fileCharacterLimitsoverrides it per glob; the first match wins andnullremoves the cap.readOnlyFileslists 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.
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.
- 1mo ago Changed · +21 lines b4eb36f7a78b
- 1mo ago First seen · 102 lines · 50 tokens per session scan A 19b2857e9fe2
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.
maintaining-core-memory compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| maintaining-core-memoryletta-ai/letta-code | Skill | 3.9k | today | Apache-2.0 | A | 50 | Claude Code, Codex |
| memory-systembojieli/ai-agent-book | Skill | 60k | yesterday | Apache-2.0 | A | 95 | Claude Code, Codex |
| memory-recallzilliztech/memsearch | Skill | 3.0k | 3d ago | MIT | A | 152 | Claude Code |
| memanto-companionmoorcheh-ai/memanto | Skill | 2.4k | 2d ago | Apache-2.0 | A | 72 | Claude Code |
| openloreaakarim/OpenLore | Skill | 2.0k | 8d ago | Apache-2.0 | A | 42 | Claude Code, Codex |
| mnemonmnemon-dev/mnemon | Skill | 752 | 7d ago | Apache-2.0 | A | 25 | Claude Code, Codex |
| mnemonmnemon-dev/mnemon | Skill | 752 | 7d ago | Apache-2.0 | A | 30 | Claude Code, Codex |