()
| 51 | * 2. Default: ~/.claude/plugins or ~/.claude/cowork_plugins |
| 52 | */ |
| 53 | export function getPluginsDirectory(): string { |
| 54 | // expandTilde: when CLAUDE_CODE_PLUGIN_CACHE_DIR is set via settings.json |
| 55 | // `env` (not shell), ~ is not expanded by the shell. Without this, a value |
| 56 | // like "~/.claude/plugins" becomes a literal `~` directory created in the |
| 57 | // cwd of every project (gh-30794 / CC-212). |
| 58 | const envOverride = process.env.CLAUDE_CODE_PLUGIN_CACHE_DIR |
| 59 | if (envOverride) { |
| 60 | return expandTilde(envOverride) |
| 61 | } |
| 62 | return join(getClaudeConfigHomeDir(), getPluginsDirectoryName()) |
| 63 | } |
| 64 | |
| 65 | /** |
| 66 | * Get the read-only plugin seed directories, if configured. |
no test coverage detected