[FEATURE] ~/.claude.json should be stored in ~/.claude
Status Fixed / completed
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 9 comments · opened Feb 9, 2026 · closed Aug 17, 2026
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Claude spams my home directory with _six_ ~/.claude.json!
.claude.json
.claude.json.backup.1770406785596
.claude.json.backup.1770416750158
.claude.json.backup.1770416750168
.claude.json.backup.1770658516793
.claude.json.backup.1770658710224
This seems a bit silly since there is a ~/.claude directory, too. It clutters up the home directory.
Proposed Solution
Claude should store ~/.claude.json in the ~/.claude directory, or even better, it should adhere to the XDG specification and store it in a subdirectory of XDG_CONFIG_HOME (default: ~/.config/claude).
Alternative Solutions
_No response_
Priority
Critical - Blocking my work
Feature Category
CLI commands and flags
Use Case Example
_No response_
Additional Context
_No response_
Showing cached comments. Read the full discussion on GitHub ↗
7 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
I guess this is like #1455, although maybe a bit different since this issue could be solved by moving the multitude of
~/.claude.jsonfiles to~/.claude.I agree, it is necessary to enable the use of multiple separate/isolated profiles using
CLAUDE_CONFIG_DIR.This also has a concrete security impact: the lock and temp files created next to
~/.claude.jsonin~/make it impossible to run Claude Code inside filesystem sandboxes like Landlock (Linux).The problem:
saveConfigWithLockcreates~/.claude.json.lockandsafeWriteFileAtomicallycreates~/.claude.json.tmp.<pid>.<timestamp>— both in~/. Sandboxes like Landlock can grant write access to a specific file (~/.claude.json) but cannot grant permission to create new files in~/without opening the entire home directory for writes. This defeats the sandbox.Impact: Any Claude Code session longer than a few minutes crashes with
EACCESwhen config save is first triggered. Short operations likeclaude -vwork because they exit before a save.Moving
~/.claude.jsoninto~/.claude/(or$XDG_CONFIG_HOME/claude/) would resolve this naturally — lock and temp files would land in a directory the application already owns.Filed originally as #30372, closing in favor of this issue.
macOS data point on the symlink workaround: I have
~/.claude.json -> ~/.config/claude/claude.jsonand it works most of the time, but it's fragile by design.safeWriteFileAtomicallywrites to a temp file (~/.claude.json.tmp.<pid>.<timestamp>) then renames over the target. On macOS,rename(2)currently follows the symlink, so the target file gets replaced and the symlink survives. But lock files (~/.claude.json.lock) still land in$HOMEroot, not at the symlink target — same Landlock issue pierres flagged in #30372, just on a different OS.The real fix is what this issue asks for: move
~/.claude.jsoninside~/.claude/so lock files, temp files, and backups all land in a directory the application already owns.Are there any updates on this feature? I really appreciate it and hope for some progress, as it's quite annoying to see this mess.
I added this to my
~/.zshenv:and now Claude uses
~/.claude/.claude.json🚀