agentleFS
brianschroederbrianschroeder/simple-agent-memory/skills/agent-memory/SKILL.md

agent-memory

Skill1 starsChanged 2 months agoMITView on GitHub

Set up repo-level agent memory: create an `agent-memory.md` learnings log at the repository root and wire up `CLAUDE.md` so agents read it when stuck and append durable learnings as they work. Use this whenever the user wants to add, set up, bootstrap, install, enable, or repair "agent memory," a "learnings file," a persistent notes/gotchas log for agents, or wants to make Claude Code carry lessons across sessions within a repo — even if they don't say the word "skill." Also use it to re-apply the pattern to a new repo.

20 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use skill-authoring and pdf.

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.
  • Microsoft AzureSkill

    skill-authoring

    Write Agent Skills that comply with the agentskills.io specification. WHEN: "create a skill", "new skill", "write a skill", "skill template", "skill structure", "review skill", "skill PR", "skill compliance", "SKILL.md format", "skill frontmatter", "skill best practices". DO NOT USE FOR: general documentation. INVOKES: vally CLI.

    Also in 3 projects that use this

  • AnthropicSkill

    pdf

    Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms. When Claude needs to fill in a PDF form or programmatically process, generate, or analyze PDF documents at scale.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 18 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do this directly with your own file tools — read the bundled templates below, then create or edit the files in the target repo.

    line 31
  2. Very specific:

    If ./agent-memory.md already exists, leave it untouched.

    line 40
  3. Very specific:

    If it does not exist, create it with the exact contents of assets/agent-memory.template.md.

    line 42
  4. Very specific:

    Read ./CLAUDE.md (create it if it doesn't exist).

    line 46
  5. Very specific:

    If it already contains the marker <!-- agent-memory:start -->, leave it as-is so the block isn't duplicated.

    line 47
  6. Very specific:

    Different filename: if the user wants a different name (e.g.

    line 64

“Common” is measured: kept by at least 6 in 10 of the 18 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

Agent Memory (repo-level)

This skill installs a lightweight, git-tracked memory pattern into a repository so that learnings survive across fresh agent sessions. It sets up two things:

  1. agent-memory.md at the repo root — a curated, high-signal log of learnings that a cold-start agent would have wanted to know (setup quirks, non-obvious invocations, resolved root causes, dead ends, repo conventions).
  2. A block in CLAUDE.md instructing agents to read agent-memory.md at the start of non-trivial work and when stuck, and to append to it when they learn something durable — checking for and resolving duplicate or contradicting entries first, rather than stacking near-identical notes.

The division of labor matters: CLAUDE.md holds the always-loaded behavior (when to read and write), and agent-memory.md holds the accumulated content, read on demand.

Setting it up

Do this directly with your own file tools — read the bundled templates below, then create or edit the files in the target repo. No script is needed; you create the files yourself. Work at the repository root (the top of the project — confirm with git rev-parse --show-toplevel if git is available, otherwise use the project's top directory).

Both steps are deliberately non-destructive — check before you write:

  1. Create agent-memory.md at the repo root — only if it's missing.
    • If ./agent-memory.md already exists, leave it untouched. It holds accumulated learnings, and overwriting it would throw them away.
    • If it does not exist, create it with the exact contents of assets/agent-memory.template.md.
  2. Add the instruction block to CLAUDE.md — exactly once.
    • Read ./CLAUDE.md (create it if it doesn't exist).
    • If it already contains the marker <!-- agent-memory:start -->, leave it as-is so the block isn't duplicated.
    • Otherwise, append the full contents of assets/claude-md-block.md, preceded by a blank line if the file already has content.

Then report what changed (created the log? added the block? already present?) and remind the user to commit both files.

Manual example

For a fresh repo with no CLAUDE.md yet, the result is simply the two files at the root: agent-memory.md (a copy of the template) and CLAUDE.md (containing the marker-wrapped block). For a repo that already has a CLAUDE.md, the block is appended to the end of the existing file and nothing else is touched.

Customization notes

  • Different filename: if the user wants a different name (e.g. LEARNINGS.md), rename the created file and update the path references inside the CLAUDE.md block to match.
  • Monorepos / per-package memory: the pattern can be applied per subdirectory. A subdirectory CLAUDE.md loads on demand when an agent works in that directory, so a package-local agent-memory.md + a package-local CLAUDE.md block scopes memory to that package.
  • On-demand vs. always-loaded: the default wires the file for on-demand reading. Do not switch to an @agent-memory.md import unless the log is small and always relevant — imports load the whole file into context at every session start and grow the baseline cost as the log grows.
  • Relationship to Claude Code's native auto memory: native auto memory is per-user and lives outside the repo (not shared, not reviewed). This committed agent-memory.md is the shared, versioned, review-gated layer. They complement each other; this skill sets up the shared one.

Bundled resources

  • assets/agent-memory.template.md — the starter log, including the embedded rules for what/when to write and read, and the entry format. This is the substance of the pattern; copy it verbatim to create the log.
  • assets/claude-md-block.md — the marker-wrapped block to append to CLAUDE.md.

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.