Change the default fallback for `XWIKI_LLM_WORK` in the XWiki LLM plugin

Reporting this here as issues can’t be created on the repository itself.

The XWiki plugin puts, by default, all “temporary” data in the ~/.xwiki-llm/work.

Instead, it should follow established directory conventions instead of polluting the user’s home directory, especially on Windows where dotfiles are not the norm.

Proposal to put the folder (named xwiki-llm or xwiki-llm-temp) in:

  • Linux: $XDG_STATE_HOME, fall back to $HOME/.local/state if not defined
  • Windows: %LOCALAPPDATA%
  • macOS: I’m not a macOS user, but I believe $HOME/.local/state would work too?

Tell me what you think.

Thx. I wasn’t aware of the existence of such a ./local/state dir.

Note that this is new in the xwiki-dev-llm repo. I’ve changed it very recently as before CC was putting data everywhere on my machine (a lot worse than “polluting the user’s home directorty”! It was polluting the whole filesystem…).

A quick search leads to:

Apple stores application data, states, logs, and caches inside the user’s ~/Library folder (~/Library/Application Support, ~/Library/Caches, and ~/Library/Logs).

macOS does not follow the Linux XDG Base Directory Specification by default.

Now mac os is a unix OS so:

Cross-platform command-line tools, developer utilities, or apps ported from Linux (zsh, node, neovim, etc.) may create or use ~/.local/state or ~/.config on macOS if configured to do so.

Users or developers can manually export environment variables like XDG_STATE_HOME to force certain apps to use ~/.local/state on a Mac.

So I guess we could use that even for Mac. On my machine, I have:

vmassol ~/.local/state $ ls -alg
total 0
drwxr-xr-x  6 staff  192 Jun  3 22:14 .
drwxr-xr-x  5 staff  160 Nov  8  2025 ..
drwx------  3 staff   96 Nov  8  2025 claude
drwxr-xr-x  4 staff  128 Jun  3 22:15 gh
drwxr-xr-x  6 staff  192 Jul 24 16:32 opencode
drwxr-xr-x  3 staff   96 Aug  3 09:43 pnpm

Sounds good to me. Waiting for your PR on the xwiki-dev-llm repo.

Thx