> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qredence.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Refinement (/refine)

> Run /refine to improve the agent from its trajectory, and roll back if a refinement makes things worse.

`/refine` teaches the agent from what just happened, without rewriting its base prompt. See [Refinement](/fleet-prime-agent/concepts/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:

```
/refine
```

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](/fleet-prime-agent/guides/skills) or [extension](/fleet-prime-agent/guides/extensions).
* Not compaction. Compaction trims context; refinement adds guidance. See [Sessions](/fleet-prime-agent/concepts/sessions) for compaction.
