Linkly AILinkly AI
Back to blog

Claude Code Memory: What It Remembers, and How to Give It More

·Linkly AI·

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.mdAuto memory
Written byYouClaude
Stored inProject folder, ~/.claude/CLAUDE.md, or a managed location~/.claude/projects/<project>/memory/
LoadedIn full at launch; files in subfolders when neededFirst 200 lines or 25 KB of MEMORY.md; other files when needed
Suggested sizeUnder 200 linesKept short by Claude
Shared with your teamYes, if committedNo, 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.

  1. Install Linkly AI and add the folders with your notes, specs and papers.
  2. Connect it to Claude Code:
claude mcp add --transport http linkly-ai "http://127.0.0.1:60606/mcp?client=claude-code"
  1. 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 rememberedWhere to put it
Build commands, code style, rulesCLAUDE.md
Preferences and correctionsAuto memory
Specs, research, meeting notes, booksDocuments that Claude searches
Decisions shared by several agentsNotes in a searched folder

The setup steps for other clients are in the integration guide.