Feature Request: Support XDG Base Directory Specification for config/data directories

Open 💬 0 comments Opened Jun 12, 2026 by rjdinis-nos

Currently, Claude Code hardcodes ~/.claude/ as the only location for user-level configuration and data. This does not follow the XDG Base Directory Specification, which is the standard on Linux (and supported on macOS) for organizing user files.

Requested behavior

Respect XDG environment variables when they are set:

  • $XDG_CONFIG_HOME/claude (falling back to ~/.claude) for configuration files (settings.json, CLAUDE.md, hooks, etc.)
  • $XDG_DATA_HOME/claude (falling back to ~/.claude) for data files (projects, memory, etc.)

Current workaround

Users can symlink ~/.claude to their preferred XDG-compliant path, but this is fragile and requires manual setup.

Why this matters

Many Linux users and tools (e.g., stow, chezmoi) rely on XDG compliance to manage dotfiles cleanly. Hardcoding ~/.claude pollutes the home directory contrary to established conventions.

View original on GitHub ↗