Guide
Claude Code starts every session fresh. Here is what it keeps on its own, where those files live, and what to add when you need more.
Claude works inside a context window: your conversation, the files it read, command output, and its instructions. Each new session starts with a fresh context window, without the conversation history from earlier sessions. Source
Long sessions forget too. As the context fills up, Claude Code compacts the conversation into a summary on its own. The summary keeps your requests and key code, but detailed instructions from early in the conversation may be lost. Source
So anything you want Claude to know next time has to be written down somewhere it reads at the start.
~/.claude/CLAUDE.md./CLAUDE.md or ./.claude/CLAUDE.md./CLAUDE.local.md (add it to .gitignore)@path/to/file, for example @README. Imports help you organize, but the imported text still takes up context. Source~/.claude/projects/<project>/memory/, with a MEMORY.md index. The first 200 lines or 25KB of that index load in every session. Auto memory stays on that one computer. Source/compact and a focus, like /compact focus on the API changes. Source Sourceclaude --continue (or -c) reopens the most recent conversation in the current folder. claude --resume (or -r) opens a session by ID or name, or shows a picker. Name a session with claude -n "my-feature-work" to find it later. SourceStart there. Run /init to have Claude write a first CLAUDE.md for your project, keep it short, and add to it whenever you catch yourself explaining the same thing twice. Source
MCP (Model Context Protocol) lets Claude Code connect to outside tools. Source A memory server is one of those tools: Claude calls it to save a note, a decision or a to-do, and to read back what is already there. The notes live in the server's own store, so they outlast any session, and every app connected to the same server sees the same ones.
FlowState is one such server. It is free and open source, and keeps your project memory in one file on your computer. When an AI starts on a project it gets a short brief of where things stand, and as it works it logs decisions, changes, problems and to-dos, each marked with the AI that wrote it.
The easy way to set it up: paste this into Claude Code and let it follow FlowState's own instructions.
Set up FlowState for me from https://github.com/dialectforge/FlowState by following its AGENTS.md.
By hand, in a terminal (quit Claude Code first; on Windows type python for python3). The first setup line only shows what would change; the second makes the change and checks that FlowState answers.
git clone https://github.com/dialectforge/FlowState.git FlowState
cd FlowState
python3 setup_flowstate.py --clients claude-code --schedule-backups --no-offsite --install-skill --dry-run
python3 setup_flowstate.py --clients claude-code --schedule-backups --no-offsite --install-skill --verify
Or add it to Claude Code yourself with your own paths. --scope user makes it available in all your projects:
claude mcp add --transport stdio --scope user flowstate -e FLOWSTATE_DB=/path/to/flowstate.db -e PYTHONPATH=/path/to/FlowState/mcp-server -- /path/to/FlowState/.venv/bin/python -m flowstate
claude mcp list
Not sure about the paths or the format? The MCP config builder writes this command for you, and the same entry for Claude Desktop, Cursor and VS Code. Full steps are in the setup guide and FlowState's AGENTS.md.
FlowState is not the only option. Other open-source MCP memory servers exist, with different storage and features, and the same claude mcp add command works for any of them. Pick the one that fits how you work.
Claude Code on your computer can start FlowState locally, as above. That is free, and your data stays in one file on your computer.
Apps that cannot start programs on your computer, like ChatGPT and claude.ai in the browser, need a server they can reach by URL. FlowState Relay (in beta) gives your own computer a private address without setting up a tunnel, and your data stays on your computer. Hosted (in beta) keeps your memory on our server instead, for people who would rather not run it at home. Claude Code on another computer can then connect with:
claude mcp add --transport http flowstate https://<handle>.fsmcp.com/mcp --header "Authorization: Bearer $FLOWSTATE_TOKEN"
Keep the key in an environment variable, not in a file you share. Both plans are optional; see pricing.
FlowState is a free, open-source MCP memory server for Claude Code, Claude Desktop, Cursor, ChatGPT and Grok.