[BUG] Claude Code creates ~/.claude/.claude/settings.local.json when started from global config directory

Resolved 💬 4 comments Opened Mar 22, 2026 by bxw91 Closed Apr 20, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

After changing some config settings inside Claude Code CLI a .claude/ subdirectory is created inside ~/.claude/, and settings are saved to ~/.claude/.claude/settings.local.json

What Should Happen?

It should recognize that it is started from its own global folder and not create subfolder .claude in ~/.claude

Error Messages/Logs

Steps to Reproduce

Open a terminal in ~/.claude/ (or start Claude Code VS Code extension with a file from ~/.claude/ active in the editor)
Start Claude Code CLI
Change any setting via /config

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

Claude Code v2.1.74

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

VS Code integrated terminal

Additional Information

Claude Code applies the generic rule {cwd}/.claude/settings.local.json for project-local settings without detecting that {cwd} is the global config directory itself.

View original on GitHub ↗

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