Lesson deck
The agent loop and tool design flashcards
Reviewing needs JavaScript. You can read every card in the list below.
Loading your cards...
Back to the lesson13 cards in this deck
Read all 13 cards as a list
- Front
- Who decides that an agent's work is done?
- Back
- The harness, by checking. The model proposes that it is done; a message with no tool call is a claim to verify with tests, a schema, a required artefact or a check the harness runs itself.
- Front
- Why was a feature list that starts all failing useful for long-running agents?
- Back
- The agent was told to mark an entry passing only after testing it, so it could not simply declare the job finished from earlier progress. It is an instruction, not a mechanism; a check the harness runs itself is stronger (Anthropic, Nov 2025).
- Front
- What does a good tool error look like?
- Back
- It says what failed, why, and what to try, written for a model: "File not found: src/a.py. Did you mean src/app.py? Use list_dir." Not a code or a stack trace.
- Front
- Where do you handle transient tool failures?
- Back
- In the harness, with retries and backoff the model does not see. Return a message only when retries run out. Otherwise the model burns its step budget on flakiness.
- Front
- What signals no progress, and what do you do?
- Back
- The same call with the same arguments, or the same error, repeated. Nudge once, then stop or escalate to a human, and log it.
- Front
- Guidelines for a tool set?
- Back
- Few, thoughtful tools for real workflows, not one per endpoint; no overlaps; descriptions written for a new colleague; readable short output; arguments that make mistakes hard (poka-yoke); read and write split.
- Front
- How do you improve tools?
- Back
- Run realistic multi-step tasks with checkable outcomes, read the transcripts, find where the model misuses a tool, then change the tool, not the prompt. Keep a held-out set.
- Front
- What is a conditional edit and why use it?
- Back
- An edit that carries the text it expects to replace, so a stale line number fails instead of editing the wrong line. Optimistic concurrency for model edits.
- Front
- What is progressive disclosure of tools?
- Back
- The model starts with a way to find tools and loads full definitions only for those it needs, so a large catalog does not fill the window before work starts.
- Front
- How do you handle a very long tool output?
- Back
- Keep the head and tail, write the full output to a file and give the model the path, summarise noisy sources with a cheaper model, and redact secrets first.
- Front
- Trade-off of giving an agent a general shell?
- Back
- Few definitions and great capability, but a large blast radius and noisy output. It needs a sandbox, allow and deny lists, timeouts and output caps.
- Front
- When is replaying a crashed run safe?
- Back
- Only when tools are idempotent: an idempotency key or a conditional edit means a repeated step has no extra effect. Persist messages, results, plan and side-effect ids after each step.
- Front
- Why version tool schemas?
- Back
- A model's behaviour can depend on tool names and shapes. Renaming a tool or changing an argument can regress calls that worked, so re-run your tasks and record the change.