Daemon

The daemon is an optional speed-up. The Gradle composePreviewRender task is the canonical render path (and what CI uses); the daemon just makes interactive re-renders fast.

What it is

A persistent preview server that replaces the per-save Gradle invocation with a long-lived JVM holding a hot Robolectric (Android) or Compose-Desktop renderer. A cold Gradle render is 10s+; a warm daemon render is a fraction of that. It’s what the VS Code extension and the MCP server drive behind the scenes.

It’s configured with composePreview.daemon { ... } and defaults on for editor use. You don’t start or manage it by hand — the extension and MCP server bring it up as needed.

What ships

  • :daemon:core — renderer-agnostic JSON-RPC server, protocol types, preview index, classloader holder, classpath fingerprint, history manager.
  • :daemon:android — Robolectric backend; holds a sandbox open across renders.
  • :daemon:desktop — Compose-Desktop backend; holds a warm render thread.
  • :mcp — multiplexes per-(workspace, module) daemons behind one MCP surface (see Agents & MCP).

Going deeper

The full design docs live in docs/daemon/:

  • DESIGN.md — architecture, lifecycle, leak defense, decisions log.
  • PROTOCOL.md — the v1 client ↔ daemon wire format.
  • CONFIG.md — the composePreview.daemon { … } DSL.
  • MCP.md — daemon ↔ MCP mapping and tool surface.

</content>


Apache 2.0 licensed. Source on GitHub.

This site uses Just the Docs, a documentation theme for Jekyll.