Skip to content
Crystal CodeDocs
ENEnglish

Overview

New to Crystal Code? Follow Your first session to install it, choose a model, and connect from your browser.

Crystal Code is a coding TUI for a local repository. The terminal, crystal server, crystal web, and crystal bridge are the operator surfaces. It streams a model-and-tool loop, with Plan, Work, and custom modes, approval, compaction, and operator data under ~/.crystal.

crystal run runs one task without a terminal. Anything that would ask the operator is denied. crystal server serves one session over HTTP to other front ends, while crystal web can host your own front end; see Server. crystal bridge serves one session to an Agent Client Protocol (ACP) editor such as Zed over stdio; see Bridge.

Crystal Code uses the Crystal library. It does not modify Crystal, and it does not replace it.

In the workspace you want the agent to inspect or change:

  • Streams a turn with tool calls, and queues follow-ups while the turn runs.
  • Retries a failed model round on rate limits, server errors, timeouts, network faults, and incomplete streams.
  • Switches provider and model with /model.
  • Plan reads. Work can edit, write, apply multi-file patches, and run shell commands. Operators can add custom modes under modes/.
  • Approves side effects manually, with a reviewing model, or by policy.
  • Compacts context as usage approaches the selected window.
  • Delegates a bounded task to a child session when child Agents are enabled. They are off by default.
  • Stores configuration, permissions, and sessions under ~/.crystal.
  • Calls DeepSeek, OpenAI-compatible Chat Completions, OpenAI Responses, and Anthropic Messages, including endpoints you add.

Built-in tools and provider adapters register through one in-process plugin table. Add tool sets under ~/.crystal/tools and <workspace>/.crystal/tools. Add plugins under ~/.crystal/plugins and <workspace>/.crystal/plugins. Connect MCP servers through mcp.json in ~/.crystal and <workspace>/.crystal. See MCP servers.

Two pieces are maintained outside the executable and installed by hand. The provider and model catalog beyond the starter entries comes from a separate repository; see Model catalog. Web search and page fetch come from the official Web plugin; see Web plugin.

Not in this build: a NuGet package; MCP resources, prompts, elicitation, and roots (MCP tools are in this build); a refactor of crystal run; image generation; a built-in web search tool; fetching a provider’s model list; a full code review; provider-specific custom-format tools other than the apply_patch text tool; .NET CLI tool support and other packaging support; an operating-system sandbox; audio and video input; non-text model output; and editing provider definitions in the TUI.

Thinking-chain compression is also not in this build. It would, after each thinking pass, ask a model to compress and summarize that thinking. Context compaction, microcompaction, /verbose thinking, and a provider’s summarized thinking display are not that path.

Child Agents are in this build and off by default. See Child Agents.

Built-in protocols are DeepSeek, OpenAI-compatible Chat Completions, OpenAI Responses, Anthropic Messages, Gemini, and Ollama. A plugin can add another protocol. Image input works for models and providers that support it.