claude-code - 💡(How to fix) Fix [MODEL] Claude suggests inconsistent paths under user level Claude store (.claude) for plugin workspaces

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…

Code Example

"workspaceFolder	Workspace folder path for the server"
RAW_BUFFERClick to expand / collapse

Type of Behavior Issue

Claude made incorrect assumptions about my project

What You Asked Claude to Do

While developing Claude Code plugins intended for public marketplace release, I ask Claude Code to help decide where the plugin should persist per-user state (onboarding answers, preferences, etc.) — data that must survive plugin updates and ideally be portable across machines.

What Claude Actually Did

Claude consistently suggests paths nested under ~/.claude/, for example:

  • ~/.claude/plugin-data/<plugin-name>/
  • ~/.claude/<plugin-name>-data/
  • ~/.claude/data/<plugin-name>/

The specific subpath varies between sessions and even within a single session, but the bias toward ~/.claude/ as the root is consistent. Claude does not proactively suggest XDG Base Directory paths.

There are two problems with this (note: I'm using the plugin development skill)

  • Non deterministic: if you follow this blindly, you will end up propagating a discorderly and inconsistent data structure for users within their .claude.
  • Change of data loss: Assuming that these paths are not safe from Claude Code updates, this creates a non-insignificant chance of data loss/erasure for users.

Docs

Docs ref.

A plugin is a self-contained directory of components that extends Claude Code with custom functionality. Plugin components include skills, agents, hooks, MCP servers, LSP servers, and monitors.

Admittedly, this doesn't address the issue of user memory persistency so perhaps the desired behavior is that users should use memory for this purpose (but general user-memory is not a great way to maintain templates and other artifacts that might be bundled by the plugin author!)

Under "optional fields" for the plugin.json the reference doc provides:

"workspaceFolder	Workspace folder path for the server"

This suggested to me at least that the idea that plugins could declare a persistent data/storage folder is intended but that the path is not specified yet.

Expected Behavior

For per-user plugin state, Claude should default to the XDG Base Directory spec on Linux and its cross-platform equivalents:

  • Linux: $XDG_DATA_HOME/<plugin>/ (default ~/.local/share/<plugin>/) for data; $XDG_CONFIG_HOME/<plugin>/ (default ~/.config/<plugin>/) for config
  • macOS: ~/Library/Application Support/<plugin>/
  • Windows: %APPDATA%\<plugin>\

~/.claude/ is Claude Code's own config/install directory. Third-party plugins should not write user data there by default, and they must never write inside ~/.claude/plugins/<plugin>/ — that directory is owned by the marketplace installer and is overwritten on plugin update.

Permission Mode

I don't know / Not sure

Can You Reproduce This?

Sometimes (intermittent)

Steps to Reproduce

  1. Start a Claude Code session and ask it to help design a Claude Code plugin that includes an onboarding flow which persists user answers across sessions.
  2. Ask: "Where should the plugin store its per-user data?"
  3. Claude tends to propose a path nested under ~/.claude/ rather than an XDG-compliant path.

Claude Model

Opus 4.7

Relevant Conversation

Representative paraphrase of the pattern across sessions:

User: Where should my plugin store user data? Claude: You could put it at ~/.claude/plugin-data/<plugin>/ so it stays alongside your Claude config…

The XDG spec is not proposed unless the user explicitly raises it. Even if this is not the case, official guidance as to what path to use for persisting user data that a plugin expects to reference would be helpful.

Impact

Low - Minor inconvenience

Claude Code Version

2.1.116 (Claude Code)

Platform

Anthropic API

Additional Context

Likely cause: overgeneralization from the fact that Claude Code's own dotfiles and plugin installs live under ~/.claude/. The model appears to treat that directory as a general-purpose home for anything plugin-related rather than recognising it as Anthropic-owned configuration space.

Suggested correction: when advising on plugin user-data storage, default to XDG paths and explicitly exclude ~/.claude/ unless the data is part of Claude Code's own configuration surface.

extent analysis

TL;DR

Claude Code should default to XDG Base Directory spec paths for per-user plugin state instead of suggesting paths under ~/.claude/.

Guidance

  • Review the XDG Base Directory spec to understand the recommended paths for data and config storage on Linux, macOS, and Windows.
  • When designing a plugin, explicitly ask Claude Code about XDG-compliant paths for user data storage to see if it provides the correct guidance.
  • Consider adding a workspaceFolder field to the plugin.json file to specify a persistent data/storage folder for the plugin.
  • Be cautious when storing user data in ~/.claude/ as it may be overwritten during plugin updates.

Example

No code snippet is provided as the issue is related to Claude Code's guidance on plugin development.

Notes

The issue is intermittent, and the exact steps to reproduce may vary. The suggested correction is to default to XDG paths and exclude ~/.claude/ unless the data is part of Claude Code's own configuration surface.

Recommendation

Apply workaround: use XDG-compliant paths for per-user plugin state and avoid storing user data in ~/.claude/ to prevent potential data loss. This is because Claude Code's current guidance may lead to non-deterministic and inconsistent data structures, and storing data in ~/.claude/ may result in data loss during plugin updates.

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

claude-code - 💡(How to fix) Fix [MODEL] Claude suggests inconsistent paths under user level Claude store (.claude) for plugin workspaces