Skip to content

feat: Claude Desktop configuration support for Linux and Windows#176

Open
tomasohara wants to merge 5 commits intojonigl:mainfrom
tomasohara:main
Open

feat: Claude Desktop configuration support for Linux and Windows#176
tomasohara wants to merge 5 commits intojonigl:mainfrom
tomasohara:main

Conversation

@tomasohara
Copy link

adds Claude Desktop configuration support for Linux and Windows (#164)

@jonigl jonigl self-assigned this Jan 29, 2026
@jonigl jonigl changed the title Claude Desktop configuration support for Linux and Windows feat: Claude Desktop configuration support for Linux and Windows Jan 29, 2026
if os.name == 'nt':
# %appdata% typically resolves as C:\Users\<USERNAME>\AppData\Roaming
APPDATA = os.environ['APPDATA']
CONFIG_DIR = os.path.join(APPDATA, 'Claude', 'claude_desktop_config.json')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
CONFIG_DIR = os.path.join(APPDATA, 'Claude', 'claude_desktop_config.json')
CONFIG_DIR = os.path.join(APPDATA, 'Claude')

This suggestions avoid repeating the filename for the CONFIG_DIR.
Because in line 18 already concatenate the json filename:

DEFAULT_CLAUDE_CONFIG = os.path.join(CONFIG_DIR, "claude_desktop_config.json")

Copy link
Owner

@jonigl jonigl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @tomasohara when you get a chance, please check my suggestions

DEFAULT_CLAUDE_CONFIG = os.path.expanduser("~/Library/Application Support/Claude/claude_desktop_config.json")
if os.name == 'nt':
# %appdata% typically resolves as C:\Users\<USERNAME>\AppData\Roaming
APPDATA = os.environ['APPDATA']
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
APPDATA = os.environ['APPDATA']
APPDATA = os.environ.get('APPDATA', os.path.expanduser('~/AppData/Roaming'))

using .get to avoid KeyError if the envar is not present. And adding fallback just in case

@tomasohara
Copy link
Author

Good point about using get.

Note that when researching the location, Claude suggested the following code. I was going to use it, but it introduces a new dependency.

from platformdirs import user_config_dir
...
config_dir = user_config_dir("Claude", roaming=True)
DEFAULT_CLAUDE_CONFIG = os.path.join(config_dir, "claude_desktop_config.json")

@jonigl
Copy link
Owner

jonigl commented Feb 2, 2026

Good point about using get.

Note that when researching the location, Claude suggested the following code. I was going to use it, but it introduces a new dependency.

from platformdirs import user_config_dir
...
config_dir = user_config_dir("Claude", roaming=True)
DEFAULT_CLAUDE_CONFIG = os.path.join(config_dir, "claude_desktop_config.json")

Yeah, adding a new dependency for this looks like an overkill. Feel free to go ahead and commit the suggestions or propose a different approach

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants