concept

Background agent

A background agent is an LLM-driven worker that runs asynchronously — receives a task, executes for minutes/hours without a user attached, posts results when done. Cursor's Background Agents, Claude Code's async tasks, Devin are 2026 examples.

Synchronous chat agents block the user while running. Background agents flip that: queue a task ('fix this issue', 'review this PR', 'write this report'), the agent runs in a sandbox ([[agent-sandbox]]) for minutes or hours, results post to a channel / PR / inbox when ready. The pattern unlocks longer reasoning chains, more thorough multi-step work, and parallelism (10 agents on 10 issues at once). Production examples in 2026: Cursor Background Agents, Claude Code task queue, Devin, Replit Agents, Charlie Labs, Trae. Engineering challenges: durable execution ([[workflow-engine]]), credit / cost limits, prompt injection safety (background agents run with elevated permissions), result notification, and observability of long traces.

When to use background agent

Common mistakes

FAQ

What is background agent?

A background agent is an LLM-driven worker that runs asynchronously — receives a task, executes for minutes/hours without a user attached, posts results when done. Cursor's Background Agents, Claude Code's async tasks, Devin are 2026 examples.

When should I use background agent?

Long-horizon tasks where blocking the user is wasteful. Parallelizable work (review N PRs, fix M issues).

What are the most common mistakes with background agent?

Skipping sandbox — background agents run with elevated trust, blast radius is huge. No cost cap — runaway agent can burn $100s before anyone notices.

Last updated: 2026-06-01. Raw markdown: https://promtable.com/glossary/background-agent.md.