---
title: "Always-on agents"
description: "What an always-on agent is, and why you'd want one."
canonical_url: "https://www.harness-sdk.dev/harnessd/docs/always-on"
markdown_url: "https://www.harness-sdk.dev/harnessd/docs/always-on.md"
x_farming_labs_generated_preamble: true
---

# Always-on agents
URL: /harnessd/docs/always-on
LLM index: /llms.txt
Description: What an always-on agent is, and why you'd want one.

<a id="why-always-on-agents" />

## Always-on agents react to events in your life

An always-on agent doesn't wait for your message. When something happens in your services, it starts on its own.

_Interactive demo on the web page._

It sees all your services at once, so it catches what no single app would.

<ScenarioCarousel
  items={[
    {
      from: ["work-calendar", "personal-calendar"],
      title: "A work dinner lands on your friend's birthday",
      message: "The team dinner on Thursday is the same night as Alex's birthday. I drafted a note to the organizer asking to move the dinner to Friday. Send it?",
      action: "Send it",
    },
    {
      from: ["logs", "github"],
      title: "Production starts failing",
      message: "Checkout has been failing since 2:14 PM. It started with yesterday's change to the payment form. I wrote a fix, and the tests pass.",
      action: "Deploy",
    },
    {
      from: ["calendar", "maps"],
      title: "Traffic builds on your way to the airport",
      message: "Traffic to the airport is heavy. Leave by 1:30, half an hour earlier than planned.",
      action: "On my way",
    },
    {
      from: ["calendar", "chat"],
      title: "Your meeting runs over, and the next one starts soon",
      message: "Your call is running over, and the design review starts in 5 minutes. Should I tell the group you'll be 10 minutes late?",
      action: "Yes, tell them",
    },
    {
      from: ["notes", "todos"],
      title: "A call ends",
      message: "From your call with the design team, I added three to-dos: send the mockups, book the follow-up and review the copy.",
      action: "Looks good",
    },
    {
      from: ["email", "cards"],
      title: "A subscription renews next week",
      message: "Your design tool renews on Friday for $24. You haven't opened it since August. Cancel it?",
      action: "Cancel it",
    },
    {
      from: ["chat", "github"],
      title: "You mention a small bug in passing",
      message: "You said the date picker shows the wrong month. I found the bug, fixed it and opened a pull request.",
      action: "I'll review it",
    },
  ]}
/>

<a id="the-trust-fall" />

## Always-on agents get more useful with every service you connect

It needs two things: your data, and access to act on it.

_Interactive demo on the web page._

Each new service overlaps with the ones it has, so what it can do grows faster than what you give it.

## Always-on agents get better the longer you work with them

Each time you give it feedback, it keeps what it learned.

_Interactive demo on the web page._

Over weeks, these pile up into an agent that works the way you do.

## There's only room for one proactive agent in your life

You'll want one always-on agent, the way you carry one phone. Run several, and they all answer the same email.

> pov: you just received exactly one email
>
> Nicholas Charriere (@nichochar), [on X](https://x.com/nichochar/status/2112950310276944354)

<a id="why-build-your-own" />

## You should own your always-on agent

An always-on agent can make you far more productive. But to rely on it for your most important work, you have to trust it, and that starts with owning your data. Don't lock yourself into a walled garden. Build your own, on open tools, on your own machine.

## Anatomy of an always-on agent

Diagram: The parts of an always-on agent. Messaging apps, agentic apps and external services connect to a gateway. The gateway sends events to the coordinator agent, and the coordinator sends tool calls back through it. The coordinator hands work to worker agents, and routines wake it on a timer. harnessd keeps this harness running.

- Messaging apps → Gateway
- Agentic apps → Gateway
- External services → Gateway
- Gateway → Coordinator: events
- Coordinator → Gateway: tool calls
- Routines → Coordinator
- Coordinator → Workers

You talk to a coordinator, which hands work to workers. Routines wake it on a timer. A gateway brings in events from your apps and services and carries its tool calls back out.

## Why not a script

A tmux session and a loop look like enough to keep Claude Code running. Tick what your script already does.

| Your script must | harnessd |
| --- | --- |
| Start it again after it exits | Waits 5 s, doubling up to 5 min. It never gives up. |
| Resume the same conversation, not a new one | Keeps the conversation's id in `state.json` and starts `claude --resume`. |
| Follow the conversation after /clear or /resume | A `SessionStart` hook reports the new conversation. |
| Tell the agent why it restarted | Its first message: `harnessd restarted Claude Code: <reason>. This is the same conversation.` |
| Answer the start-up prompts | Answers the ones it knows and logs each one. A tool's permission prompt is left to you. |
| Come back after a reboot with nobody logged in | A boot service under launchd or systemd. On a Mac it signs in with a token, because the keychain can't be read at boot. |
| Move to a second account at a usage limit | Reads the transcript every 10 s and restarts on the next account. |
| Deliver the events it missed while it was down | Saves its place only once an event shows in the conversation. |

## Sitemap

See the full [sitemap](/sitemap.md) for all pages.
Docs-scoped sitemap: [/docs/sitemap.md](/docs/sitemap.md).
Well-known sitemap: [/.well-known/sitemap.md](/.well-known/sitemap.md).
