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
Tendril: A self-extending agent that builds and registers tools on the fly
Tendril is an agentic sandbox that autonomously discovers, builds, and registers tools. It starts with just three bootstrap tools and dynamically grows its capability registry without asking the user.

Claw Compactor: 14-stage token compression engine for LLM pipelines
Claw Compactor is an open-source LLM token compression engine using a 14-stage Fusion Pipeline to achieve 54% average compression with zero LLM inference cost. It includes specialized compressors for code, JSON, logs, diffs, and search results with reversible compression capabilities.

Brain-MCP Developer Documents Tools for Claude AI Instead of Humans
A developer maintaining the Brain-MCP server added a 'For AI Assistants' section to documentation with behavioral instructions, resulting in Claude using tools more intelligently and proactively injecting context when topics change.

General Bots: Open-source AI agent platform for self-hosted enterprise automation
General Bots is an open-source platform started in 2019 that provides AI agents, workflow automation, document processing, and integrations with local AI model support, designed for organizations needing full control over their infrastructure.