# 7.5 Long-running agent harness

An initializer plus coding sessions hand off through durable artifacts and verified commits.

1. Initializer: writes feature_list.json and init.sh.
2. Coding session: one feature, E2E test, git commit.
3. A fresh context rehydrates from durable artifacts.
4. Incremental progress until every feature passes.

- **Use when:** Multi-hour tasks spanning many context windows.
- **Avoid:** Missing E2E verification, or one-shotting the whole spec.

```
# every session starts with an empty memory
read("progress.md")
read("feature_list.json")
run("git log --oneline -10")

feature = next_not_done()
build(feature)

if end_to_end_test(feature).passed:
    mark_done(feature)
    run("git commit")
    append("progress.md", what_i_did)
```

## References

- [Effective harnesses for long-running agents](https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents) (Anthropic)
- [Harness design for long-running apps](https://www.anthropic.com/engineering/harness-design-long-running-apps) (Anthropic)
- [Scaling Managed Agents](https://www.anthropic.com/engineering/managed-agents) (Anthropic)
- [Harness engineering](https://openai.com/index/harness-engineering/) (OpenAI)
- [Building a C compiler with parallel Claudes](https://www.anthropic.com/engineering/building-c-compiler) (Anthropic)
- [Building agents with the Claude Agent SDK](https://www.anthropic.com/engineering/building-agents-with-the-claude-agent-sdk) (Anthropic)
