[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)

Additional Information

d014121b-eaa8-4f11-b221-081a2de95f53.txt

View original on GitHub ↗

4 Comments

github-actions[bot] · 8 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/16165
  2. https://github.com/anthropics/claude-code/issues/20119
  3. https://github.com/anthropics/claude-code/issues/3833

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

ErikHodges · 8 months ago

This bug is not related to the possible duplicate issues.

ErikHodges · 8 months ago

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"

github-actions[bot] · 8 months ago

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.