Data directory
Override with CRYSTAL_HOME or --home.
~/.crystal/ binaries/code/CrystalCode (CrystalCode.exe on Windows) config.json providers.json providers/ <name>.json <category>/<name>.json credentials.json permissions.json trusted.json access.json instructions.md AGENTS.md web/ index.html prompts/ work.md plan.md review.md review.user.md review.extended.md review.extended.user.md topic.md compaction.system.md compaction.user.md image.system.md image.user.md agents/ general.md work.md plan.md promptsets/ concise/ prompt.json work.md plan.md review.md review.user.md review.extended.md review.extended.user.md topic.md compaction.system.md compaction.user.md image.system.md image.user.md agents/ general.md work.md plan.md prompt-attachments/ <name>/ prompt.json work.md plan.md review.md agents/ general.md work.md plan.md skill/<name>/SKILL.md skills/<name>/SKILL.md modes/<name>/mode.json modes/<name>/prompt.md tools/<directory>/tools.json data/tools/<directory>/ mcp.json mcp/<name>/server.json plugins/<directory>/plugin.json data/plugins/<directory>/ agents/<name>/ agent.json prompt.md sessions.db sessions/<id>.json server/<pid>.json logs/Project overlay (named prompts, prompt attachments, child Agent definitions, custom modes, MCP servers, Crystal skills, tool sets, and plugins of the same directory name win over home):
<workspace>/.crystal/ instructions.md prompts/ work.md plan.md review.md review.user.md review.extended.md review.extended.user.md topic.md compaction.system.md compaction.user.md image.system.md image.user.md agents/ general.md work.md plan.md prompt-attachments/ <name>/ prompt.json work.md plan.md review.md agents/ general.md work.md plan.md skill/<name>/SKILL.md skills/<name>/SKILL.md modes/<name>/mode.json modes/<name>/prompt.md tools/<directory>/tools.json mcp.json mcp/<name>/server.json plugins/<directory>/plugin.json agents/<name>/ agent.json prompt.md data/tools/<directory>/ data/plugins/<directory>/<workspace>/.crystal.md<workspace>/AGENTS.mdPrompt files named review.extended.md and review.extended.user.md override the extended approval prompts, in the same places as the other named files. The user template adds {{primary_review}}. See Approval.
server/<pid>.json is the discovery file of a running crystal server. It holds the URL, pid, workspace, build identity, and the token when the server generated it, with owner-only permissions in an owner-only directory. The server deletes it on exit; a file left by a crashed process names a dead pid. See Server.
Home files such as config.json and session files are replaced in one step, so a crash never leaves a half-written file.
config.json is not part of the project overlay. Workspace-level configuration is deferred.
access.json stores default extra directories for each canonical workspace root.
| Event | What happens to the defaults |
|---|---|
New session, /clear, /fork, successful /cd or /space |
Copies the defaults into the session |
/resume |
Keeps the saved rules. Does not add defaults back |
Any --allow-read or --allow-write |
Replaces the defaults for this process. Not saved |
A missing directory or a credential path is skipped with an error and left in the file. A corrupt file, or two modes for one directory, seeds nothing. The session still opens.
Plugins and tool sets keep runtime data under data/, split by kind.
| Root | Path |
|---|---|
| Global | ~/.crystal/data/{plugins|tools}/<directory>, shared across workspaces |
| Project | <workspace>/.crystal/data/{plugins|tools}/<directory> |
The host creates both the first time the extension receives them, at plugin attach or before a tool call. They are separate from the install trees and are not a secret store.
plugins/<directory>/plugin.json loads one operator plugin. .NET tool sets still load class libraries from the tool-set directory only. See Plugins.