bridge-spawn root ignores CLAUDE_CONFIG_DIR and always creates ~/.claude

Status Open
Reported on v2.1.284
Maintainer reply None cached
Activity 2 comments · opened Oct 1, 2026

What's wrong

Setting CLAUDE_CONFIG_DIR moves almost all state, but ~/.claude/bridge-spawn is still created in the home directory on every launch of the desktop app, so ~/.claude keeps reappearing.

Cause

In the bundled binary (2.1.284), the bridge-spawn root is a module-level constant built from the home directory:

var y6n = "bridge-spawn", t5 = join(homedir(), ".claude", y6n);

ensureBridgeSpawnRootDir then runs mkdir -p on it at startup. There is no check for CLAUDE_CONFIG_DIR, unlike the other config paths.

Steps to reproduce

  1. Set CLAUDE_CONFIG_DIR to a custom path, such as ~/Library/Application Support/Claude Code. Set it for both the CLI and the desktop app.
  2. Delete ~/.claude.
  3. Launch the Claude desktop app and start a Code session.
  4. ~/.claude/bridge-spawn exists again (empty directory, mode 0700).

Expected

The bridge-spawn root lives under CLAUDE_CONFIG_DIR (or XDG_STATE_HOME/XDG_RUNTIME_DIR) when set, so no home-directory folder is created.

Environment

  • macOS (Darwin), Claude desktop app with Claude Code 2.1.284
  • XDG variables and CLAUDE_CONFIG_DIR set in ~/.zshenv

Related

The sandbox allowlist also hardcodes ~/.claude/debug and ~/.npm/_logs, so those can also create ~/.claude and ~/.npm. They are worth moving under the config dir too.

View original on GitHub ↗

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