agentleFS
LeostrukaLeostruka/devin-bundle/skills/memory-management/SKILL.md

memory-management

Skill0 starsChanged 4 months agoMITView on GitHub

Use when deciding whether to persist knowledge in cross-session agent memory (MEMORY.md, auto-memory), when auto-memory seems stale or preferences leak across tasks, or capturing session outputs worth remembering (answered questions, business rules, conventions, failed approaches). Scope: memory hygiene only — improving skills/rules/hooks belongs to `self-improvement`.

27 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use agent-agent, agent-analyze-code-quality and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 26 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When the session produces knowledge worth keeping — answered questions, business rules, project conventions, failed approaches, reusable …

    line 36
  2. Very specific:

    After a feature/fix lands and before clear/compact: capture intent (why), state (what + deviations), lessons (worked/failed) — then ask …

    line 71

“Common” is measured: kept by at least 6 in 10 of the 26 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Memory Management

Cross-session memory is a contract with the user, not a black box. Naive accumulation degrades reliability; managed memory helps. Default: explicit user-authored preferences (.devin/global_rules.md, skills, repo docs), not auto-saved memory.

Stateless vs managed vs naive

ModeWhenEvidence
StatelessDefault for coding agents. Preferences live in rules/skills/docs the user controls.Most predictable; no drift or contamination.
Managed memory (selective add+delete)Long-horizon tasks where recalling past executions genuinely helps. User reviews and prunes.+10% absolute vs naive (arXiv:2505.16067); MemGPT (arXiv:2310.08560).
Naive auto-memory (append-only)Never.16-20pp reliability loss (arXiv:2605.07313); temporal contamination (arXiv:2605.17830); reasoning drift (arXiv:2607.02374).

Hygiene rules

  1. Prefer explicit — user-authored preferences over agent-auto-saved memory.
  2. Never naive growth — managed memory must have selective add AND delete.
  3. Audit periodically — review auto-memory for stale/large/drifting entries; prune aggressively.
  4. Isolate preferences by task — global injection of all preferences into every session causes contamination.
  5. Don't trust auto-inferred preferences — preference following is <10% at 10 turns zero-shot (arXiv:2502.09597). Write them down.
  6. Memory is a contract — user must be able to view, modify, delete anything saved (arXiv:2404.15269).

Anti-patterns: append-only MEMORY.md; auto-saving every preference; "delete all memory" (managed memory helps); opaque memory.

Capturing project memory

When the session produces knowledge worth keeping — answered questions, business rules, project conventions, failed approaches, reusable solutions, decisions:

  1. Notice — spot something future sessions will need.
  2. Propose — ask_user_question showing the note text and path. Wait for approval.
  3. Write — on approval, save a Markdown note under .devin/memory/.
  4. Link — update .devin/memory/MOC.md and the daily logbook entry.
  5. Retrieve — python scripts/query-memory.py "<query>" (in this skill's scripts/) or /research scoped to .devin/memory/.

Paths

WhatPathPattern
Answered question / business rule.devin/memory/notes/YYYY/MM/<topic>.md
Daily session log.devin/memory/logbook/YYYY/MM/YYYY-MM-DD.md
Decisions / ADRs.devin/memory/decisions/ADR-NNN-<slug>.md
Index.devin/memory/MOC.mdMOC.md

Note format: see templates/note.md. Required frontmatter: title, date, session, category, tags, status, cues: (path/symbol/keyword triggers).

Capture rules

  1. No capture without approval — always confirm via ask_user_question.
  2. Plain text — Markdown + frontmatter + grep; no vector DB.
  3. One fact per note; cite sources (source: path:line or session:).
  4. Write cues, not just facts — cues: tells future agents when to recall.
  5. Prune stale notes on each capture (status: archived or delete).
  6. No secrets in notes (Rules 19, 24).

Post-implementation capture

After a feature/fix lands and before clear/compact: capture intent (why), state (what + deviations), lessons (worked/failed) — then ask approval.

Evidence

ClaimSource
Naive growth −16-20pp reliabilityarXiv:2605.07313
Contamination rises with exposurearXiv:2605.17830
Selective add+delete +10% vs naivearXiv:2505.16067
Reasoning drift despite fluent answersarXiv:2607.02374
Preference following <10% @10 turnsarXiv:2502.09597
Managed memory > fixed contextarXiv:2310.08560 (MemGPT), arXiv:2410.10813
Excessive retrieval harms agentic tasksarXiv:2608.15008

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.