[DOCS] Document Linux `XDG_DATA_HOME` support for `claude-cli://` protocol handler registration
Documentation Type
Missing documentation (feature not documented)
Documentation Location
https://code.claude.com/docs/en/setup
Section/Topic
Linux installation / uninstallation steps — the section covering Linux-specific file paths (e.g., the rm -rf ~/.local/share/claude uninstall step)
Current Documentation
The setup page references ~/.local/share/claude as a hardcoded path in the Linux/WSL uninstall step:
rm -rf ~/.local/share/claude
There is no mention of XDG_DATA_HOME anywhere in the docs, nor any explanation of where the claude-cli:// protocol handler files are registered on Linux.
What's Wrong or Missing?
Claude Code v2.1.83 added support for respecting XDG_DATA_HOME when registering the claude-cli:// protocol handler on Linux. This means the protocol handler registration files (typically a .desktop file and MIME type entry) are written to $XDG_DATA_HOME when that environment variable is set, rather than unconditionally writing to ~/.local/share.
The docs do not document this behavior anywhere:
- The setup page hardcodes
~/.local/share/claudein the uninstall command, which will leave orphaned files behind for users who haveXDG_DATA_HOMEset to a non-default location. - There is no mention of the
claude-cli://protocol handler, what files it creates, or where they are placed on Linux. - There is no mention of
XDG_DATA_HOMEanywhere in the docs (onlyXDG_CONFIG_HOMEis referenced, and only in the changelog).
Linux users who customize their XDG base directories (a common practice in distribution-agnostic setups and containerized environments) cannot determine where Claude Code writes protocol handler files, which breaks clean uninstalls and manual protocol handler management.
Suggested Improvement
Update the Linux/WSL uninstall step to account for XDG_DATA_HOME:
rm -rf "${XDG_DATA_HOME:-$HOME/.local/share}/claude"
Add a note near the Linux installation section explaining protocol handler registration:
Linux protocol handler: Claude Code registers theclaude-cli://URL scheme by writing a.desktopfile and MIME type entry to$XDG_DATA_HOME/applications/(defaulting to~/.local/share/applications/ifXDG_DATA_HOMEis not set). To unregister the handler manually, remove those entries or usexdg-mimeto reset the default.
This aligns with the XDG Base Directory Specification and matches the behavior introduced in v2.1.83.
Impact
Medium - Makes feature difficult to understand
Additional Context
Source: Changelog v2.1.83
Exact changelog entry:
Linux: respectXDG_DATA_HOMEwhen registering theclaude-cli://protocol handler
Related issue: A separate issue (issue-0004) covers the missing disableDeepLinkRegistration setting. This issue is distinct: it covers the missing documentation of where protocol handler files are placed on Linux and the impact on uninstall paths.
Affected pages:
| Page | URL | Issue |
| :--- | :-- | :---- |
| Setup | https://code.claude.com/docs/en/setup | Hardcoded ~/.local/share/claude uninstall path ignores XDG_DATA_HOME; no mention of protocol handler file locations |
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗