From chat to agent
Claude Code is an agent: it reads files, runs commands, and checks its own work, then keeps going until the task is done.
A chat AI answers. An agent acts.
When you type a question into Claude.ai or ChatGPT, the model reads your message and writes a reply. That is the whole loop: one turn, one response, done. The model never touches your files, runs a command, or checks whether its answer was actually correct.
Claude Code is different. It is an agent, a model that can use tools. A tool is a specific action the model can invoke: read a file, write a file, run a shell command, search the web, call an API. When Claude Code needs to understand your codebase, it reads the relevant files. When it makes an edit, it writes the change directly to disk. When it wants to confirm the change worked, it runs your test suite.
The key difference is not raw intelligence, it is the ability to take real actions and see real results, without you copy-pasting anything.
The agent loop
Claude Code doesn't just reply, it loops: decide what to do, run a tool, observe the result, then decide again. The loop repeats until the task is done.
You ask: "Find and fix the typo in README.md."
The loop, in plain English
The widget above shows the loop in its simplest form: two trips around the cycle, one to read the file, one to write the edit. For a straightforward change, that is enough. For tasks that need verification, like fixing a bug, the loop continues further. After writing the edit, the model calls a tool to run the tests. The test output comes back as context. If the tests pass, the model responds to you with a summary. If they fail, the loop continues: read the failure output, decide what is still wrong, write another edit, run the tests again.
Each tool result feeds back into the model's context. That is why the loop beats copy-pasting output from a chat: the model sees the actual file content, the actual test output, and the actual error messages, not a paraphrased version you typed by hand. Nothing is lost in translation.
The loop stops when the model decides the task is done, when it hits a permission boundary (an action it is not allowed to take), or when it asks you for input because it needs a decision only you can make.
Question 1 of 4
What is a "tool call" in an agent loop?