demon Interactive version →
Introducing demon

demon

AI that watches, and acts on its own judgment, instead of waiting to be called.

$ npm i -g @josharsh/demon-cli
A new primitive

Parallel to the agent, not a version of it.

Since LLMs arrived, one shape wrapped them: the agent, a function you invoke. demon is the other shape, a process that runs on its own. Two primitives, for two kinds of work.

established
agent
invoke → run → return
A function. Best when you already know what to ask.
vs
new
demon
watch → judge → act
A process. Best for what you'd never think to ask in time.

When large language models arrived, the whole industry reached for one shape to wrap them in: you give the model a task, it thinks, it calls some tools, it returns a result. We called that an agent. It is a good shape. It is not the only one.

The thing an agent cannot do

To call an agent, you must already know that you need it. You must know the question to ask. "Review this PR." "Summarize these docs." Every one of those starts with you noticing that there is work to be done.

But a large share of the problems that actually matter are the ones nobody notices until they have already compounded. The error rate that crept up after a deploy. The customer who went quiet two weeks before renewal. The contributor's first pull request, unreviewed for twelve days, who is about to give up.

An agent could analyze any of these perfectly, if you thought to ask it. You didn't, because you didn't know. The value was never in the reasoning. It was in noticing. And noticing requires something that is always present, and allowed to act on its own judgment.

Inversion of control

The difference is structural, not cosmetic. An agent borrows your call stack: you call it, it runs, it returns, it is gone. A demon owns its own loop. The model stops being the thing in charge and becomes a subroutine the process calls, only when something observed is worth reasoning about.

you agent call return you drive it process (always on) LLM observe, judge, act it drives itself, and calls the LLM only when warranted
An agent is a there-and-back call. A demon owns the loop.

What Unix already figured out

We did not invent the answer. Unix did, fifty years ago. A daemon is a process that runs in the background with no terminal and no one invoking it. sshd does not wait for you before accepting a connection. cron does not ask whether it is time. A daemon is simply there, part of the system's steady state.

And the word is older than Unix. The Greek daimon was a guiding presence. Socrates described his as a voice that never gave him tasks and never commanded, but exercised continuous judgment, mostly to restrain him. Not a servant. A standing presence with a purpose. We took the LLM out of the function-call box and put it inside that loop.

The cycle

Every cycle, the process does exactly one thing. It collects what it can observe, it asks the model a single question, and then it acts, or it waits. Most cycles, it waits.

observe judge act / wait every cycle, forever
The model is called at "judge", and only there.

It remembers what changed, and when

A demon that has watched your repo for a month is worth more than one started this morning. Its memory is not bolted-on retrieval. When a fact stops being true, it does not erase it. It closes that fact's validity interval and opens a new one. History is preserved, and nothing drifts.

ci: passing ci: failing now cycle 1 cycle 2
The "passing" fact is closed, not deleted, when "failing" is observed.

What a run looks like

Point a demon at a domain, say the open pull requests on a repository, and it stays there. Most cycles, nothing. When something genuinely warrants action, it acts, with no prompt and no invocation.

demon · payments-sentinel · watching acme/payments
09:00WAITED3 open PRs, all moving. CI green on main.
09:15WAITEDPR #212 pushed new commits with tests. Healthy.
09:31ACTEDPR #207 has sat 4 days, no review, from a first-time contributor. Pinged the lead before they give up.
09:46WAITEDNo change since last cycle.
10:02ACTEDDependabot #214 bumps lodash. Coverage on cart.ts fell 8% in #213. Flagged on the PR.
10:18WAITED#214 merged, coverage restored. Quiet again.

An agent could catch any of these, if you thought to ask it. A demon did not need asking.

Four properties, together

None of these alone is new. The combination is. No wrapped agent has all four.

Run one

It installs as a binary. On first run it asks once which provider should power your demons, then it is quiet until something matters.

terminal
$ npm install -g @josharsh/demon-cli
$ demon start "watch open PRs on my-org/repo and flag what needs attention"
$ demon logs my-demon --follow

That is the whole thing. A process, watching, with a purpose. It will tell you when something matters, and stay quiet when nothing does. We think this is a real primitive, and we think it has been missing. The best way to find out is to run one and see if it notices something you would have missed.