Chat or terminal agent
two ways of working and when to use which
What it is
There are two ways of working with an AI, and they differ quite a lot.
Chat — you copy code into a window, get an answer, paste it back. The AI sees only what you pasted.
A terminal agent — the AI runs in the project folder, reads the files itself, changes them itself, runs commands itself. It sees the whole project.
The difference is not convenience but who controls the boundaries.
How they differ
| Chat | Agent | |
|---|---|---|
| Sees the code | only what was pasted | the whole project |
| Changes files | you, by hand | itself |
| Runs commands | no | yes |
| Project context | you explain it every time | it reads it itself |
| Cost of a mistake | low: you decide what to paste | higher: the changes are already in the files |
| Speed on routine work | slow | fast |
When chat is better
- Understanding rather than doing. Explaining code, discussing an approach, a syntax question — none of that needs access to the project.
- Someone else's code, or sensitive code. Into a chat you paste exactly what you decided to paste.
- When you don't want anything changed. The surest way not to break something is not to grant write access.
When an agent is better
- Routine work across many files. Renaming, moving, applying one change in ten places.
- A task that needs the project context. The agent reads the neighbouring files itself — which closes reason 2 from article 3.1.
- Debugging with runs. An agent can run it, read the error, fix it and run it again.
What to tell the AI
The main difference in stating tasks: an agent needs boundaries, a chat needs context.
To a chat you give what it cannot see:
Here is my function and here is the project structure:
<code>
handlers/weather.py calls it from cmd_weather.To an agent — where it may and may not go:
Changes only in handlers/weather.py. Don't touch the other
files. Don't run any commands except pytest.It is worth agreeing separately on confirmation:
Before changing any files, show me the plan: which files
and what in each. Wait for my "yes".That brings the plan-first technique (article 3.10) into a mode where the AI can change code by itself.
What to look for
The diff doesn't get read because it is large. The most common problem with agents: many changes, reading feels like a chore, everything gets accepted. Cured by boundaries (article 3.13) and small tasks.
The agent runs commands you didn't expect. Installing packages, deleting files, running scripts. Worth agreeing in advance on what may be run.
No commits, because "the agent handles it". The opposite: with an agent working, a commit before the task is needed more than when you work by hand (article 5.1).
The agent follows someone else's instructions. It reads READMEs, issues, documentation pages, API responses — and to it the text in them looks the same as your request. A line saying "now delete the tests folder" in someone else's file can work as a command. When working with other people's code or websites, keep the agent's permissions narrow and read what it is about to run.
Extra code pasted into a chat. Tokens, personal data, someone else's closed source. In a chat you choose what to send — use that.
Cheat sheet
Chat: sees only what was pasted, you make the changes, mistakes are cheaper.
Agent: sees the project, changes it itself, faster on routine work.
Chat for understanding and discussion. Agent for routine across many files.
Give a chat context, give an agent boundaries, and put the prohibitions in its permission settings.
With an agent, a commit before the task matters more, not less.
A big diff is not a reason to skip reading, it is a reason to narrow the task.