Skip to content

fix(claude): set XDG and tool directories in the Claude settings env - #122

Merged
0xA3B merged 1 commit into
mainfrom
fix/claude-env-base-dirs
Nov 11, 2026
Merged

0xA3B merged 1 commit into
mainfrom
fix/claude-env-base-dirs

Conversation

@0xA3B

@0xA3B 0xA3B commented Nov 11, 2026

Copy link
Copy Markdown
Owner

Claude Code's Bash commands inherit the environment of the process that launched Claude Code, and the shell snapshot keeps only PATH. The desktop app starts from launchd, outside fish, so its sessions had no XDG_* variables or PNPM_HOME. Without XDG_RUNTIME_DIR, pnpm 12.18 fails inside the sandbox with ERR_PNPM_STORE_DIR_OPEN_OPERATION_LOCK.

The settings env block now sets the XDG base directories, XDG_RUNTIME_DIR, PNPM_HOME, MISE_CACHE_DIR, and the HOMEBREW_NO_* flags to the values the fish config uses. The env block takes literal values only, so chezmoi renders the paths from .chezmoi.homeDir. The block reaches the Claude process, hooks, and every Bash command, whether or not the mise hook runs. Setting the values in mise [env] instead would also change interactive shells, and mise reads MISE_CACHE_DIR before it loads its config.

The values must stay in step with managed/dot_config/fish/conf.d; a comment on the block says so.

Bash commands inherit the environment of the process that launched Claude Code, and the shell
snapshot keeps only PATH. A desktop-launched session therefore lacked XDG_RUNTIME_DIR, and pnpm
12.18 failed to open its store lock inside the sandbox.
@0xA3B
0xA3B merged commit 76e52af into main Nov 11, 2026
2 checks passed
@0xA3B
0xA3B deleted the fix/claude-env-base-dirs branch November 11, 2026 03:20
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.

1 participant