Skip to main content
/refine teaches the agent from what just happened, without rewriting its base prompt. See Refinement for the model behind it.

When to run it

  • After a run that went unusually well and you want to lock in the pattern.
  • After a run that went badly and you want to nudge the agent away from what it tried.
  • On a fresh session started from a template, to bake project-specific guidance into supplemental state.

Run it

Inside an interactive session:
The harness:
  1. Reads the trajectory.
  2. Extracts evidence.
  3. Proposes updates to supplemental state.
  4. Snapshots the previous state.
  5. Applies the update.
The base system prompt is never touched. All changes go into supplemental state, which the runtime layers on top of the base prompt on every turn.

Roll back

Every /refine writes a snapshot. If a refinement made behavior worse, roll back to the previous snapshot and try again with different context.

What refinement is not

  • Not a way to change the base prompt. That’s immutable by design.
  • Not a way to add tools. Use a skill or extension.
  • Not compaction. Compaction trims context; refinement adds guidance. See Sessions for compaction.
Last modified on August 17, 2026