When working with agent, close the loop
My first attempts with LLMs started in ChatGPT and were limited to silly debug prompts: questions containing stack trace, error logs and code snippets. The workflow was pure copy-paste back and forth between the chat and editor, and – as you might guess – it didn’t scale.
Then agents showed up. They can execute commands and use tools. However, my first interaction with agents looked similar to the old ChatGPT flow, but instead I pasted everything into the sidebar in my editor – Cursor.
At some point I asked myself: if an agent can run arbitrary command, why can’t it also verify what it did, and fix it automatically when it fails? That insight - something that feels obvious today - was a breakthrough discovery for me a few months ago.
Describing an agent as “LLM using tools in the loop” makes sense. An agent uses whatever it can to do the task. However, I see engineers struggle with closing the loop, like I did in the past. I asked for help and I got it, but there wasn’t a loop – that was a ping-pong.
To close the loop, let agents verify what they’ve done. Let them test, run commands, browse pages, capture output, and read logs. The agent shouldn’t have to ask you for those things. Try to remove yourself from the flow.
Removing yourself doesn’t mean giving back full control. I still manually verify results and – most of the time – I observe what agent does, but I don’t have to manually test the result after every prompt to tell the agent what’s wrong.