When should you use an agent?

Use an agent when it can observe changing state, choose the next allowed action, and recognize a checkable finish.

Write the loop on paper

List the input, permitted actions, observations, and stopping conditions. Review what happens when the same step fails twice. An agent is easier to supervise if it can report the state it observed and why it stopped.

Building effective agents

Reconcile a sample catalogue export

Expected counts are 4 skills and 3 plugins. The skill report returns 4. The plugin endpoint times out on the first attempt, then returns 2. Allow one read-only retry per transient error and ask for a reconciliation report.

Check the expected stopping point

The agent should record one successful skill check, one plugin retry, and a plugin difference of one. Because the second result is valid but mismatched, the next handoff is an evidence report for the owner. Further retries would require a new reason.

Try the failure and completion cases

Replay with a second timeout. The report should show plugins as unverified. Replay with a second response of 3. It should stop with both counts matched and include the observed counts and the attempted checks.

Related reading

Claude is not a search engine

Chat vs workflow vs agent

Subagents are for separable work