claude-progress.txt harness pattern (Anthropic)

Anthropic's first-party file-as-memory harness for long-running agents: every fresh-context session recovers state from a progress file and the git log, does one unit of work, updates the file, commits, and exits.

prompt
→ Claude
Long-running agent harness: each fresh-context session starts by reading `claude-progress.txt` + git log to recover state, does one unit of work, updates the progress file, commits, exits. Initializer session sets up the file; coder sessions loop.
claude-code

Implementation note

When to use: agent work too long for one session — multi-day builds where context will be lost repeatedly and the question becomes how each new session knows where things stand. This is Anthropic's first-party answer. How it works: every fresh-context session begins by reading claude-progress.txt plus the git log to recover state, does one unit of work, updates the progress file, commits, and exits. An initializer session sets up the progress file; coder sessions then loop the pattern indefinitely. The progress file is curated state — what is done, what is next, what to watch for — while git history is the ground truth it points into. Safety: the discipline lives in the exit ritual: a session that fails to update the progress file before exiting strands the next one, so treat update-then-commit as non-negotiable. One unit of work per session keeps commits reviewable and recovery cheap when an iteration goes sideways.

Source: Anthropic Engineering

More automation loops

Run workflows with dynamic sub-agents

/goalnew

Split a task into packets, run sub-agents in parallel, synthesize results, and verify completion.

prompt
→ Claude
/goal loop and verify until complete
automationlow risk

Run agent turns until goal met

/goalnew

Agent executes repeated turns toward a condition, with a lightweight evaluator checking progress after each turn until the goal is reached.

prompt
→ Claude
/goal <condition turns a prompt into a durable objective. Thanos immediately starts a turn toward the condition, and after each turn a fresh, tool-less side-channel evaluator (a one-shot completeSimple call, not a subagent — so no extra agent turn and no re-entrancy) reads the last turn's evidence and returns MET / NOT MET . NOT MET auto-continues another turn with the reason as guidance; MET clears the goal and records the achievement. Unparseable evaluator output is treated as NOT MET (fail-safe: it never declares a false "done
automationmedium risk

Run agent until goal met

/goalnew

Queue agent turns with goal context until your objective is achieved, treating the goal as untrusted data.

prompt
→ Claude
/goal <objective , after /goal resume , and after every agent turn that leaves the goal active , the extension queues Codex's goal continuation prompt as hidden model-visible context. The objective is XML-escaped and wrapped as untrusted user data so it does not become higher-priority instructions
automationlow risk