Feature request: Allow configuring temp file directory location

Resolved 💬 2 comments Opened Jan 13, 2026 by duanebc Closed Feb 27, 2026

Problem

Claude Code creates numerous tmpclaude-* files in the working directory during sessions. These files accumulate and clutter the project directory:

tmpclaude-0414-cwd
tmpclaude-05bd-cwd
tmpclaude-0e4c-cwd
tmpclaude-2fed-cwd
... (15+ files per session)

While these can be added to .gitignore, they still visually clutter the workspace in file explorers and terminal ls output.

Requested Feature

Allow users to configure where Claude Code stores its temporary session files, either via:

  1. Environment variable: CLAUDE_CODE_TEMP_DIR=~/.claude/tmp
  2. Config file setting: In .claude/settings.json or similar
  3. CLI flag: --temp-dir <path>

Suggested Default Behavior

  • Use a hidden directory like .claude/tmp/ or .tmp_claude/ in the project root
  • Or use the system temp directory ($TMPDIR, /tmp, %TEMP%)

Benefits

  • Cleaner project directories
  • Better developer experience
  • Easier to manage/clean up temp files in a single location
  • Consistent with how other tools handle temp files (hidden or system temp dir)

Environment

  • OS: Windows (MINGW64)
  • Claude Code version: Latest

View original on GitHub ↗

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