Conversation history lost when changing directories with cd command

Resolved 💬 8 comments Opened Jul 31, 2025 by enraku Closed Jan 21, 2026

Bug Description

Conversation history is not recorded after changing to a subdirectory using the cd command. All conversations that occur after cd subdirectory are lost and not available in subsequent sessions.

Environment

  • Platform: WSL2 (Ubuntu 24.04)
  • Claude Code versions tested: 1.0.64 and 1.0.40
  • Verified on clean installation with no custom configurations

Steps to Reproduce

  1. Start claude in a project directory
  2. Have a conversation (e.g., "What's your favorite animal?")
  3. Create and cd into a subdirectory: mkdir abc && cd abc
  4. Continue conversation (e.g., "What's your favorite food?")
  5. Return to parent directory: cd ..
  6. Continue conversation (e.g., "What's your favorite movie?")
  7. Exit with /exit
  8. Start new session with claude -c
  9. Observe that only the conversation before cd abc is remembered

Expected Behavior

All conversations should be recorded and available in subsequent sessions, regardless of the current working directory.

Actual Behavior

  • Conversations in the main directory: ✅ Recorded
  • Conversations after cd subdirectory: ❌ Lost
  • Conversations after returning with cd ..: ❌ Lost

Impact

This is a critical issue for developers who:

  • Work across multiple subdirectories during development
  • Lose important context and decisions made during subdirectory work
  • Cannot resume conversations properly after directory changes
  • May not realize conversations are being lost until starting a new session

Additional Information

  • Tested on multiple Claude Code versions with same result
  • Reproduced on clean WSL2 installation
  • No error messages or warnings are shown
  • Users have no way to know their conversations aren't being recorded

This appears to be a fundamental issue with how Claude Code tracks conversation history relative to directory changes.

View original on GitHub ↗

This issue has 8 comments on GitHub. Read the full discussion on GitHub ↗