Temporary files not cleaned up on Windows (tmpclaude-*-cwd, nul)

Status Closed — not planned
Reported on v2.1.6
Maintainer reply None cached
Activity 9 comments · opened Jan 13, 2026 · closed Feb 27, 2026

Bug Description

Claude Code leaves temporary files in the working directory on Windows that are not cleaned up after use.

Files affected

  1. tmpclaude-XXXX-cwd - Multiple files containing the current working directory path
  2. nul - File created when output is redirected to NUL (Windows null device) via bash

Environment

  • Claude Code version: 2.1.6
  • OS: Windows 10/11
  • Shell: Git Bash / MinGW (used by Claude Code)

Steps to reproduce

  1. Start Claude Code in any directory on Windows
  2. Work with it for a while (run some commands)
  3. Close/restart Claude Code
  4. Check the working directory - temp files remain

Expected behavior

Temporary files should be automatically deleted when no longer needed.

Additional context

The nul file issue occurs because bash interprets > nul as a file path rather than the Windows NUL device. The redirect should use > /dev/null or > NUL: on Windows.

View original on GitHub ↗

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