feat: Claude Desktop configuration support for Linux and Windows#176
feat: Claude Desktop configuration support for Linux and Windows#176tomasohara wants to merge 5 commits intojonigl:mainfrom
Conversation
| 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') |
There was a problem hiding this comment.
| 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")
jonigl
left a comment
There was a problem hiding this comment.
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'] |
There was a problem hiding this comment.
| 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
|
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. |
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 |
adds Claude Desktop configuration support for Linux and Windows (#164)