memory-doctor

memory-doctor is a skill for Claude Code, Codex from eai-org/agent-toolkit. It costs 55 tokens per session (1,725 once invoked), scanned A, original, MIT.

A review of the current project's saved instructions and notes for coding agents, with each item assigned to a user-controlled document, rule, skill, or archive.

In plain words
What is it for?
Auditing memory block by block, proposing where entries should move or whether they should be archived, and waiting for approval before changes.
Why use it?
Uncontrolled memory can quietly affect future sessions. The review makes those stored notes visible and lets the user decide where each one belongs.

Skill for Claude CodeCodex

Part of the agent-toolkit plugin — 22 skills shipped together

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/eai-org/agent-toolkit/memory-doctor
Any agent
npx skills add eai-org/agent-toolkit --skill memory-doctor
Clone the repo
git clone --depth 1 https://github.com/eai-org/agent-toolkit

Made for: Claude Code, Codex.

Or install agent-toolkit, the plugin that ships this one along with the rest of its 22 skills.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/eai-org/agent-toolkit/memory-doctor.svg)](https://agentmods.dev/skills/eai-org/agent-toolkit/memory-doctor)
Your own site
<a href="https://agentmods.dev/skills/eai-org/agent-toolkit/memory-doctor"><img src="https://agentmods.dev/badge/skills/eai-org/agent-toolkit/memory-doctor.svg" alt="Measured on agentmods" height="20"></a>
Per session 55 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,725 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.00055 $0.01725
Opus 5 $0.00028 $0.00863
Sonnet 5 $0.00011 $0.00345
Haiku 4.5 $0.00006 $0.00172

Measured 4d ago against content hash d756f3d600bd, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

memory-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 4d 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.

skills/memory-doctor/SKILL.md · 116 lines

How it starts

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

Memory doctor

Agent-memory is an unseen side-channel into every session's context window: facts accumulate there, often by accident, that the user never reviews and cannot govern. This skill drains it. Technically nothing should live in project memory — durable guidance belongs in homes the user controls (project docs, project skills/rules, user-level skills/rules), and the rest is garbage. Block by block, move each entry to its proper home or archive it, until memory trends toward empty and the user — not the memory store — decides what reaches the context window.

Golden rule

The skill guesses and recommends; the user decides. Every verdict, scope, form, and target is a proposal the user confirms or flips. When unsure, ask. Nothing is moved, deleted, or written without explicit per-item approval. For every block the user gets the whole fixed menu — relocate/merge, archive (delete), keep, or a custom action they type — never just the recommended verdict, never a pruned subset.

Locate the memory

Find the memory store for the current project. Its location is agent-specific — other agents store it elsewhere, or not at all. Claude Code example: slugify the project's absolute working-directory path by replacing each / with - and prefixing one -, then look for ~/.claude/projects/<slug>/memory/MEMORY.md (e.g. cwd /Users/me/app-Users-me-app). If that path is absent, or the user runs a different agent, ask the user for the memory path. Only discovery is agent-specific; everything below is agent-agnostic.

Block = the smallest self-contained memory unit — typically one memory file plus its MEMORY.md index line, generally one fact each, though a store may group differently. If the memory is a single flat file with no index, treat each section as a block.

Flow

  1. Scan (read-only). Read every block. To judge staleness you may read or grep project files, git, and governing docs — but make no mutation in this phase.
  2. Triage table. Present all blocks as ONE narrow overview table that renders as a table, not a wrapped list: # | block | content (≤1 line) | verdict | why + target. Every cell is a summary: the content cell one line, the why + target cell folding justification, duplicate/garbage evidence, and relocate scope/form/path. Full detail for a block waits for its question (step 3). The table numbers each block (1…N); refer to a block by that number, in order, and never re-list block numbers out of sequence in surrounding prose. The table ends the turn; step 3 begins the next — a same-turn question buries the table behind the prompt.
  3. Decide, one question per block, in strict index order (1 → last). Walk blocks by their table index — never group, batch, or reorder blocks, even when adjacent ones share a verdict; ask about exactly one block per prompt. For each, lead with the detail the table only summarized — a verbatim content excerpt plus the full justification — so the user can judge, then present its recommended verdict as the default, then the same fixed menu every time regardless of that verdict — relocate/merge, archive (delete), keep, or other (the user types a custom action). Never drop an option because it seems not to apply; the user must never have to type a standard option by hand. Record each confirmed choice and move straight to the next block — act on nothing yet; never skip a block or record a choice without its own explicit confirmation.
  4. Execute, once every block is decided. Apply the recorded actions in index order, honoring the Safety rules below (relocate-before-delete, honest index). Doing all the work in one pass — never interleaved with the questions — keeps the decision phase a fast, uninterrupted Q&A.

Read the full file on GitHub · 116 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. 4d ago First seen · 116 lines · 55 tokens per session scan A d756f3d600bd

Subscribe to this mod's changes

memory-doctor is a skill published in the GitHub repository eai-org/agent-toolkit (43 stars, last pushed today), licensed MIT. It adds 55 tokens to every session and 1,725 once invoked, about $0.0003 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.