The keystone of the agent-nervous-system suite. The other organs — perception, memory, defense, grief — are reflexes: triggered, run, done. On their own they're a body with no pulse. This is the pulse: a self-firing executive loop that wakes on its own, pulls the organs into one workspace, decides what needs attention now, and schedules its own next wake.
It's the difference between an organism and a well-organized corpse.
- The loop — a global-workspace cycle (wake → sense → integrate → decide → act/defer → sleep). The agent's self-initiation: it acts with no human prompt in the loop.
- The frequency — adaptive arousal. Alert (cache-warm, ~60–270s) when something's happening; drowsy (~20–30 min) when idle; deep sleep (long / event-only) when nothing's expected. The governing law: never tick faster than the world you're watching changes.
It's the wake phase to rem-sleep's sleep phase — the loop is what decides when to sleep. Two arcs of one circadian cycle.
This is a global-workspace integration loop and an arousal clock — not a claim about subjective experience. The hard problem is out of scope; continuity, self-initiation, integration, adaptive cadence, and knowing when to stop are in scope. Read "consciousness" as functional executive.
A wake scheduler — a self-scheduling primitive (a ScheduleWakeup-style timed re-invocation), a recurring runner (/loop, cron, a job queue), or, best, an event hook that re-invokes the agent only when state changes. With none, the loop degrades to a single pass plus a recommended next-wake the human triggers.
Works with Claude Code, Codex, and Cursor.
git clone https://github.com/thdelmas/consciousness-loop.git
cd consciousness-loopmkdir -p ~/.claude/skills/consciousness-loop
cp SKILL.md ~/.claude/skills/consciousness-loop/Invoke with /consciousness-loop, or say "set the cadence" / "how often should I wake?" / "keep yourself running."
mkdir -p ~/.agents/skills/consciousness-loop
cp SKILL.md ~/.agents/skills/consciousness-loop/mkdir -p ~/.cursor/commands
cp cursor/consciousness-loop.md ~/.cursor/commands/- Wake — note time since last tick and why (timer vs event).
- Sense — what changed since last tick.
- Integrate — check each organ + the goal/self-model.
- Decide — pick one priority, or conclude nothing needs you.
- Act or defer — one tick, one thing.
- Set the next frequency — choose the interval from arousal.
- Sleep — schedule the next wake (or hand to an event hook). Sleeping is the loop working.
See SKILL.md for the arousal bands, the stop conditions, and the runaway guard.
MIT