Mel – the agentic terminal
The agentic team for coding.
How to write a task an AI coding agent can actually finish
November 15, 2026 · 6 min read

- Say the outcome, not just the action: "users can reset their password by email", not "fix reset".
- Write down what "done" looks like and the command that proves it.
- Say what is off limits and when to stop and ask.
- Read the diff before you commit, every time.
A good task for an AI coding agent says what should change, where to look, what "done" means, and how the agent can check its own work. Add what it must not touch and when it should stop and ask, and most of the "it did the wrong thing" moments go away. This guide gives you a seven-part checklist you can copy, a before-and-after example, and the mistakes that waste the most time. It works with any agent. We use Mel – the agentic terminal (openmel.dev), the agentic team for coding, in the examples.
Why does an AI coding agent do the wrong thing?
Usually because it filled a gap you left.
An agent cannot see what is in your head. When a task says "fix the login bug", the agent has to guess which bug, which file, what "fixed" means, and whether it may change the tests. Every guess is a chance to be wrong. A wrong guess early leads to an hour of confident work on the wrong problem.
People often blame the model. The cheaper fix is usually the task, because you control it.
What should a good task for an AI coding agent include?
Seven parts. Not every task needs all seven, but the more of them you skip, the more the agent guesses.
- The outcome. What should be true when the work is done, in one or two sentences. Write it from the user's side if you can.
- The starting point. The files, folders or functions to read first. "Start in
src/auth/reset.ts" saves the agent a search and saves you a surprise. - The context it cannot find. Anything that is not in the code: a decision your team made, a customer's exact complaint, the reason the obvious fix is wrong.
- What done means. The checks that must pass. "The existing tests pass and there is a new test for an expired link."
- How to verify. The exact command:
npm test,cargo test -p auth,pytest tests/test_reset.py. If the agent can run it, it can catch its own mistakes before you see them. - The limits. What it must not touch: the database schema, the public API, the payment code, a file another person is editing.
- When to stop and ask. "If the fix needs a new dependency, stop and tell me first." This turns a silent wrong turn into a question.
What does a good task look like next to a vague one?
Here is the same request written two ways.
| Part | Vague task | Task an agent can finish |
|---|---|---|
| Outcome | "Fix password reset" | "A user who clicks an expired reset link sees 'This link has expired' and a button to send a new one" |
| Starting point | none | "Start in src/auth/reset.ts and src/pages/reset.tsx" |
| Context | none | "Links expire after one hour. Support gets tickets because users see a blank page" |
| Done means | none | "Existing tests pass, plus one new test for an expired link" |
| How to verify | none | "Run npm test -- reset" |
| Limits | none | "Do not change the token format or the email template" |
| Stop and ask | none | "If you need a new package, ask first" |
The second version is longer to write. It takes about two minutes, much less than undoing a wrong change.
Should you ask the agent for a plan first?
For anything bigger than a small fix, yes.
Ask the agent to read the code and write a short plan before it changes anything: which files it will touch, in what order, and how it will test. Read the plan. It is far easier to correct a wrong idea in five lines of plan than in five files of code.
This is where a team of agents helps. In Mel, a team of agents works on files, commands, code and diff review. You can also pick the model per task: Mel works with Claude, GPT, Gemini, DeepSeek and Qwen (with a key for each, or on a paid plan), so a quick fix and a big refactor do not have to go to the same model.
How small should each task be?
Small enough that you can read the whole diff in one sitting.
A good rule: one task, one reason to change. "Add the expired-link message" is one task. "Add the expired-link message, clean up the auth folder and upgrade the router" is three, and when something breaks you will not know which part did it.
If a task feels big, ask the agent to split it into steps, then run them one at a time and commit between them.
What should you check before you accept the agent's work?
Three things, in this order:
- Did it do what the outcome says? Run the app or the check yourself, not only the tests the agent wrote.
- Did it stay inside the limits? Look at the list of changed files first. A file you did not expect is the fastest warning sign.
- Can you explain the diff? If you cannot say why a line changed, ask the agent, or do not commit it.
Approvals help here too. In Mel, configurable approvals keep you in control of commands and edits, so you can have the agent ask before it runs a command or changes a file while you are still learning how it works on your code.
What are the most common mistakes?
- Writing the task as a feeling. "Make this cleaner" has no finish line. Say what cleaner means.
- Leaving out the test command. The agent then guesses how to check its work, or does not check at all.
- Packing several jobs into one task. Split them.
- Correcting by piling on. After two or three wrong turns, it is often faster to start a fresh conversation with a better task than to keep patching the old one.
- Skipping the diff because the tests passed. Passing tests prove the tests pass. They do not prove the change is the one you wanted.
Where does Mel fit?
Mel – the agentic terminal is a multi-agent, multi-model AI terminal for Mac, Windows, Linux and VS Code. It plans, builds, tests and ships your work with you in control, and it is building the first superintelligent terminal. The checklist above works in any agent; Mel adds a team of agents, the choice of model per task, and approvals you set.
Mel is free with your own API key. Pro is $20 a month and Max is $200 a month. For teams, Mel Business has shared credits and one invoice, at $50 a seat with 2 seats minimum.
To try the checklist on your own code, download Mel, copy the seven parts into a note, and use them on your next real task. If you want to walk through it with your team, write to hello@openmel.dev and we will set up a short demo.
Your turn: what is the one line you now add to every task you give an AI coding agent? Tell us on LinkedIn or X. We will collect the best ones in a follow-up.
Frequently asked questions
How long should a prompt for an AI coding agent be? Long enough to cover the outcome, where to start, what done means and how to check it. For a small fix that is often four or five lines. Length is not the goal; leaving no big gaps is.
Should I tell the agent which files to change? Tell it where to start, and tell it what it must not touch. Let it find the rest, then check the list of changed files before you accept the work.
Is it better to ask for a plan before the code? For anything bigger than a small fix, yes. A plan is quick to read and quick to correct.
What if the agent keeps getting it wrong? Stop, rewrite the task with what you learned, and start a fresh conversation. Also try another model for that task: in Mel you can switch between Claude, GPT, Gemini, DeepSeek and Qwen, with a key for each or on a paid plan.

Lalla is a hands-on tech founder, agentic infrastructure architect and the vision behind Mel.
Follow on LinkedIn