Concept

What is an AFK agent?

An AFK agent is an AI coding agent that runs tasks, verifies its own work, and reaches a clear terminal state, without requiring a human at the keyboard. When it finishes, it notifies you asynchronously. When it’s stuck, it stops and asks instead of guessing.

  • Terminal states: every run ends Done, Blocked, Asking, or Interrupted
  • Self-verification: a separate agent checks the work
  • Reversibility gates: irreversible actions require approval
  • Async notification: results reach you after the fact

“AFK” comes from gaming (Away From Keyboard). In the context of AI coding agents, it describes a specific design posture: the agent is built around the assumption that no one is watching. That changes what the agent has to do. It needs terminal states so it knows when to stop. Self-verification so “finished” means “checked.” Reversibility gates so unattended mistakes are bounded. And a communication channel that reaches you after the fact, not during.

We built Agent AFK around this idea and coined the term to name a design pattern we think is real: the gap between “coding agent” and “fully autonomous.” Other tools may fit this pattern; we defined it to describe what we were building. This page explains the concept as we understand it.

Where AFK agents sit on the autonomy spectrum

Not every AI coding tool works the same way. The difference is how much of your attention they need.

  1. ChatbotYou ask, it answers, it waits.Human role: Driver · e.g. ChatGPT, Claude chat
  2. CopilotSuggests code as you type. Needs you present.Human role: Pilot · e.g. GitHub Copilot, Cursor Tab
  3. Coding agentTakes a task and acts on it. Can edit files, run commands, iterate.Human role: Supervisor · e.g. Claude Code, Aider, Cline
  4. AFK agentYour primary coding agent. Runs the full task end-to-end, verifies the result, and reaches a terminal state without anyone watching. Notifies you when done.Human role: Owner · e.g. Agent AFK
  5. Software factoryAgents work a backlog on a schedule: pick up issues, write fixes, review them, open pull requests. The human sets direction and decides what ships.Human role: Stakeholder · e.g. Scheduled Agent AFK jobs, Sandcastle

Build an AFK software factory with Agent AFK

A software factory is a set of agents that works through a backlog on its own: it picks up issues, writes the fixes, reviews them, and opens pull requests. Run it while you’re away and people call it an AFK software factory. With Agent AFK, each station is an AFK agent job on the daemon’s schedule. We’ve run one on Agent AFK’s own repository.

Stations on a schedule

The daemon runs any prompt or skill on a cron schedule. In ours, one job takes the next well-scoped open issue every hour and opens a pull request for it, and another reviews new pull requests and posts the review.

Isolated, then checked

A job can work in its own git worktree, so parallel jobs never touch each other’s changes. It can split long tasks across subagents and have a separate subagent review the work before it reports Done.

You choose the gates

Every run ends Done, Blocked, Asking, or Interrupted and reports to Telegram. The jobs are prompts and skills in plain files, so you decide where a person steps in. In ours, the factory opens pull requests and a human merges them.

AFK agent vs. interactive coding assistant

Most coding agents can run without you present. The question is whether they were designed for it.

PropertyInteractive agentAFK agent
Requires you per turnYesNo
Runs overnight / headlessFragileBy design
Verifies its own workSometimesStructurally
Iteration speedFast — direct feedback every few secondsSlower — verification adds overhead per cycle
Knows when to stopNo formal terminal state (user must verify)Terminal states: Done, Blocked, Asking, Interrupted
Notifies you out-of-bandNoYes: Telegram by default, extensible
Explains what it didScrollbackOn-disk trace with every step
Install freenpm install -g agent-afk

How an AFK agent works

Running without supervision is an architectural decision, not a checkbox. These are the properties that have to hold for unattended execution to be safe.

Terminal states

Every run ends in one honest place: Done, Blocked, Asking, or Interrupted. The agent can’t drift into an ambiguous middle ground. If it finishes, it says so with evidence. If it’s stuck, it says what’s blocking it. If it needs you, it asks one specific question and waits.

Self-verification

“Finished” has to mean “checked.” In Agent AFK, verification is dispatched as a separate subagent with no shared context; it re-derives claims from scratch, runs tests, and reviews the work independently. The agent that built it is not the agent that reviews it.

Reversibility discipline

Unattended execution is only safe if irreversible actions are gated. Small blast-radius work (edits, scratch files) runs freely. Large blast-radius work (pushes, deletes, external calls) requires verification or explicit intent. Blast radius determines gate level; the architecture encodes that constraint, not the agent’s judgment in the moment.

Asynchronous communication

The agent doesn’t assume you’re reading a terminal. It sends results through a channel you’ll actually check: a Telegram message, a structured receipt, a trace file. The handoff is designed for the gap between “you walked away” and “you came back.”

Subagent orchestration

Long tasks split into parallel subagents that can each verify their own lane and converge on a coherent result. One interrupt tears down the whole tree. Nothing keeps running in the dark.

See it in action

When an AFK agent is the wrong tool

AFK agents add overhead (terminal-state logic, verification steps, async notification) that is not always worth it.

  • Tight feedback loops. If you’re prototyping and want to steer every few seconds, a copilot is faster.
  • Throwaway scripts. A 10-minute task doesn’t need verification workflows and Telegram pings.
  • Tasks that require continuous human judgment. If every step needs your taste, context, or approval, the async handoff creates friction instead of saving time.
  • Environments you can’t trust to recover. If a failed run would leave wreckage you can’t clean up, the reversibility gates may not cover your specific risk surface.

Frequently asked questions

What does ‘AFK agent’ mean?
“AFK agent” means an AI coding agent designed to run tasks without a human at the keyboard. AFK is a gaming term (Away From Keyboard), meaning the player stepped away. Applied to coding agents, it names a specific design posture: the agent handles a full task end to end, verifies its own work, reaches a clear stopping point (Done, Blocked, or Asking), and notifies you when it finishes. That distinguishes it from a copilot, which needs you present per turn. Put several AFK agents on a schedule and you have a software factory.
What does AFK mean in "AFK agent"?
AFK stands for Away From Keyboard. In gaming, it means the player stepped away. For coding agents, it describes an agent designed to keep doing useful work while the developer is away: sleeping, in a meeting, or working on something else.
How is an AFK agent different from a copilot?
A copilot suggests code while you type and needs you present to accept, reject, and guide each step. An AFK agent takes a task and runs it end to end without you there, verifying the result, reaching a terminal state, and escalating to you only when it hits something genuinely ambiguous. The feedback loop is async, not per-keystroke.
Can I build an AFK software factory with Agent AFK?
Yes. Schedule jobs on the Agent AFK daemon: for example, one that picks an open issue every hour, fixes it in an isolated git worktree, and opens a pull request, and another that reviews new pull requests. Each run ends Done, Blocked, Asking, or Interrupted and reports to Telegram, so you decide which steps need a person. Sandcastle, Matt Pocock’s open-source TypeScript library, is another way to build one: you script sandboxed planner, implementer, reviewer, and merger agents in code. Agent AFK gives you the scheduler, isolation, and check-ins as a ready-to-run CLI.
Is Agent AFK free?
Yes. Agent AFK is open source under Apache 2.0. The full runtime is free with no feature gates. You bring your own model provider (API key). Paid plans cover ongoing support from the maintainer, not access to the software. Install in under 60 seconds → Get started
What model providers does Agent AFK work with?
Any provider that speaks the Anthropic or OpenAI API format, including local models served through compatible endpoints. Your keys, your machine, your rules.
Can I trust an AFK agent to run without me?
That’s the design constraint the whole architecture is built around. Each safeguard covers a different failure mode: reversibility gates prevent irreversible damage, terminal states prevent silent drift, verification workflows prevent fake completions, and trace history lets you see exactly what happened. If the agent is unsure, it stops and asks instead of guessing.

Try Agent AFK

Everything on this page is ready to run tonight — free, no feature gates. Apache-2.0, bring your own model.

$npm install -g agent-afk

Requires Node ≥20 · puts afk on your PATH