Skip to main content
Daemon Mode runs CC Commander as a background process that keeps working on your project even when you close your terminal. It operates on a tick loop, checking a task queue every 5 minutes, dispatching work to Claude, and periodically running a “dream” cycle to consolidate session knowledge. State is stored in ~/.claude/commander/ and persists across reboots.

Starting and stopping the daemon

ccc --daemon          # Start the daemon (runs in background)
ccc --daemon-stop     # Stop the daemon
When the daemon starts, it writes its PID to ~/.claude/commander/daemon.pid and logs all activity to ~/.claude/commander/daemon-log.txt. The log file rotates automatically at 1 MB.

Managing the task queue

You interact with a running daemon by queuing tasks from any terminal:
ccc --queue "fix login bug"       # Add a task to the queue
ccc --queue-list                  # Show all pending tasks and their status
Tasks are stored in a priority-based, file-backed queue. The daemon picks up the next task on each tick, dispatches it to Claude using the Opus model with up to 30 turns and a $5 budget per task, and records the result back to the queue. Knowledge is extracted from each completed session and stored for future dispatches.
The daemon uses the same Intelligence Layer as interactive dispatches — complexity scoring, stack detection, and knowledge retrieval all run before each task is sent to Claude.

How the tick loop works

Every 5 minutes (by default), the daemon runs a tick:
1

Process the task queue

The daemon calls queue.getNext() to find the highest-priority pending task and marks it as running.
2

Check git status

If the working directory has more than 10 uncommitted changes, the daemon logs a warning. It does not commit automatically — that remains your responsibility.
3

Enforce the budget

Each tick has a time budget (15 seconds by default). If the tick takes longer than the budget before dispatching, the dispatch is skipped and logged.
4

Dispatch the task

The daemon calls dispatchWithRetry with the task, which handles rate limit waits, context overflow retries, and budget exceeded errors automatically.
5

Extract knowledge

After a task completes, the daemon extracts lessons (keywords, category, error patterns, success patterns) and stores them in ~/.claude/commander/ for future sessions.

Dream mode

Once per hour (by default), the daemon runs a dream cycle instead of a tick. Dream mode consolidates the knowledge base: it aggregates lessons from completed sessions, calculates success rates, archives old entries, and surfaces improvement suggestions in the log.
[daemon] Dream: starting consolidation...
[daemon] Dream: 47 lessons, 89% success, $12.40 total cost, 3 archived
[daemon] Dream suggestion: JWT + httpOnly cookies pattern works reliably with Next.js middleware

Customization flags

You can adjust the daemon’s timing and budget when starting it:
FlagDefaultWhat it controls
--interval 120300 (5 min)Tick interval in seconds
--tick-budget 3015Time budget per tick action in seconds
--dream 3060Dream cycle interval in minutes
# Tick every 2 minutes, dream every 30 minutes
ccc --daemon --interval 120 --dream 30

# Tick every 5 minutes with a tighter action budget
ccc --daemon --tick-budget 10

State files

All daemon state lives in ~/.claude/commander/:
FileWhat it contains
daemon.pidPID of the running daemon process
daemon-log.txtFull activity log (rotates at 1 MB to daemon-log.txt.old)
queue.jsonTask queue with status, priority, and results
state.jsonUser settings — name, level, cost ceiling, theme
knowledge/Session lessons for the knowledge compounding engine
yolo-stopCreate this file to halt a Night Mode loop gracefully
Do not delete ~/.claude/commander/ while the daemon is running. Stop it first with ccc --daemon-stop, then make any changes.

Checking daemon status

The daemon status is visible from inside Claude Code:
/ccc daemon
This shows whether the daemon is running, the PID, the last tick time, and the current queue contents.
Daemon Mode pairs well with Night Mode. Start an overnight YOLO build for complex features, and use the daemon queue for smaller incremental tasks — bug fixes, dependency updates, documentation — that should be processed when Claude has capacity.