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

AI Claw: Serverless Bridge Connects Alexa to Local OpenClaw with Dual Delivery
AI Claw is a Python AWS Lambda pipeline that connects Amazon Echo speakers to local OpenClaw instances, bypassing Amazon's 8-second timeout by using a fire-and-forget architecture with dual delivery to Telegram and native Echo audio output.

PACT 0.4.0 adds compound intelligence for AI coding agents
PACT (Programmatic Agent Constraint Toolkit) version 0.4.0 introduces compound intelligence features that help AI coding agents retain knowledge across sessions. The update includes research synthesis, a knowledge directory, and capability self-awareness systems.

Academic Research Skills for Claude Code: A Human-in-the-Loop Pipeline for Paper Writing
Academic Research Skills (ARS) v3.7.0+ is a Claude Code plugin that automates reference hunting, citation formatting, data checking, and logical consistency review while keeping the human researcher in control. Install via /plugin marketplace add Imbad0202/academic-research-skills.

LLMock: HTTP-based mocking server for deterministic LLM testing across processes
LLMock is a real HTTP server that mocks OpenAI, Claude, and Gemini APIs, allowing developers to run deterministic tests across multiple processes without hitting real APIs. It supports SSE streaming, tool calls, predicate routing, and request journaling with zero dependencies.