claude-code - 💡(How to fix) Fix Support .claude/ directory for CLAUDE.md and MCP config (.claude.json) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#48376Fetched 2026-04-16 07:01:55
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Author
Timeline (top)
labeled ×2commented ×1
RAW_BUFFERClick to expand / collapse

Currently Claude Code scatters related configuration files across the home directory:

  • ~/.claude.json — MCP server configuration
  • ~/CLAUDE.md — Global instructions file
  • ~/.claude/ — Settings, sessions, memory, projects

Request: Consolidate all Claude-related files under ~/.claude/:

  • ~/.claude/CLAUDE.md instead of ~/CLAUDE.md
  • ~/.claude/config.json instead of ~/.claude.json

This would keep the home directory clean and make it obvious where all Claude-related files live. Users currently have to know that Claude files are split between ~/.claude.json, ~/CLAUDE.md, and ~/.claude/ — which is confusing.

Backwards compatibility could be maintained by falling back to the current locations if the new ones don't exist.

extent analysis

TL;DR

Move Claude-related configuration files to a unified location under ~/.claude/ to improve organization and user experience.

Guidance

  • Identify all locations where ~/.claude.json and ~/CLAUDE.md are referenced in the code, and update these references to point to the new locations ~/.claude/config.json and ~/.claude/CLAUDE.md, respectively.
  • Implement a fallback mechanism to maintain backwards compatibility, checking the new locations first and defaulting to the old locations if the files are not found.
  • Consider adding a migration script or process to move existing files to the new location, if necessary.
  • Update documentation and user guides to reflect the new file locations.

Example

import os

# Old locations
old_config_location = os.path.expanduser('~/.claude.json')
old_instructions_location = os.path.expanduser('~/CLAUDE.md')

# New locations
new_config_location = os.path.expanduser('~/.claude/config.json')
new_instructions_location = os.path.expanduser('~/.claude/CLAUDE.md')

# Fallback mechanism
if os.path.exists(new_config_location):
    # Use new location
    config_location = new_config_location
else:
    # Fallback to old location
    config_location = old_config_location

Notes

This solution assumes that the code is written in a language that can easily handle file system operations, such as Python. The exact implementation details may vary depending on the programming language and framework used.

Recommendation

Apply workaround: Update the code to use the new file locations and implement a fallback mechanism to maintain backwards compatibility. This approach allows for a gradual transition to the new file structure while still supporting existing users.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING