Agent Playground
Recipe: Agent fixes the failing test
Claude reads the code, runs the tests and edits until they pass, with your key and inside the sandbox only. What it does, when to use it, how to make it yours, and what a run costs.
Hands a failing test to Claude. The agent reads the code, runs the tests, edits the file and runs them again, turn by turn, until a check passes. You don't draw the loop: the agent loops by itself, inside the limits you set.
| At a glance | Notes |
|---|---|
| Category | Coding |
| Shape | An agent with a check |
| Plan | Free and up |
| Needs a Claude key | Yes |
| Limits it comes with | 2 loops, 600 seconds, $0.75 |
When to use it
- A bug, a broken build or a failing test that needs someone to read the code and try fixes.
- Any job where "done" can be checked by a command: the tests pass, the script runs, the file is valid.
- You want to see what an AI agent does, step by step, before you trust it with more.
Run it
- Open Agent Playground in the dashboard and find Agent fixes the failing test under Start from a recipe. In the builder, Recipes in the toolbar lists them too.
- Choose Use this recipe. It becomes a flow of your own, so changing it never changes the recipe.
- If you haven't yet, save your Claude key under Policies → Secrets. The builder offers Go to Secrets if it's missing.
- Choose Simulate to see the forecast, then Run.
What you'll see: Open Agent fixes it in the run to replay it. Typically Claude runs the tests, reads slugify.py, writes a fix, runs the tests again, and stops once the check passes, in a handful of turns. The step shows the tokens it used and what they cost. Show the fix runs the tests once more and prints the fixed file.
Make it yours
- Change Set up project to clone your code and install what it needs.
- Edit the agent's Goal. Say what's wrong, what done looks like, and what not to touch, like
Fix the failing tests in proj. Don't change the tests or add new libraries. - Set Check that it worked to your test command. The agent only counts as done when it passes.
- Under Rules for this step, tick No internet for this step if the fix shouldn't need the internet, and Ask a person first to approve each command while you get to know it.
- Keep the agent's own limits (Turns and Spend on the model) and the run's limits in step. The recipe allows up to 12 turns and $0.50 for the agent, inside a $0.75 run.
What a run costs
These are the builder's own forecast for the recipe as it comes, with its limits, rounded. Simulate shows the same numbers for your version, and they change as you change the flow.
| Notes | Typical | 1 in 10 runs | At most |
|---|---|---|---|
| Sandbox time | $0.0010 | $0.0016 | $0.86 |
| Claude, on your key | $0.06 | $0.13 | the run's spend limit |
| How long it takes | 82 seconds | about 2 minutes | 600 seconds |
A typical run uses $0.0010 of sandbox time, so about 970 runs cost $1, and every plan includes $5 of usage a month. Claude is billed by Anthropic to your own key, at their usual prices. The run counts it toward its spend limit, so it can't overspend, but we don't charge you for it. At most is the most a run could cost with these limits: it stops at $0.75 or 600 seconds, whichever comes first.