Skip to content
Crystal CodeDocs
ENEnglish

Modes

Plan and Work are product modes, not Crystal types. PlanMode is stored on the session and restored on resume. It is not written to config.json. Switching does not start a new transcript.

/plan toggles Plan and Work. Tab cycles forward from Work to Plan, then through enabled custom modes in name order, and back to Work. Shift+Tab follows the same order backward. With no enabled custom modes, either key switches between Work and Plan. /mode lists modes and /mode <name> switches while idle. Each switch replaces the live system message and refreshes the chrome. The rest of the conversation stays. A new session starts in Work.

Each mode has its own system text and tool executor. A turn uses the executor that is current when the model request runs. The plugin model purpose for that turn is plan or work. A custom mode uses work, and the plugin turn carries the mode name.

Both catalogs start from the built-in tools for that catalog, then add:

  1. Disk plugins listed for that catalog.
  2. External tools listed for that catalog.
  3. skill, when skills are enabled.
  4. describe_image, describe_audio, describe_video, and describe_document when the corresponding model is enabled.

disabledBuiltInTools then removes matching built-in names. view_image is not on the text catalog. It is added only to the multimodal executor, and only while the session model accepts images. The same disable list can remove it.

Plan and Work keep separate disable lists. /tools builtin plan|work show|enable|disable <name> changes the saved list. --disable-tool <name> omits a tool for one process, and plan:<name> or work:<name> targets one mode. /tools builtin session [plan|work] show|enable|disable <name> disables names for the current session only. They are saved in that session file and restored by resume. Fork does not copy them and /clear empties them. A custom mode uses the Work list.

Mode Built-in tools Side effects
Plan read, list, tree, glob, grep, search, todowrite, todoread, question, plus skill and the resource description tools when enabled, plus view_image on image turns, plus task when child Agents are enabled No edit, multi_edit, write, apply_patch, bash, bash_start, bash_status, bash_logs, or bash_stop. Those names are not in the Plan catalog. work is not offered.
Work The Plan built-ins, plus edit, multi_edit, write, apply_patch, and bash. When a background-task registry exists, also bash_start, bash_status, bash_logs, and bash_stop. task when child Agents are enabled After approval. bash uses bashTimeoutSeconds.

External tools listed for Plan stay on the Plan catalog. Their floor is Write + Workspace. Declared path arguments can raise authority or become Forbidden. A tool-provided classifier can raise risk or authority. It cannot lower them. They still go through approval.

A custom mode is a directory modes/<name>/ under ~/.crystal or <workspace>/.crystal, with mode.json and prompt.md.

{
"description": "Review code without changing it",
"enabled": true,
"tools": ["read", "list", "tree", "glob", "grep", "search", "todowrite", "todoread", "question"]
}

description is required and enabled defaults to false. tools lists built-in tool names. An unknown name skips the mode with a note. plan, work, and default are reserved names. A workspace directory replaces the Home directory of the same name, even when it is disabled or invalid.

prompt.md is the system text. It accepts the same {{name}} placeholders as Work and Plan, plus {{mode}}. When the body does not name {{env}}, {{skills}}, {{instructions_section}}, {{disabled_tools}}, {{clock}}, or {{session}}, the host appends that slot. Prompt sets, prompt overrides, and prompt attachments do not edit it.

External and plugin tools join a custom mode from the Work catalog when the mode lists edit, multi_edit, write, apply_patch, or bash, and from the Plan catalog otherwise. A child Agent started from a custom mode is limited to Plan’s tools, even when the mode lists write tools.

A mode does not change approval. Listing bash does not let shell calls skip review or the operator. The mode is saved with the session. A session whose mode is missing or disabled resumes in Work with a note.

--mode <name> starts crystal, crystal space, or crystal run in a mode for that process only. It cannot be combined with --plan or --work.

The Plan catalog omits the side-effect tools, so a normal turn cannot call them. If a call arrives anyway, approval rejects it before classification:

Plan mode does not allow <name>.

That check covers edit, multi_edit, write, apply_patch, bash, bash_start, and bash_stop. bash_status and bash_logs are reads, but they are only built for Work.

Outside Full, a write or edit into a read-only session directory is also rejected before classification:

Writing to a read-only session directory is not allowed. Change its access with /access.

Full auto-passes that write. See Approval, Safety, and Child Agents.