Skip to content

Long-Running Agents

Keeping agents productive over hours or many sessions: progress files, checkpoints, compaction and handoffs.

Editorial team 1 min read

Some tasks take hours of agent work or span several sessions: large refactors, migrations, extended research. Long-running agents need extra support.

The Challenges

  • Context fills up and must be compacted or reset.
  • Progress and decisions can be lost between sessions.
  • Errors compound over many steps.
  • Costs grow.

Techniques

  • Progress files: the agent maintains notes on what's done, what's next and key decisions.
  • Version control: frequent commits provide checkpoints and a readable history.
  • Structured task lists: track remaining work explicitly.
  • Compaction: summarise history while retaining goals, state and open problems.
  • Clean handoffs: end each session with a summary that the next session starts from.

Verification Along the Way

Run tests and checks regularly rather than only at the end, so problems are caught early.

Break Up Work

Split large goals into milestones, each independently verifiable.

Oversight

Review progress periodically. Long autonomous runs magnify both productivity and mistakes.

More in Agent harnesses

All Agent harnesses guides →
Agent harnesses Guide · 2 min

What Is an Agent Harness?

The software around a language model that turns it into an agent: the loop, tools, context, permissions and memory.

Agent harnesses 2 min read 27 Sep 2025

Agent harnesses Guide · 1 min

The Agent Loop Explained

The core cycle every agent runs: think, call a tool, observe the result, repeat — and how the loop knows when to stop.

Agent harnesses 1 min read 26 Sep 2025

Agent harnesses Guide · 1 min

Designing Tools for AI Agents

How to write tools agents use well: clear names, precise descriptions, sensible inputs and informative outputs.

Agent harnesses 1 min read 25 Sep 2025

Agent harnesses Guide · 1 min

Context Management in Agent Harnesses

How agents stay effective over long tasks: what to keep in context, what to summarise, and what to store outside.

Agent harnesses 1 min read 24 Sep 2025