Quad Harness
0.2.0Download

Docs The agent

Goals, checkpoints and rewind

Keep a session pointed at one outcome with a goal, follow the agent's plan, and undo its file edits or branch off from any moment with checkpoints and rewind.

5 min read

Long sessions drift. A goal keeps the agent pointed at the outcome you want, the plan shows how it means to get there, and checkpoints let you take back what it did.

Goals

A goal is one sentence that says what the session is working towards. Write it as an outcome you can check:

  • Every test in the parser crate passes.
  • The login page works on a phone-sized screen.
  • The CSV export handles quoted commas, with a test.

Set a goal

Any of these opens the Set a goal dialog:

  • The command palette (⌘K): Set a session goal.
  • The Plan window: the goal area at the top.

Type the goal and choose Set goal (⌘Return also confirms). The conversation then shows a Goal · banner under its header.

What a goal does

While a goal is active, the line Goal for this session, set by the person: <your goal> is part of the agent’s system prompt on every turn. It survives compaction, because the prompt is rebuilt each turn rather than summarised. The agent keeps it in mind through a long session and can tell you how far it has got.

A goal does not make the agent run by itself. It works when you send messages, as usual.

When a session has a goal, the hand-off dialog fills its brief from the goal. See Subagents and sessions.

Change or complete it

  • To change it: Change the goal in the Plan window (or the palette entry, which reads the same) and edit the text, then Update goal.
  • When it is done: Mark the goal complete in the Plan window, or Complete the active goal in the palette. The banner goes and the line leaves the prompt. The Plan window shows Goal completed.

Goals are stored in the session log, so they survive restarts.

The plan

When the agent works through a task in steps, it keeps a plan with its plan and todo_write tools. The Plan window (⇧⌘R, or the key 6) shows:

  • The goal, at the top.
  • The steps, each pending, in progress or done. The agent ticks them off as it works. Add a step lets you add one yourself.
  • Files it will touch and Files it has touched.
  • Watch for: risks the plan flags.
  • An estimate of tokens and cost before you start, and to finish. Costs use list prices and are estimates.

With no plan yet, Ask for a plan puts a planning request in the composer.

Plans in Plan mode

In Plan (read-only) mode the agent can explore and then put its plan to you with propose_plan. The Plan window and the conversation show Plan ready for your approval:

Choice What happens
Approve · ask before changes The same run carries on in Standard mode, asking before each change.
Approve · go ahead The same run carries on in Unrestricted mode.
Keep planning The session stays read-only. Tell the agent what to change in your next message.

This is a good way to work on anything large: plan read-only, adjust, then approve.

Checkpoints

Before a file tool changes a file, the engine saves the file’s current content. That copy is a checkpoint. If the file did not exist yet, the checkpoint records that, so rewinding deletes the new file.

Checkpoints are made for:

  • write_file, edit_file, apply_patch and the other file tools.
  • Pack tools that declare which files they will change.

They are not made for changes a shell command causes, because the engine cannot know in advance which files a command will touch. A code generator, git checkout, sed -i or a formatter run through bash changes files without a checkpoint.

Tip. For work where shell commands change many files, start the session in A new worktree of the folder, or commit before you begin. Git is then your safety net.

Checkpoints live with the session in the app’s data folder (sessions/checkpoints/<session>/). The Pull request tab of the Changes window lists them under Checkpoints.

Rewind

Open the Rewind window with the key 8, the dock, or the rewind button in the conversation header.

It shows a Session timeline: your prompts and the agent’s steps, in order, with the files changed at each point. Drag back along it. Previewing the past. Nothing has changed yet. appears while you look: nothing happens until you choose an action.

Action What it does
Open the diff Shows the changes made after that point.
Restore files here Puts files back to how they were at that moment. Edits made after it are overwritten, and files Quad created after it are deleted. The conversation stays as it is, so you can tell the agent what you did.
Branch from here Starts a new session from that moment, linked to this one as a sub-session. The original is untouched.
Rewind to before this prompt Takes that prompt and everything after it out of the conversation, and puts the prompt back in the composer to edit and send again.

If a step was still running at the moment you picked, the window asks you to pick the one after it. While a run is going you can look but not change anything: stop the run first.

Other ways to go back

  • Hover one of your messages in the conversation and choose Rewind to this prompt.
  • Hover one of the agent’s replies and choose Fork from this reply to start a new session from there.
  • The agent itself can list and restore checkpoints with its checkpoint_restore tool (this asks in Standard mode).

Note. Restoring files does not undo things outside your files: a commit, a push, a message sent, a package installed. Rewind covers file edits made through the file tools.