Config-editing (update-config skill / agents) writes to ~/.claude/settings.json, ignoring CLAUDE_CONFIG_DIR
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
- Set
CLAUDE_CONFIG_DIRto an XDG-style path, for exampleexport CLAUDE_CONFIG_DIR="$HOME/.config/claude". Real settings live at~/.config/claude/settings.jsonand~/.claude/settings.jsondoes not exist. - Start Claude Code and confirm the env var is set.
- 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
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗