Claude Code has two kinds of memory: CLAUDE.md files that you write, and auto memory that Claude writes for itself. Both are for short instructions and facts. For larger knowledge such as specs, papers and past decisions, keep the documents as they are and let Claude search them.
What Claude Code has built in
| CLAUDE.md | Auto memory | |
|---|---|---|
| Written by | You | Claude |
| Stored in | Project folder, ~/.claude/CLAUDE.md, or a managed location | ~/.claude/projects/<project>/memory/ |
| Loaded | In full at launch; files in subfolders when needed | First 200 lines or 25 KB of MEMORY.md; other files when needed |
| Suggested size | Under 200 lines | Kept short by Claude |
| Shared with your team | Yes, if committed | No, it stays on one machine |
Source: Claude Code memory documentation. Run /memory to see or switch these, and /context all to see what is loaded.
Where it stops
Everything in CLAUDE.md uses context in every session. A 2,000-line file costs tokens on each request and makes instructions easier to miss. Auto memory holds what came up in your sessions, so a design document you never opened with Claude is not in it.
Add long-term memory from your own documents
The idea is simple: leave knowledge in files and let Claude look things up.
- Install Linkly AI and add the folders with your notes, specs and papers.
- Connect it to Claude Code:
claude mcp add --transport http linkly-ai "http://127.0.0.1:60606/mcp?client=claude-code"
- Add one line to CLAUDE.md so Claude knows when to use it:
Before design decisions, search linkly-ai for earlier notes and specs on the topic.
Claude can now search, look at an outline and read only the lines it needs. It can also save a note with note_save, which is a plain Markdown file that other agents can find too.
Which memory for what
| What you want remembered | Where to put it |
|---|---|
| Build commands, code style, rules | CLAUDE.md |
| Preferences and corrections | Auto memory |
| Specs, research, meeting notes, books | Documents that Claude searches |
| Decisions shared by several agents | Notes in a searched folder |
The setup steps for other clients are in the integration guide.
