Allow resuming conversations from different directories

Status Fixed / completed
Maintainer reply ✓ Yes — bcherny
Activity 15 comments · opened Feb 25, 2026 · closed Aug 17, 2026
💡 Likely answer: A maintainer (bcherny, collaborator) responded on this thread — see the highlighted reply below.

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 ↗

15 Comments

github-actions[bot] · 7 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 · 7 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 · 7 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 · 7 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 · 6 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 · 6 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 · 5 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 · 5 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 · 3 months 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 · 2 months 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 · 2 months 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 ⭐ :)

bcherny collaborator · 2 months ago

This works now: claude --resume <session-id> can be run from any directory — Claude Code looks in the current project first, then in every other project on the machine, so a session whose original worktree or folder was deleted can still be resumed from wherever you are. Once resumed, /cd <path> moves the session to a new working directory if you want it to live somewhere else.

Docs: https://code.claude.com/docs/en/sessions#resume-a-session — changelog: https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md

🤖 Generated with Claude Code

sparr · 1 month ago

This works with claude --resume SESSIONID, but claude --resume then using the TUI to select the session still fails and instructs the user to change directory first.

kopyl · 1 month ago

Wow, I didn’t know that, cool, thank you.

On Mon, 14 Sep 2026 at 22:16, sparr @.***> wrote:

sparr left a comment (anthropics/claude-code#28745) <https://github.com/anthropics/claude-code/issues/28745#issuecomment-5669375155> This works with claude --resume SESSIONID, but claude --resume then using the TUI to select the session still fails and instructs the user to change directory first. — Reply to this email directly, view it on GitHub <https://github.com/anthropics/claude-code/issues/28745?email_source=notifications&email_token=AEGKB4MYWF2UAZDISR6FSEL5PA7Y5A5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKNRWHEZTONJRGU22M4TFMFZW63VHMNXW23LFNZ2KKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-5669375155>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AEGKB4PWNXL6X5E2ZFDULI35PA7Y5AVCNFSNUABFKJSXA33TNF2G64TZHM4TGNZSGUZTINZVHNEXG43VMU5TGOJZGE4TGNBVHA42C5QC> . You are receiving this because you commented.Message ID: @.***>
mdeweeseCanaryLabs · 1 day ago

I do not feel that the linked issues being described as duplicates are actually duplicates, this is a separate problem.

If I do a claude --resume, do a ctrl+A to show all projects, specifically show projects from different directories and select one of those, I get kicked to a screen saying i have to copy and paste the cd and rerun for it to work.