[DOCS] Document Linux `XDG_DATA_HOME` support for `claude-cli://` protocol handler registration

Open 💬 4 comments Opened Mar 25, 2026 by coygeek

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:

  1. The setup page hardcodes ~/.local/share/claude in the uninstall command, which will leave orphaned files behind for users who have XDG_DATA_HOME set to a non-default location.
  2. There is no mention of the claude-cli:// protocol handler, what files it creates, or where they are placed on Linux.
  3. There is no mention of XDG_DATA_HOME anywhere in the docs (only XDG_CONFIG_HOME is 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 the claude-cli:// URL scheme by writing a .desktop file and MIME type entry to $XDG_DATA_HOME/applications/ (defaulting to ~/.local/share/applications/ if XDG_DATA_HOME is not set). To unregister the handler manually, remove those entries or use xdg-mime to 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: respect XDG_DATA_HOME when registering the claude-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 |

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗