Move .claude.json config and backups into .claude/ directory
Resolved 💬 3 comments Opened Feb 16, 2026 by HYPERLYNQ Closed Feb 19, 2026
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.jsoninto~/.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
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗