Claude Code does not respect the XDG Base Directory specification
## Environment - Claude CLI version: all - Operating System: linux - Terminal: all ## Bug Description Claude Code writes its cache data and configs to ~/.claude.json and ~/.claude instead of following the [XDG Base Directory specification](https://specifications.freedesktop.org/basedir-spec/latest/). It looks like you can kinda get claude code to put some file in `CLAUDE_CONFIG_DIR` but the default behavior without configuration should be to follow the XDG specification. ## Steps to Reproduce install & run claude code ## Expected Behavior follows xdg specification ## Actual Behavior creates ~/.claude.json and ~/.claude directory ## Additional Context Here's what Claude Code has to say on why Claude Code should follow the XDG spec: > User Environment Respect > > Following XDG standards ensures Claude Code respects users' configured > directory preferences rather than cluttering their home directory with > dot-files. Users who have customized XDG_CONFIG_HOME, XDG_DATA_HOME, and > XDG_CACHE_HOME expect all well-behaved applications to honor these settings. > > System Administrator Compliance > > In enterprise environments, system administrators often configure XDG > directories to point to network storage, encrypted volumes, or specific > partitions. Non-compliant applications break these carefully designed setups > and create security or storage policy violations. > > Container and Sandboxing Compatibility > > Modern deployment patterns (cont
Posted by jennifgcrl on May 31, 2025, 6:08 AM
Tags
Related issues
Raise real-world problems, find people facing the same issue, and discuss solutions.2,000 issues0 comments
onboarding (Network)
Claude Code does not respect the XDG Base Directory specification
## Environment - Claude CLI version: all - Operating System: linux - Terminal: all ## Bug Description Claude Code writes its cache data and configs to ~/.claude.json and ~/.claude instead of following the [XDG Base Directory specification](https://specifications.freedesktop.org/basedir-spec/latest/). It looks like you can kinda get claude code to put some file in `CLAUDE_CONFIG_DIR` but the default behavior without configuration should be to follow the XDG specification. ## Steps to Reproduce install & run claude code ## Expected Behavior follows xdg specification ## Actual Behavior creates ~/.claude.json and ~/.claude directory ## Additional Context Here's what Claude Code has to say on why Claude Code should follow the XDG spec: > User Environment Respect > > Following XDG standards ensures Claude Code respects users' configured > directory preferences rather than cluttering their home directory with > dot-files. Users who have customized XDG_CONFIG_HOME, XDG_DATA_HOME, and > XDG_CACHE_HOME expect all well-behaved applications to honor these settings. > > System Administrator Compliance > > In enterprise environments, system administrators often configure XDG > directories to point to network storage, encrypted volumes, or specific > partitions. Non-compliant applications break these carefully designed setups > and create security or storage policy violations. > > Container and Sandboxing Compatibility > > Modern deployment patterns (cont
Comments (0)
No comments yet. Start the discussion.