You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Conversation history lost when changing directories with cd command #4843
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
Start claude in a project directory
Have a conversation (e.g., "What's your favorite animal?")
Create and cd into a subdirectory: mkdir abc && cd abc
Continue conversation (e.g., "What's your favorite food?")
Return to parent directory: cd ..
Continue conversation (e.g., "What's your favorite movie?")
Exit with /exit
Start new session with claude -c
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.
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
This issue was closed incorrectly despite recent human comments. This behavior of the bot is reported at #16497. Please upvote that issue, so maybe it gets noticed.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.
Activity
rublev commentedon Sep 3, 2025
+1
github-actions commentedon Dec 6, 2025
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
jroes commentedon Dec 16, 2025
I renamed a directory I was working in and ran into this as well :(
Any workarounds?
jroes commentedon Dec 16, 2025
Found a workaround:
less ~/.claude/history.jsonlnaga-k commentedon Dec 20, 2025
Yeah I'd like a feature to be able to change directories and still have claude remember the conversation.
Will be super useful for larger projects. Or new projects where you start a conversation and create the project dir as a sub dir.
github-actions commentedon Jan 21, 2026
This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
marcindulak commentedon Jan 21, 2026
This issue was closed incorrectly despite recent human comments. This behavior of the bot is reported at #16497. Please upvote that issue, so maybe it gets noticed.
github-actions commentedon Jan 28, 2026
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.