[BUG] Multiple .claude.json.backup files spawned on startup without cleanup

Resolved 💬 13 comments Opened Jan 28, 2026 by Jaketdaniels Closed Feb 13, 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?

Claude Code creates multiple .claude.json.backup.{timestamp} files in the home directory on startup, but never cleans them up. These accumulate indefinitely, cluttering the home directory.

The backups are created within milliseconds of each other (sometimes 2-3 files within the same second), suggesting multiple redundant backup operations are being triggered during initialization.

$ ls -la ~/.claude.json*
-rw-r--r--@ 1 user  staff  51205 28 Jan 21:35 /Users/user/.claude.json
-rw-r--r--@ 1 user  staff  51205 28 Jan 21:35 /Users/user/.claude.json.backup.1769596532941
-rw-r--r--@ 1 user  staff  51205 28 Jan 21:35 /Users/user/.claude.json.backup.1769596532943

Deleting these files only temporarily solves the problem - they are immediately recreated when Claude Code loads.

What Should Happen?

  1. At most ONE backup file should be maintained (not multiple timestamped versions)
  2. Old backup files should be cleaned up automatically
  3. Multiple backup operations should not fire within milliseconds of each other during startup

Error Messages/Logs

No error messages - files are silently created and accumulate.

Steps to Reproduce

  1. Run rm ~/.claude.json.backup.* to clean up existing backups
  2. Start Claude Code (claude)
  3. Check home directory: ls -la ~/.claude.json*
  4. Observe multiple new .claude.json.backup.{timestamp} files have been created

Claude Model

Any

Is this a regression?

Unknown

Last Working Version

_No response_

Claude Code Version

2.1.22 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

zsh

Additional Information

Related issues:

  • #14634 - Excessive File I/O (same underlying issue of redundant writes)
  • #20637 - Race condition with multiple VS Code windows writing to ~/.claude.json
  • #11963 - Feature request for auto-cleanup of temporary files

All backup files have identical size (51205 bytes), suggesting they're identical copies being created redundantly.

View original on GitHub ↗

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