Skip to content

[FEATURE] Feature request: CLAUDE_CONFIG_DIR environment variable to control .claude/ directory location #28808

Description

@nvanwyen

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

Summary

Add support for a CLAUDE_CONFIG_DIR environment variable (or similar mechanism) that allows users to specify a fixed location for the project-level .claude/ directory, regardless of
where claude is started from.

Motivation

Currently, the project-level .claude/ directory (containing settings.local.json, CLAUDE.md, etc.) is always created relative to the current working directory. This makes it
difficult to:

  • Maintain a single, centralized configuration when working across many directories
  • Avoid scattering .claude/ directories throughout the filesystem
  • Use Claude Code from temporary or ephemeral directories while preserving settings

Proposed Solution

Proposed Solution

Support an environment variable like CLAUDE_CONFIG_DIR that overrides the default project-level .claude/ path:

export CLAUDE_CONFIG_DIR="$HOME/.config/claude-code"

When set, all project-level config files (settings.local.json, CLAUDE.md, rules, etc.) would be read from and written to this directory instead of ./.claude/.

Alternative Solutions

Alternatives Considered

  • Symlinking .claude/ in each project directory (manual, error-prone)
  • Using --settings flag (only adds settings, doesn't redirect the full config directory)
  • Always starting Claude from the same directory (impractical)

Priority

Medium - Would be very helpful

Feature Category

CLI commands and flags

Use Case Example

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions