Skip to content
Development
Skill

/daemon

Continuous autonomous operation mode. Keeps campaigns running 24/7 by chaining Claude Code sessions via RemoteTrigger. Each session picks up from the campaign's continuation state, works until context runs low or the phase completes, then schedules the next session. Auto-stops

From plugin
citadel
92248 skills7 agents2 MCP
Install
$ npx -y skills add SethGammon/Citadel --skill daemon --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/daemon

Context preview

The summary Claude sees to decide when to auto-load this skill.

Continuous autonomous operation mode. Keeps campaigns running 24/7 by chaining Claude Code sessions via RemoteTrigger. Each session picks up from the campaign's continuation state, works until context runs low or the phase completes, then schedules the next session. Auto-stops

SKILL.md

daemon.SKILL.md
name: daemon
license: MIT
description: >-
  Continuous autonomous operation mode. Keeps campaigns running 24/7 by
  chaining Claude Code sessions via RemoteTrigger. Each session picks up
  from the campaign's continuation state, works until context runs low or
  the phase completes, then schedules the next session. Auto-stops on
  campaign completion or budget exhaustion. The thing that makes Citadel
  run overnight.
user-invocable: true
auto-trigger: false
trigger_keywords:
  - daemon
  - continuous
  - run overnight
  - keep running
  - 24/7
  - unattended
  - run autonomously
  - daemon start
  - daemon stop
  - daemon status
last-updated: 2026-03-28

/daemon -- Continuous Autonomous Operation

Architecture, daemon.json field reference, and rationale: docs/DAEMON.md.

Orientation

**Use when:** running campaigns overnight or unattended -- chains sessions automatically until a ceiling or budget is hit. **Don't use when:** a single autonomous session is enough (use /archon); you want manual control between cycles (use /loop).

Default execution path (READ FIRST)

**`/daemon start` does NOT call `RemoteTrigger` by default.** The local runner is the default. Only pass `--remote` to use Anthropic's routine system, and only after explicit user confirmation.

**Why:** `RemoteTrigger` counts against the account-wide **15 routine runs / 24h** cap. A single overnight run can exhaust the quota and pause every other routine on the account (including unrelated ones). See [docs/ROUTINE-QUOTA.md](../../docs/ROUTINE-QUOTA.md).

Default flow — `/daemon start` (no `--remote` flag)

1. Do Steps 1, 2, and 4 below (validate, check existing, write `daemon.json`). 2. **Skip Step 3** — do NOT create any `RemoteTrigger`. Leave `chainTriggerId` and `watchdogTriggerId` as `null` in the state file. 3. Instead of Step 5's trigger-confirmation, output the local-runner instructions (full text: docs/DAEMON.md#local-runner-default): the state file path, campaign, and budget, then:

   To start the tick loop, run in a separate terminal:
     npm run daemon:local

   Leave that terminal open. It spawns `claude --permission-mode default -p "/do continue"` each
   session, respects daemon.json status, and consumes zero Anthropic
   routine quota. Stop with Ctrl+C or `/daemon stop`.

   For true unattended background operation (machine sleeps, user away):
     /daemon start --remote    (uses RemoteTrigger, counts against 15/day cap)

Local execution safety

After approval of the campaign, finite budget and session limit, set `localRunnerEnabled: true` in daemon.json for the local runner. The default limit is 10 sessions; `--max-sessions N` requires a positive integer. A finite positive budget and valid estimatedSpend are required. The runner stops on failed execution and rechecks state before each spawn. Normal runtime permission checks remain enabled. The noninteractive environment variable alone does not authorize continuation. Remote starts leave this local opt-in disabled. See [runner safety and migration](../../docs/ISSUE-278-SECURITY.md).

Codex automation lane

In Codex, prefer a Codex Automation for durable unattended daemon ticks when available: `node scripts/codex-automation.js plan --type daemon --command "/daemon tick" --cadence "<interval>" --target background-worktree --write`. Use the returned prompt in the Codex app automation surface. Each run must still read and update `.planning/daemon.json`; Codex owns the scheduling, Citadel owns the budget/status gates and run log.

Opt-in routine flow — `/daemon start --remote`

Only when the user has explicitly passed `--remote`: 1. Before proceeding, confirm: "This will use Anthropic's `RemoteTrigger`, which counts against your 15 routine runs / 24h quota. A single overnight daemon can exhaust it. Continue? (y/N)" 2. If the user confirms, run the full Step 1-5 protocol below (including Step 3's trigger creation).

Commands

| Command | Behavior | |---|---| | `/daemon start` | Default: create state file, prompt user to run `npm run daemon:local` (zero routine cost) | | `/daemon start --remote` | Use `RemoteTrigger` instead (counts against 15/day routine quota — requires confirmation) | | `/daemon start --campaign {slug}` | Target a specific campaign | | `/daemon start --budget {N}` | Set budget cap in dollars (default: $50) | | `/daemon start --budget unlimited` | Explicitly disable budget cap | | `/daemon start --interval {N}m` | Set watchdog interval (default: 30m) | | `/daemon start --cooldown {N}s` | Set delay between sessions (default: 60s) | | `/daemon start --cost-per-session {N}` | Override per-session cost estimate (default: $3) | | `/daemon stop` | Stop the daemon, tear down triggers | | `/daemon status` | Show daemon state, session count, budget remaining | | `/daemon log` | Show recent daemon session history | | `/daemon tick` | Internal: heartbeat handler fired by triggers. Not user-facing. |

Protocol

/daemon start

**Step 1: Validate prerequisites**

1. Check `.planning/` exists. If not: "No planning directory found. Run `/do setup` first." 2. Find the target campaign: if `--campaign {slug}` provided, read `.planning/campaigns/{slug}.md`; otherwise scan `.planning/campaigns/` (excluding `completed/`) for files with `status: active` in frontmatter. No active campaign → "No active campaign. Start one with `/archon` first." Multiple active and no flag → list them, ask user to specify. 3. Verify the campaign has a Continuation State section (Archon knows where to resume) 4. Parse budget: default `$50`. `--budget unlimited` → set budget to `Infinity`, warn: "No budget cap. You will not be protected from runaway costs. Monitor usage at your Anthropic dashboard." `--budget {N}` → parse as number, must be > 0. 5. Parse cost-per-session: `--cost-per-session {N}` if provided; else the campaign's `estimated_cost_per_loop` frontmatter field if present (improve campaigns set this to 12); otherwise default `$

Read more
Ships withcitadel

An open-source operating layer for Claude Code and OpenAI Codex. Citadel routes requests, preserves repository state between sessions, coordinates parallel work, applies repository safeguards, and records evidence and handoffs around the coding agent you

Get the whole plugin

Other skills on citadel.