# Read how your app behaved, then change it

How to read an automated audit persona by persona, choose one change from what its users ran into, and replay their conversations to see if the behavior moved.

Your coding agent reports first, and edits nothing until you say so.

## Read how your app behaved

When an automated audit ends, your coding agent calls [`behavior`](https://cortad.com/docs/tools.md#behavior) and tells you how your app behaved with its users: who they were, what they wanted, who achieved their goal and why the others did not. Then what it would change, and why that follows.

This is one persona, and the line in the code its problem comes from, as `behavior` prints them:

```text
2. Asks where their order is: 4 simulated users, 31 conversations.
   Who they are: signed in 75%, guest 25%.
   They send 2 messages a conversation, with a first message of about 9 words.
   They achieved their goal in 19 of 31 conversations.
   - Those signed in achieved their goal in 11 of 23 conversations; guests in 8 of 8. Shown in 41c2e0b7, 5d19a3f0, 9e07c2b1.
   What the app did well with them:
   - The reply gives the order's status once it has the order: in 19 of 19 conversations, 100% (83% to 100%).
   Where it gave way:
   - The reply asks for an order number the account already has: in 12 of 23 conversations, 52% (33% to 71%). (finding:1)
     Shown in 41c2e0b7, 5d19a3f0, 9e07c2b1 and 9 more.
     In 41c2e0b7:
       The user: "Where's my order?"
       Reply 1: "Happy to help! What's your order number?"

Where each problem comes from in the code:
- src/prompts/support.ts:42
  The reply asks for an order number the account already has: 12 conversations of "Asks where their order is". Verify with findingId "finding:1" replays them after a fix.
```

- The first line is the persona: what its users want, and how many simulated users played it.
- `Who they are` is in your app's own terms. A split such as signed in and guest shows which users miss their goal.
- `52% (33% to 71%)` is the rate, and its likely range. Every rate carries both.
- `Shown in` names the conversations behind a line, and one of them is quoted.
- `finding:1` is the id `verify` takes, and the line in the code is where the change belongs.

## Compare with before

`behavior` with `against` says what got better, worse, new or gone for each persona since another point: `previous`, a commit, or `production`. Compared with production, it also says where simulated users behave unlike your real ones. A rate counts as moved only where the range of the difference leaves out zero.

With `history`, it lists every automated audit by commit and every day of production, newest first.

## Make one change

Choose what to change first. On your go, your coding agent makes one change, near the line in the code `behavior` names.

## Replay the conversations

Your coding agent calls [`verify`](https://cortad.com/docs/tools.md#verify) with the problem's id, the `finding:1` beside it.

```sh
npx cortad@2.1.1 verify finding:1
```

Cortad restarts your app when its code changed, then replays the conversations the problem happened in, word for word, against the saved edit. It also plays the [conversations saved to test a fix](https://cortad.com/docs/how-it-works.md#your-coding-agent-runs-the-tests-and-cannot-edit-them), once, and reports them separately.

## Read the answer

| The verify says | What to do |
| --- | --- |
| Worse on the saved conversations | Undo the change, whatever its own conversations did, and aim the next one at the behavior the question asks about. |
| Gone | Keep the change. |
| Less often, or stayed | Read the replayed conversations beside what they said before the change, and decide what to change next. |
| Not decided yet | It says how many more clean replays would decide. Keep the change, and call `verify` again. |

Replies your app refused or failed on the replay come first, because a change that broke the endpoint shows there.

Then run [`test`](https://cortad.com/docs/tools.md#test) again, and read `behavior` against `previous` to see how every persona moved.

## When a question misjudges your app

A question can measure something your app was not built to do. Your coding agent records that with [`tell`](https://cortad.com/docs/tools.md#tell).
