Config-editing (update-config skill / agents) writes to ~/.claude/settings.json, ignoring CLAUDE_CONFIG_DIR

Status Open
Maintainer reply None cached
Activity 1 comment · opened Jul 21, 2026

When asked to edit Claude Code configuration, Claude Code operates on ~/.claude/settings.json even when CLAUDE_CONFIG_DIR is set to a different directory. The rest of the CLI honors CLAUDE_CONFIG_DIR correctly, so the config it edits is not the config it actually reads. Edits land in a file that is never loaded.

Steps to reproduce

  1. Set CLAUDE_CONFIG_DIR to an XDG-style path, for example export CLAUDE_CONFIG_DIR="$HOME/.config/claude". Real settings live at ~/.config/claude/settings.json and ~/.claude/settings.json does not exist.
  2. Start Claude Code and confirm the env var is set.
  3. Ask it to change a setting, add a permission, or set an env var (this routes through the update-config skill).

Expected behavior

Reads and writes settings.json from $CLAUDE_CONFIG_DIR.

Actual behavior

Reads and writes ~/.claude/settings.json, ignoring CLAUDE_CONFIG_DIR. On a machine where that file doesn't exist, it silently creates a new one that Claude Code never loads, so the change appears to succeed but has no effect.

This is the same root cause as #16899 (statusline-setup agent, closed as stale) but broader. The path resolution used when editing config should honor CLAUDE_CONFIG_DIR everywhere, not just in the main read path.

Environment

  • macOS (Darwin 25.5.0)
  • CLAUDE_CONFIG_DIR=~/.config/claude

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗