[BUG] Claude Code is saving all log files in the current working directory
Status Fixed / completed
Reported on v2.1.17
Maintainer reply None cached
Activity 4 comments · opened Jan 23, 2026 · closed Jan 23, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
After using the native installer, when launching Claude Code from a WSL terminal, the Claude Code session is creating and writing debug content to the current project directory.
This results in several new folders and files ("cache/", "plugins/", "shell-snapshots/", "todos/", "history.jsonl") being written in the project root.
What Should Happen?
These ephemeral logging artifacts should be written to ~/.claude/
Error Messages/Logs
Steps to Reproduce
- Navigate to desired repository directory.
- Launch Claude Code using
claude
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.17
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
WSL (Windows Subsystem for Linux)
4 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
This bug is not related to the possible duplicate issues.
Issue was related to environmental variable:
CLAUDE_CONFIG_DIR.When this variable is set to an empty string (
"CLAUDE_CONFIG_DIR":""), it apparently defaults to the current working directory.Suggest renaming this variable to "CLAUDE_LOG_DIR"
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.