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

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:
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.

Customization flags

You can adjust the daemon’s timing and budget when starting it:

State files

All daemon state lives in ~/.claude/commander/:
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:
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.