Skip to main content

Running the daemon

After installing the .deb, the daemon runs as a systemd user service. Once enabled, it auto-starts whenever you log in — no foreground commands needed.

Enable on login

systemctl --user daemon-reload
systemctl --user enable --now ccmon-daemon

The unit at /usr/lib/systemd/user/ccmon-daemon.service ships with the package — --enable adds it to your login session, and --now starts it immediately.

The daemon binds 127.0.0.1:7777, or the next free port if 7777 is taken (the actual port is written to ~/.local/state/ccmon/port, which both the CLI and the desktop UI read).

Stop / restart / status

systemctl --user stop ccmon-daemon
systemctl --user restart ccmon-daemon
systemctl --user status ccmon-daemon

Live logs

journalctl --user -u ccmon-daemon -f

The daemon also rotates a log file at ~/.local/state/ccmon/daemon.log (10 MB × 3).

Why restarts are safe

Sessions are identified by Claude Code's own session_id — a UUID present in every hook payload. Restarting the daemon never disrupts a running claude session: state is authoritatively kept in memory and mirrored to SQLite at ~/.local/state/ccmon/ccmon.db for crash recovery, so when the daemon comes back up it re-attaches to in-flight sessions on their next event.

Fail-safe

If the daemon is down for any reason, hook scripts exit 0 silently and claude falls back to its normal in-terminal permission prompts. You will never lose a session because the daemon crashed — the worst case is that the desktop UI is bypassed for the duration.