claude-code - 💡(How to fix) Fix Allow configurable .claude/ directory location (support parent directory) [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#46963Fetched 2026-04-13 05:45:10
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Author
Timeline (top)
labeled ×2commented ×1
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • This is a single feature request (not multiple features)

Problem Statement

Problem

When running Claude Code from a project subdirectory, the CLI always creates .claude/ inside that project root. This pollutes the project directory with tool infrastructure files (worktrees, plans, sessions).

Other AI CLI tools like Codex store their state folder in a parent directory and work with child projects without creating per-project folders.

Current behavior

Parent dir has .claude/ with memories Project dir gets its own .claude/ with worktrees, plans, memory redirect

Proposed Solution

Desired behavior

Allow .claude/ to live only in a parent directory with project-specific subfolders (e.g., .claude/worktrees/MyProject/) Suggested implementation

A setting like "projectStateDir": "parent" in ~/.claude/settings.json

Alternative Solutions

No response

Priority

Medium - Would be very helpful

Feature Category

CLI commands and flags

Use Case Example

No response

Additional Context

No response

extent analysis

TL;DR

The issue can be addressed by introducing a configuration option to specify the location of the .claude/ directory, allowing it to reside in a parent directory with project-specific subfolders.

Guidance

  • Introduce a new setting, such as "projectStateDir" in ~/.claude/settings.json, to control the location of the .claude/ directory.
  • Update the CLI to respect this setting and create the .claude/ directory in the specified location, rather than the current working directory.
  • Consider adding a command-line flag to override the setting, allowing users to specify the directory location on a per-command basis.
  • Verify the fix by running Claude Code from a project subdirectory and checking that the .claude/ directory is created in the expected location.

Example

// ~/.claude/settings.json
{
  "projectStateDir": "parent"
}

This example shows how the projectStateDir setting could be configured in the ~/.claude/settings.json file.

Notes

The proposed solution assumes that the .claude/ directory can be safely moved to a parent directory without disrupting existing functionality. Additional testing may be necessary to ensure that this change does not introduce any regressions.

Recommendation

Apply workaround: Introduce the projectStateDir setting and update the CLI to respect it, as this allows users to control the location of the .claude/ directory and avoid polluting the project directory with tool infrastructure files.

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