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

Handoffs Pattern in Claude Workflows: Two-File Split vs One-Doc Summary
Long Claude sessions break on context decay. Handoffs compress what matters and start fresh. Two approaches: Matt Pocock's single-doc handoff skill vs a two-file split with persistent narrative and ephemeral prompt.

MCP Marketplace Built with Claude Code Features Security Scanning and Monetization
A developer built mcp-marketplace.io using Claude Code for 95% of the codebase, creating a curated marketplace with security scanning for 2,200+ MCP servers and monetization options for creators.

MCP Server for Italian Train Data: Real-Time Delays, Departures, and Schedules in Claude
A developer built an unofficial MCP server for Trenitalia that provides five tools for querying Italian train data through Claude, including real-time departure/arrival boards, train tracking, and schedules with live delay enrichment.

ClawMetry adds remote monitoring with E2E encryption for OpenClaw agents
ClawMetry v0.1.0 now includes cloud sync for remote monitoring of OpenClaw agents from any browser or Mac menu bar app, with end-to-end encryption that keeps data encrypted until it reaches your client.