DeepSeek Harness goals and the Ralph loop
Updated: August 16, 2026
Most agent cost surprises are not about the price of a token. They are about how many times the agent decided to try again. DeepSeek Harness gives that behaviour a vocabulary, which is the first step to putting a number on it.
Turn, step, round
Three units, precisely separated in the project glossary:
| Unit | Definition | Cost meaning |
|---|---|---|
| Step | One model request plus the tool executions it produces | The billing atom |
| Turn | One drain of input, ending when the model stops or policy intervenes | The user-facing unit |
| Round | An outer policy iteration, such as a goal round or a fresh-agent attempt | The multiplier above turns |
Rounds are the layer that most homegrown cost models omit entirely. If your forecast counts requests, and your system runs rounds, your forecast is measuring the wrong thing.
Goals are durable objectives
A goal is a durable completion objective with an explicit phase — active, paused, blocked, or complete. Unlike a message, it persists across turns, so the agent carries a standing objective. Each continuation cycle admitted for that goal is a goal round, materialised as one goal-sourced turn.
Admission is gated by a goal activation: a process-local permission to admit another round, which is either armed or disarmed. That single bit is the throttle on open-ended work.
The Ralph loop is deliberate restart
The Ralph loop is a foreground workflow that iterates toward an immutable objective by starting fresh agent sessions, built on the harness's workflow and subagent primitives. A Ralph round is one fresh child session with no parent conversation seed. Continuity is carried by a Ralph handoff — described as a normalised, bounded, structured report containing status, summary, evidence, and blockers.
The economics here are genuinely interesting, and they cut both ways. Restarting clean means each round pays a small input cost instead of dragging an ever-growing conversation forward, so per-round cost stays flat rather than climbing. But nothing about a fresh start guarantees progress, and a loop that restarts cheaply can afford to restart many more times.
The bounded handoff is the control that makes the pattern viable: it is the only channel between rounds, so it caps context growth by construction. Watch two numbers — rounds per objective, and whether the handoff's blockers list is repeating. A blocker that appears in three consecutive handoffs is a loop that will not converge, and every further round is pure waste.
Commands are not tools
Worth separating, because it affects what you meter. A human command is a slash-prefixed instruction routed through the command plane for human-facing adapters — discovery, parsing, dispatch, cancellation, and rendering, owned by UI adapters. It is explicitly distinct from a model tool. The goal command is one of these.
Practically: a human typing a slash command is not the model spending tokens. Attribute the two separately or your per-session cost will blame the wrong actor.
Four controls for open-ended work
- A maximum round count per objective, enforced before admission rather than reviewed afterwards.
- A cumulative token budget spanning all rounds of one goal, not per round.
- Convergence detection on the handoff: repeated blockers stop the loop.
- Explicit human authorisation for goal creation, kept as the audit record of who authorised the spend.
Related
- DeepSeek Harness subagents and delegation depth — the other multiplier.
- Where to put spend guardrails in DeepSeek Harness — where to enforce a round cap.
- The DeepSeek Harness session log as a cost record — where rounds become measurable.
- DeepSeek Harness tool scopes and restrictions — narrowing what a round can do.