Skip to content
Optimal Lab

Tools · interactive

A coding agent's loop

Cursor, Claude Code, and tools like them do not write the whole answer in one shot. They search, edit, run a check, and repeat until the check passes.

Task

make the test pass

Agent

idle

Repo files

sum.ts

Test runner

not run

Run the agent and watch it move between the repo and the test runner.

1

Read the task

The task is one sentence: make the failing test pass.

Toggle the first-check behaviour in the panel.

2

Search the repo

The agent opens the files that mention the failure.

3

Edit a file

It changes the code, then leaves the test in place so the check still means something.

4

Run the check

A red check is not the end. It is the reason to search again.

5

Stop, or go back to search

Green means stop. Red means another loop, with the error as the new clue.

  1. The loop log shows up here.

In production

Tools and technologies

Coding agents loop: read context, edit files, run checks — similar products share the same shape.

Not tied to one language — use these names when you search docs or design a system.