Always run claude from the project directory
The current working directory is the project identity. Claude Code keys every bit of persistence - memory, AGENTS.md, session history - to the cwd it was started from.
cd ~/code/myproject
claude
That's the whole mechanism. Same project dir = same memory, automatically.
Optional ergonomic tip: add -n myproject to label the session. It shows up in the /resume picker and your terminal title - handy for finding sessions later, but it doesn't affect memory.