Feature Request
Currently, ~/.claude.json and its auto-generated backup/corrupted files (.claude.json.backup.*, .claude.json.corrupted.*) are stored directly in the user's home directory. Over time, the backup files accumulate and clutter the home folder.
Current Behavior
~/.claude.json — main config file
~/.claude.json.backup.<timestamp> — created on every config write
~/.claude.json.corrupted.<timestamp> — created on crash recovery
These pile up in ~/ with no automatic cleanup.
Proposed Solution
One or more of the following:
- Move
~/.claude.json into ~/.claude/config.json — the .claude/ directory already exists for plugins, projects, and todos. The main config file fits naturally there.
- Store backups inside
~/.claude/backups/ instead of alongside the config in the home directory.
- Add an environment variable (e.g.,
CLAUDE_CONFIG_PATH) to let users customize the config location.
- Auto-clean old backups — keep only the most recent 1-2 backups and delete older ones automatically.
Workaround
Currently using a Stop hook to delete backup files at session end:
{
"type": "command",
"command": "powershell -NoProfile -Command \"Remove-Item '$env:USERPROFILE\\.claude.json.backup.*','$env:USERPROFILE\\.claude.json.corrupted.*' -ErrorAction SilentlyContinue\"",
"timeout": 5000
}
This works but shouldn't be necessary.
Environment
- Windows 11
- Claude Code CLI + VS Code extension
Feature Request
Currently,
~/.claude.jsonand its auto-generated backup/corrupted files (.claude.json.backup.*,.claude.json.corrupted.*) are stored directly in the user's home directory. Over time, the backup files accumulate and clutter the home folder.Current Behavior
~/.claude.json— main config file~/.claude.json.backup.<timestamp>— created on every config write~/.claude.json.corrupted.<timestamp>— created on crash recoveryThese pile up in
~/with no automatic cleanup.Proposed Solution
One or more of the following:
~/.claude.jsoninto~/.claude/config.json— the.claude/directory already exists for plugins, projects, and todos. The main config file fits naturally there.~/.claude/backups/instead of alongside the config in the home directory.CLAUDE_CONFIG_PATH) to let users customize the config location.Workaround
Currently using a
Stophook to delete backup files at session end:{ "type": "command", "command": "powershell -NoProfile -Command \"Remove-Item '$env:USERPROFILE\\.claude.json.backup.*','$env:USERPROFILE\\.claude.json.corrupted.*' -ErrorAction SilentlyContinue\"", "timeout": 5000 }This works but shouldn't be necessary.
Environment