CLAUDE_CODE_PROJECT_DIR_NAME

環境変数

CLAUDE_CONFIG_DIR と併用することで、作業ディレクトリのパスから生成される名前の代わりに、文字起こしやオートメモリを保存する projects/ ディレクトリ名を任意に指定できます。

使い方・用途

  • プロジェクトの絶対パスに基づく長いディレクトリ名の代わりに、短く識別しやすい名前を使用できます。
  • CLAUDE_CONFIG_DIR を設定している環境において、ファイルシステムの文字数制限を回避したり、ディレクトリ構造を整理したりする場合に適しています。
  • 使用可能な値は、1〜64文字の英数字、ハイフン、またはアンダースコアです。
英語原文

Set together with CLAUDE_CONFIG_DIR to choose the projects/ directory name Claude Code stores that session's transcripts and auto memory under, in place of one derived from the working directory path. For example, starting Claude Code with CLAUDE_CONFIG_DIR=/srv/tenant-a CLAUDE_CODE_PROJECT_DIR_NAME=work claude stores them under /srv/tenant-a/projects/work/. Claude Code ignores this variable when CLAUDE_CONFIG_DIR is unset, and reads it only from the environment you start claude from, never from a settings file env block. See Name the project directory yourself. Requires Claude Code v2.1.234 or later

関連ドキュメント

関連する変更履歴

v2.1.234(1件)

オプションの環境変数 CLAUDE_CODE_PROJECT_DIR_NAME を追加した。セッションごとに専用の設定ディレクトリを割り当てるホストは、プロジェクト別のトランスクリプトディレクトリに短い名前を選べるようにする。
英語原文を表示
Added the optional CLAUDE_CODE_PROJECT_DIR_NAME environment variable: hosts that give each session its own config directory can choose a short name for the per-project transcript directory

変更後

セッションごとに独立した設定ディレクトリを持つホスト環境では、ワーキングディレクトリのパス全体から自動生成される長い名前に代えて、プロジェクトごとのトランスクリプト保存先ディレクトリに任意の短い名前を付けられるようになる。