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

# Goals and rubrics

> Define objectives and acceptance criteria for Deep Agents Code sessions

Goals and rubrics help Deep Agents Code check whether its work satisfies the criteria you care about. Use a goal for objective-driven work where the agent should help define acceptance criteria, and use a rubric when you already know the criteria.

## Choose a goal or rubric

Use a **goal** when you have one measurable objective and want Deep Agents Code to draft acceptance criteria before it starts. A goal has a lifecycle: it stays active until the agent marks it completed, blocked, or you clear it.

Use a **rubric** when you already know the criteria you want the agent graded against. A rubric can apply to the next turn only or persist across future turns.

Common patterns:

* **One objective, agent drafts criteria**: Use `/goal <objective>`.
* **Persistent criteria for every turn**: Use `/rubric set <criteria>`.
* **Criteria stored in a file**: Use `/rubric file <path>`.
* **One-turn quality gate**: Use `/rubric next <criteria>`.

## Use a goal

Use `/goal` when you know the outcome you want, but want Deep Agents Code to propose the acceptance criteria before work begins. Goals are useful for open-ended work: the agent turns an objective into a concrete definition of done, then iterates until those criteria are satisfied.

```text theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
/goal add OAuth refresh handling
```

Deep Agents Code drafts acceptance criteria for review before starting the task. After you accept the criteria, the goal stays active across turns until it is completed, blocked, or cleared.

This lets you work toward a larger objective over multiple turns:

```text theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
/goal migrate auth callbacks to the new API
start with the OAuth callback
now update the tests
check the docs too
```

Use `/goal show` to inspect the current goal. Use `/goal clear` to remove it.

## Use a rubric

Use `/rubric` when you already know the acceptance criteria and want them to act as a quality gate for the agent's work.

```text theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
/rubric set tests pass; no unrelated files changed; help text is updated
/rubric next only change the auth callback; do not refactor unrelated code
/rubric file acceptance.md
```

A sticky rubric applies to future turns until cleared. A next-turn rubric applies only to the next submitted task.

<AccordionGroup>
  <Accordion title="Rubric command reference">
    * `/rubric show`: Inspect the active rubric.
    * `/rubric clear`: Remove the active rubric.
    * `/rubric model <provider:model>`: Set the model that grades rubric results.
  </Accordion>

  <Accordion title="Use rubrics in non-interactive mode">
    Non-interactive runs cannot pause for goal review. Use `--rubric` for tasks where criteria are already known:

    ```bash theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
    dcode -n "implement OAuth refresh handling" --rubric "tests pass; no unrelated files changed"
    dcode -n "implement OAuth refresh handling" --rubric @acceptance.md
    ```

    You can also set the grader model and maximum grading iterations:

    ```bash theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
    dcode -n "implement OAuth refresh handling" \
      --rubric "tests pass; no unrelated files changed" \
      --rubric-model openai:gpt-5.5 \
      --rubric-max-iterations 3
    ```
  </Accordion>
</AccordionGroup>

## See also

* [Deep Agents Code overview](/oss/python/deepagents/code/overview)

***

<div className="source-links">
  <Callout icon="terminal-2">
    [Connect these docs](/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers.
  </Callout>

  <Callout icon="edit">
    [Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/oss/deepagents/code/goals-and-rubrics.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
  </Callout>
</div>
