How to Move or Rename Claude Code Project Folders Without Losing Session History

The Problem: mv Breaks Claude Code Session History
Claude Code stores your session history in ~/.claude/projects/ using the exact absolute path of your project as an identifier. For example, a project at /Users/alex/my-project gets a session folder at: ~/.claude/projects/-Users-alex-my-project/.
When you use mv to move or rename a project folder, the path no longer matches and all your sessions become invisible to Claude Code. The data isn't deleted but becomes orphaned.
The Solution: clamp Tool
clamp is a community-built tool that handles folder renaming, moving, or both while preserving Claude Code session history.
Install via Homebrew:
brew install wsagency/tap/clampSteps to Use clamp
Follow these steps in order:
- Dry run first (preview changes):
clamp --dry-run /Users/alex/old-project-name /Users/alex/documents/new-project-name
Check output for session files detected and new paths confirmed. - Run the real migration:
clamp /Users/alex/old-project-name /Users/alex/documents/new-project-name
Typeyto confirm. - Verify everything landed correctly:
clamp --list clamp --verify - Resume your session:
cd /Users/alex/documents/new-project-name
claude --continue
If You Already Used mv
If you already moved the folder with mv and broke session access, use the --fix command:
clamp --fix --from /Users/alex/old-project-name --to /Users/alex/documents/new-project-nameThis tool addresses a specific pain point for developers who reorganize their project structures while maintaining access to their Claude Code conversation history.
📖 Read the full source: r/ClaudeAI
👀 See Also

Black LLAB: Open-Source Architecture for Dynamic Model Routing and Docker-Sandboxed AI Agents
A developer has open-sourced Black LLAB, a system that uses Mistral 3B to route prompts between local and cloud models and runs AI agents in isolated Docker containers with OpenClaw integration.

Docent: An AI Assistant for Paper Analysis Built with Claude Code
A developer created Docent, an AI assistant that reads uploaded papers, presents them, answers questions, and assesses understanding using Claude Code. The project is available on GitHub under MIT License with a demo on Vercel.

Traversable Skill Graph for Persistent AI Agent Memory in Codebases
A developer built a three-layer skill graph system that lives inside a codebase, enabling AI coding assistants to maintain persistent memory across sessions. The system uses progressive disclosure with self-directing instructions instead of monolithic context files.

ClawTalk iOS App Enables Voice Chat with Self-Hosted OpenClaw AI Agents
ClawTalk is a native iOS app that provides push-to-talk voice chat for OpenClaw self-hosted LLM setups. It features on-device speech-to-text using WhisperKit, real-time streaming responses with markdown rendering, and supports multiple TTS options including ElevenLabs, OpenAI, and Apple's built-in voices.