---
title: Optimizing prompts
description: Documents the `agency optimize` command, which iteratively improves a node's prompts and parameters using LLM feedback.
---

# Optimizing prompts

*work in progress*

```
agency optimize foo.agency:nodeName
```

Optimizes the prompts and parameters of a node using iterative LLM feedback. The target uses the same `file.agency:nodeName` format as the test commands.

## Options

- `--iterations <n>` — maximum number of optimization iterations to run.
