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 --foregroundSubcommands
| Subcommand | Description |
|---|---|
start | Start the daemon in the background. No-op if already running. |
stop | Stop the running daemon. |
restart | Stop then start. Use after updating CC to pick up new service functions. |
status | Show running state, PID, uptime, RPC count, DB size, and last error. |
start --foreground | Run 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 hintsFiles
| Path | Description |
|---|---|
~/.cc-cli/cc.sock | Unix socket — active while daemon is running |
~/.cc-cli/cc-daemon.pid | PID file |
~/.cc-cli/logs/cc.log | Daemon log (rotating) |
Related
cc web— companion app; all its writes go through the daemondocs/internals.md— full architecture overview