skip to content
ccdocs

cc daemon

Manage the CC daemon — a background process that handles all database writes via a Unix socket (JSON-RPC 2.0).

Usage

cc daemon start
cc daemon stop
cc daemon restart
cc daemon status
cc daemon start --foreground

Subcommands

SubcommandDescription
startStart the daemon in the background. No-op if already running.
stopStop the running daemon.
restartStop then start. Use after updating CC to pick up new service functions.
statusShow running state, PID, uptime, RPC count, DB size, and last error.
start --foregroundRun in the foreground (useful for debugging). Logs go to stdout.

Why a daemon?

The CLI, web companion, and VSCode extension can all run at the same time. SQLite only supports one writer at a time — without coordination, concurrent writes corrupt data.

The daemon is the single writer. All writes go through it via the Unix socket at ~/.cc-cli/cc.sock. Reads can still go directly to the database (safe — SQLite supports unlimited concurrent readers).

Auto-start

The daemon starts automatically when any CC command needs to write — you don't need to run cc daemon start manually. Use it explicitly to restart after an update or to check status.

RPC introspection

cc api system.describe        # full schema of all registered RPC methods
cc api system.describe_models # ORM model field schema with semantic hints

Files

PathDescription
~/.cc-cli/cc.sockUnix socket — active while daemon is running
~/.cc-cli/cc-daemon.pidPID file
~/.cc-cli/logs/cc.logDaemon log (rotating)
  • cc web — companion app; all its writes go through the daemon
  • docs/internals.md — full architecture overview

On this page