Allow resuming conversations from different directories

Status Fixed / completed
Maintainer reply None cached
Activity 12 comments · opened Feb 25, 2026 · closed Aug 17, 2026

Problem

Conversations are tied to the directory where they were started. If the original directory no longer exists (e.g., deleted git worktree, moved/renamed directory), there's no way to resume that conversation.

The current behavior shows:

This conversation is from a different directory.

To resume, run:
  cd /original/path && claude --resume <session-id>

But if /original/path no longer exists, this is impossible without manually recreating the directory structure.

Use Cases

  1. Git worktrees: Developers often create temporary worktrees for PRs/features, then delete them after merging. Conversations from those worktrees become inaccessible.
  1. Directory reorganization: Moving or renaming project directories orphans all associated conversations.
  1. Disk cleanup: Removing old project directories loses conversation history even if you want to reference it later.

Proposed Solution

Add a --force flag (or similar) to allow resuming a conversation regardless of directory mismatch:

claude --resume <session-id> --force

Or allow specifying a session ID without directory validation:

claude --resume <session-id> --ignore-directory

Current Workarounds

  • Manually recreate the original directory path (empty directory works)
  • Symlink current location to the old path

Both are cumbersome and shouldn't be necessary.

View original on GitHub ↗

11 Comments

github-actions[bot] · 6 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/5768
  2. https://github.com/anthropics/claude-code/issues/28314
  3. https://github.com/anthropics/claude-code/issues/19747

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

kopyl · 6 months ago

Need this ASAP.
It's so bad that I haveto remember the directory to be able to continue a conversation.

When it's done, please ping me somebody ❤️

zaz · 5 months ago

Could I also suggest you generate UUIDs within each project's .claude/ directory so that if the developer manually moves or renames the directory, it is possible to automatically fix ~/.claude/projects/ to match?

epavlenko · 5 months ago

Related: #34985 — a concrete proposal for the VSCode extension side of this problem (cross-project session picker with implementation details for SessionHistoryManager.fetchSessions()).

immanuelAtTQ · 5 months ago

I want this too

I renamed a folder that started a chat in and now I get the following This conversation is from a different directory. To resume, run: cd /Users/path/to/foleder && claude --resume #a#b#c#d#e-524c-456a-988a-########

Claude Code ties conversations to the directory they were started in. There's no built-in flag to bypass this check.

Your options:

  1. Symlink the old path (easiest way to resume):

ln -s /Users/immanuelcomer/threatq/libra-ic /Users/immanuelcomer/threatq/chat-inc

  1. Then resume normally:

cd /Users/immanuelcomer/threatq/chat-inc && claude --resume b82dfae7-524c-456a-988a-d346c6ef4dff

  1. Start a new conversation in the renamed directory — you'll lose the conversation history but can continue working.
emanborg · 4 months ago

noticed a bug it says This conversation is from a different directory. on windows it thinks c:\projects and c:\PROJECTS are 2 different folders and not letting me resume. suddently it tought that my conversations were carried out in c:\projects but really were in c:\PROJECTS

Rptkiddle · 4 months ago

Sharing a tool that sort of solves this: claude-session-picker. It's an fzf-based session picker (cr command) that automatically cds to the session's original working directory before resuming, so project-scoped memories load correctly. If the directory no longer exists, it offers to recreate it — the memories still load because they're stored by path in ~/.claude/projects/.

Also includes starring, archiving, context usage display, and active session detection. Handy interface for managing/resuming sessions via CLI. Two files (zsh + Python), no dependencies beyond fzf.

ErikPoppleton · 4 months ago

An automatic way to fix this would be preferable, but you can manually fix this issue by finding the session you want to restore at ~/.claude/projects/-path-to-deleted-directory/sessionid.jsonl and copy that file to ~/.claude/projects/-path-to-target-directory/

geokao · 1 month ago

+1 — and it's not just dev workflows. I'm a desktop-app user running Claude Code on writing/business projects in Google-Drive-synced folders. Renaming one top-level project folder orphaned every chat inside it ("Session not found on disk"); the only recovery that worked was renaming the folder back. Community relink tools only fix the CLI layer (~/.claude/projects) — the desktop app keeps its own session→path binding in the app's IndexedDB, so nothing user-accessible repairs it. The chilling effect is real: I now treat folder names as frozen, and my folder structure keeps bloating because any reorganization costs me the history. Path-independent sessions (or a supported relocate/migrate command) would fix this whole class of problems.

claell · 21 days ago

Adding the Desktop relocation/UI part of #55831, which was closed and later locked by lifecycle automation with instructions to file again if the request remained relevant. I am adding it here instead of opening another duplicate because this is the active path-independent resume request.

For Desktop, --force or --ignore-directory would solve only the CLI half. The useful user-facing workflow is a supported Relocate project or Reconnect session action that:

  1. selects the moved or renamed project folder;
  2. updates Claude Code's project/session path mapping;
  3. updates Desktop's own session-to-path binding; and
  4. preserves the existing session list, titles, and resume behavior.

The current workaround of copying JSONL files or recreating/symlinking an old path is not suitable for ordinary Desktop users and can leave the CLI and Desktop stores disagreeing. A single supported migration action would cover folder renames, moves, drive-letter changes, and deleted worktrees without freezing users' directory structure.

BasedGPT · 21 days ago

The transcript file can survive the directory that created it. The message about a different directory blocks the resume check, but it does not by itself mean the conversation history is gone. In my cases, the .jsonl was still under the old project slug in ~/.claude/projects/.

I built BasedGPT/claude-code-session-recovery for this path-binding problem. Run python tools/diagnose.py first and follow the exact command it prints. It checks the metadata, project slugs, and worktree paths so you can separate a stale path from a missing transcript file. Before any write, confirm that the affected UUID is still present and keep the original .jsonl untouched.

If the old directory was renamed or a worktree was deleted, the diagnosis gives you the safe route for reconnecting the existing session to its current project path. That avoids recreating a dead directory just to satisfy the resume check.

Hope this helps, if my tools are able to help you, would appreciate a ⭐ :)

Showing cached comments. Read the full discussion on GitHub ↗