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 context-doctorgit 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/context-doctor)<a href="https://agentmods.dev/skills/letta-ai/letta-code/context-doctor"><img src="https://agentmods.dev/badge/skills/letta-ai/letta-code/context-doctor.svg" alt="Measured on agentmods" height="20"></a>- NVIDIA SkillSpector warn
SkillSpector: 1 finding, up to medium
These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →
- medium Excessive Agency · line 136 Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
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.00030 | $0.01917 |
| Opus 5 | $0.00015 | $0.00958 |
| Sonnet 5 | $0.00006 | $0.00383 |
| Haiku 4.5 | $0.00003 | $0.00192 |
Grade A, and why
Context Doctor 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 8d 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 — 137 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Context Doctor
Your context is what makes you you across sessions. You are responsible for managing it (along with memory subagents). It includes:
- Your system prompt and memories (contained in
system/) - Your external memory (contained in the memory filesystem)
- Your skills (procedural memory)
Over time, context can degrade — bloat and poor prompt quality erode your ability to remember the right things and follow instructions properly. This skill helps you identify issues with your context and repair them collaboratively with the user.
IMPORTANT: Your edits of your system instructions should be conservative. Do NOT make assuptions about what parts of the system prompt are critical. The system prompt defines who you are, so significant modifications to its structure can have unintended consequences. Focus on making minimal changes to meet the token budget, and to effectively link out to external memory.
Operating Procedure
Step 1: Identify and resolve context issues
Explore your memory files to identify issues. Consider what is confusing about your own prompts and context, and resolve the issues.
Below are additional common issues with context and how they can be resolved:
System prompt bloat
Memories compiled into the system prompt (contained in system/) should take up about 10% of the total context size (usually ~15-20K tokens). This is a soft target, not a hard requirement.
Use the built-in CLI to evaluate token usage of the system prompt:
letta memory tokens --format json --quiet
The command reports total_tokens and per-file estimates for system/. It is only a measurement tool; decide whether to intervene based on the actual context and the guidance below.
Why detail is load-bearing (read this before cutting anything): In-context detail does more than carry information. It does at least four things, and byte-counting sweeps only see the first:
- Information — the literal facts stated
- Attention anchoring — makes certain topics feel important to the model when it's reasoning
- Semantic priming — raises the prior on codebase-specific patterns ("this codebase has weird X, don't assume defaults")
- Reasoning templates — past examples become heuristics for new bugs; rationale in "why" prose becomes scaffolding
What ships with it
1 file 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.
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.
- 8d ago First seen · 137 lines · 30 tokens per session scan A b44fed529543
Context Doctor is a skill published in the GitHub repository letta-ai/letta-code (3,225 stars, last pushed today), licensed Apache-2.0. It adds 30 tokens to every session and 1,917 once invoked, about $0.0002 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.
Other skills, from other repositories
memanto-companion
Inspect and manage the cross-session engineering memory that Memanto maintains for your Claude Code skills. Use when the user asks what Memanto remembers, wants to see their engineering profile, manually recall context for a skill, or store a decision. The automatic lifecycle hooks handle capture/injection on their…
system-monitor
Monitor system health: CPU, memory, disk, processes, and network. Alert on thresholds via any channel.
mnemon
Persistent memory CLI for LLM agents. Store facts, recall past knowledge, link related memories, manage lifecycle.
init
Install or update OwnMem in the current repository. Use when the user asks to set up OwnMem, add local project memory for coding agents, or refresh an existing OwnMem installation after a version bump.
prolong
Recover and use durable coding-session history from PRO-LONG's local append-only log. Use on long-running coding tasks, after context compaction or session resume, when reconstructing prior decisions or tool results, or before repeating work that may already have been attempted.
company-brain
How an agent should operate as one mind inside a shared Company Brain built on Caura — recall before acting, obey fleet keystones, reuse and publish skills, and report outcomes so every task compounds across the whole organization. Use this whenever you work as part of a Caura-connected team or fleet and your work…