CLAUDE.md and AGENTS.md vs a memory server: which one you need

Last updated

Use CLAUDE.md or AGENTS.md for a short set of rules that every session should follow, such as build commands, style and project layout. Use a memory server for what grows over time: decisions, facts and preferences that the agent should look up when they matter rather than read in full every session. Many projects need both, and a small project with one person and one agent is often fine with files alone.

What instruction files do well

CLAUDE.md (read by Claude Code) and AGENTS.md (read by Codex, and by Claude Code when a project has no CLAUDE.md) are plain Markdown files in your repository.

For rules that apply to almost every task, this is the right place.

Where files get hard to use

Claude Code's auto memory solves some of this for one person: the agent writes its own notes. Those notes stay on one computer and are not shared with other computers or other agents.

What a memory server does differently

A memory server stores notes as separate memories behind a search, and agents reach it through MCP tools.

The costs are real too: it needs an account and a sign-in, the agent has to decide to search (a session-start step helps), and you trust a service with what you save.

When files are enough

When a memory server helps

Use both

A common setup: keep CLAUDE.md or AGENTS.md short, with the rules every session needs, and add one line telling the agent to search memory before it changes anything important. For Memlo, that line is to call get_prime_directive at the start of each session, which loads how to use Memlo and your space's key memories. Setup for each agent: Claude Code, Codex, other MCP apps.

Frequently asked questions

Is a memory server a replacement for CLAUDE.md?

Not entirely. CLAUDE.md is the right place for rules that apply to every session. A memory server is better for the growing set of decisions and facts that only some tasks need.

How long should CLAUDE.md be?

Claude Code's documentation suggests under 200 lines per CLAUDE.md file. It also notes that imported files load together with the file that imports them, so splitting a file with imports does not reduce its context cost.

Does Claude Code read AGENTS.md?

Yes, from Claude Code version 2.1.277: when a project has an AGENTS.md and no CLAUDE.md in the working folder or above it, Claude Code reads the AGENTS.md. A CLAUDE.md can also import AGENTS.md so both tools share one file.

Can I keep my memories in git instead?

You can keep notes in Markdown files in git, and many people do. You get review and history, but the agent still has to find the right file by reading, and agents outside the repository can't see it.

Try Memlo

Memlo is invitation only for now. Join the waitlist and we'll email you when your invitation is ready.

Join the waitlist