All posts

How to Delegate Tasks to AI Agents

Alook Team///9 min read

A task brief, code patch, and evidence folder show the work and proof needed to delegate a coding task.

We had a chat-loading bug in Alook. Messages were already saved on the person's device, and they had access to them, yet reopening the chat could leave them staring at a loading placeholder while a fresh request finished.

One of us set the expected behavior and the limits. Our agents carried the job forward: Jarvis coordinated, Samara built the fix, and Madox independently reviewed the code and tested the behavior in the browser.

The fix let the old messages appear before the fresh request finished, while the chat kept its usual rules for marking them as read and enabling actions. People scrolling through history kept their place when the network response arrived. The fix covered text channels, posts and threads, and private chats.

The symptom was clear, and so was the reading behavior we wanted to keep. Samara had to find what was holding back the messages.

Which coding tasks should you delegate to an AI agent?

We hand over work when we can recognize a good result and tell the agent where to bring an unanswered question. A bug reproduction, a draft release note, or a list of outdated documentation pages all give us something we can judge.

We also delegate investigations before we know the answer. With the chat bug, the symptom and the behavior to preserve were clear; finding what held back the messages was engineering work. For a product choice we're still debating, we ask the agent to investigate one option or build a small preview first.

The size of the work coming back matters. A broad request can turn into a large diff before anyone realizes the agent took the wrong direction. We start with one useful piece, settle the next question, and then let it continue.

How to delegate coding tasks to AI agents in 5 steps

PartWhat to put there
TriggerWhat starts the work: your request, a new issue, a schedule, or another event
InputsFiles, links, reproduction notes, and decisions the agent can use
StepsKnown steps, or the first investigation when the route is still unclear
OutputWhat it should return and how you'll recognize a finished result
Stop conditionThe missing information or decision it should bring back to you

For a one-off task, your message is enough of a trigger. You can write the brief in a few lines when the job is small. A missing answer is often worth a short conversation before work starts.

1. Choose one outcome you can check

“Make chat faster” leaves a lot open. It could lead to a cache rewrite, fewer requests, or a loading animation that hides the wait.

We went after something narrower: show messages already on the device while the refresh continues. The app kept its existing rules for marking messages read and enabling actions. Samara worked on the delay within those requirements.

2. Gather the inputs and mark the unknowns

The same symptom affected text channels, posts and threads, and private chats. They use separate screens, so all three belong in the brief. A recording from just one would leave the agent with only part of the job.

For an unfamiliar bug, the starting material is what you can reproduce and what you still need to find out. If you're delegating a recurring job instead, the steps you've followed by hand can save the agent some investigation.

Stable project rules can stay in AGENTS.md, CLAUDE.md, or the project's existing guidance. The current failure, open questions, and expected result belong with this task.

3. Write the brief, including when to stop

Vague instruction:

Handle this bug.

Delegable instruction:

Trigger: the reported delay when reopening a chat
Goal: show messages already saved on the device while the refresh is pending
 
Inputs:
- reproduction notes and the affected conversation screens
- current message-display, read-state, and scrolling behavior
 
Scope:
- text channels, posts/threads, and private chats
- show only messages the person is allowed to see
- preserve when messages are marked read and when actions become available
 
Steps:
1. Reproduce the delay and identify what is holding back display.
2. Propose or make the scoped fix.
3. Check each affected screen, including scrolling during a late response.
 
Output:
- patch or findings, with the current branch/commit
- checks run, their results, and anything not checked
- remaining questions and the next requested action
 
Stop and ask if:
- who can see messages or when they count as read needs a product decision
- you can't reproduce the reported problem
- the fix requires changing behavior outside this scope

We put this brief together from the repair's requirements. The actual fix touched 17 files across several components; naming the three screens and the behavior to preserve makes the work clear before the agent knows which files need changing.

4. Review the work against the brief

For a repair like this, a review needs more than “take a look.” We send the reviewer the brief and the current patch, and ask for specific findings. If the read marker looks off, we want the exact steps to see it.

5. Decide what to accept and what comes next

If only the channel screen has been tested, posts and private chats still need their turn. The returned work needs to cover the brief as a whole. If a review finds a problem and the agent revises the patch, you look at that revision and the results it brings back.

How do you know the AI agent actually finished?

We chose to show the cached messages sooner because people were already allowed to see that content. We kept the existing rules for marking them as read and enabling actions. And when the network answer showed up late, people stayed in the history they'd scrolled back into.

So we tested the display and the behavior around it. The automated tests included visible messages while read information or actions were still pending. Madox ran the browser checks across channels, posts/threads, and private chats. The three screens were wired separately, so each needed its own browser run.

The original brief gives whoever reviews the patch a question to answer: had the change also affected when a message counted as read? The version and test results help answer it. If something failed or wasn't tested, we want that in the same place.

Diagram of saved messages appearing during a refresh while read behavior, actions, and scroll position retain their existing rules.

The fix showed saved messages sooner while preserving read behavior, actions, and scrolling.

If you don't read the code, start with something you can open. Ask the agent for a preview or a short recording. In this example, you'd watch the old messages appear when the conversation reopens, see whether the read marker still follows its usual rules, and watch where the chat stays when someone scrolls back. The agent can prepare the slow-network part of the demonstration.

Code review and CI cover parts you can't judge from that demonstration. Test changes deserve a look too: removing or weakening an assertion can make a passing result misleading.

How much authority should you give an AI agent?

We agree on the scope before work starts, then let the agent investigate, edit, and run checks within it. Asking again before every routine step would keep us in the middle of the work we've just handed over.

We can hand over a patch and the tests while keeping the merge or release with a named person. The same goes for a customer-facing promise: drafting it and committing to it are separate choices.

What can the agent run, and what can it decide? We settle both before leaving it to work. For a repository investigation, reading files and returning findings may be enough. A repair needs permission to edit and run the project's tests, usually in its own working copy.

With the chat bug, the desired reading behavior was part of the job. A tool setting could permit the agent to change the code, but the decision about when a message should count as read still had to come from the people responsible for the product.

When a task reaches an unanswered product question, we ask the agent to bring back the question and the evidence it gathered. The agent can continue work that doesn't depend on the answer, within what we've already agreed.

How do you delegate a multi-day coding task to an AI agent?

For a long job, we hand over the next piece we can judge and expect the following piece to get clearer along the way.

Before changing sessions, we leave a note with the work. A handoff might read: “The patch is on this branch at this commit. The channel checks passed; private-chat verification is still open. We kept the existing read behavior. Next, check that screen against the attached reproduction. Ask about the unresolved behavior before changing it.”

We also keep rejected approaches and paths that should be left alone when they'll matter next time. On return, the agent checks the files and current results against the note before editing. Our guide to keeping context across coding agent sessions covers the different places those records can live.

For overnight work, we'd rather wake up to one clearly stated question than spend the morning untangling a guessed requirement. We tell the agent who to notify and what to leave when it gets stuck: the failure it hit, what it tried, and the decision it needs. Anything that depends on that answer waits. The computer or cloud environment also has to stay available for the planned run.

If the work grows into several roles, AI agent orchestration covers moving work between them; running an AI agent team covers keeping that ongoing work on track.

How can teammates add context and hand off work to your AI agent?

In Alook, a teammate can @ the bot in a shared discussion, attach a reproduction, or answer a question about the task. They can then pass the draft to a review bot in that same thread. The original request and the next task stay with the handoff. That's the multi agent collaboration Alook is built for.

The agent can take on work its owner has allowed; if the request needs a new decision, it asks the owner. The bot keeps its own private notes and uses its owner's configured tools. It shares the findings and files needed for the next step in the conversation, where whoever picks up the work can open them.

Alook interface example showing two people and two bots working from an updated shared brief.

Alook UI example: teammates add context to a bot’s task in the shared discussion. Open the full-size image.

If you want one bot to implement and another to review, our Claude Code and Codex workflow walks through that exchange.

Before you hand over the task

  • What should come back, and how will you recognize a finished result?
  • Which materials can the agent open, and what's still unknown?
  • Which choices or areas must it leave to someone else?
  • What evidence should accompany the result, and who checks it?
  • If it stops, where will the next person or session pick up?

FAQ

Should I review the AI agent's plan before it starts?

Review a plan when the direction itself needs your decision, such as a migration or a change to a public API. A small, well-understood fix can go straight to implementation within its agreed scope. You can refine the next step as you learn more.

Should task instructions go in AGENTS.md or the prompt?

Put stable project guidance, such as build commands and recurring constraints, in the project's rules files. Keep this task's goal, current state, and open decisions with the task.

Can I delegate a coding task if I can't read all the code?

Yes, if you can describe the behavior you want and have someone who reads code look at the result. Ask for a preview or recording you can inspect, along with the patch and checks for whoever reviews the code. Choose a smaller assignment when you can't yet tell how you'd accept the result.