Sessions, Memory & Gotchas
Resume conversations, understand memory files, and avoid the path rename trap
Resuming sessions
Claude Code remembers previous conversations. Pick up where you left off:
# Resume the last conversation claude --resume # Continue without a prompt (just re-enters the session) claude --continue
Use --resume when you want to add to an existing task. Start a new session for unrelated work (saves tokens).
Memory files
Claude reads these files automatically at the start of every session:
# Project instructions (checked into your repo) CLAUDE.md # User-level instructions (applies to all projects) ~/.claude/CLAUDE.md # Auto-memory (Claude writes here when asked to remember things) ~/.claude/projects/<project-hash>/memory/MEMORY.md
Teaching Claude to remember
Tell Claude: "Remember: always use bun instead of npm in this project"
It writes the instruction to its memory file. To undo: "Forget the rule about using bun"
The path rename trap
Claude stores project memory using the absolute path to your project directory. If you rename or move the folder, Claude loses all project-specific memory and context.
# These are DIFFERENT projects to Claude: ~/Projects/my-app/ ← has memory ~/Projects/my-app-v2/ ← no memory (different path)
How to handle renames
If you must rename a project directory:
# 1. Find the old memory directory ls ~/.claude/projects/ # 2. Copy or rename the memory to match the new path hash # Or: re-run claude /init in the renamed directory
Permission settings
Skip repetitive permission prompts by pre-approving common tools in .claude/settings.json:
{
"permissions": {
"allow": [
"Bash(git *)", "Bash(ls *)", "Bash(cd *)",
"Read", "Edit", "Write", "Glob", "Grep"
]
}
}
Tips
- Start fresh sessions for unrelated tasks (cheaper, faster)
- Keep CLAUDE.md under 500 lines; split details into linked docs
- Regularly check
~/.claude/projects/to prune stale memory