Site icon Efficient Coder

How to Actually Hand Real Work to AI Agents: 15 Actionable Lessons for Technical Leaders

How to Actually Hand Real Work to AI Agents: 15 Lessons I Use Every Day

I hand a large share of my daily work to AI agents — not to chat with them, but to get things done: writing code, running tests, watching logs, shipping deployments. After months of working this way, I’ve distilled my approach into 15 lessons. No theory, no history — just what I actually do, so you can pick two or three and try them today.

The short version of this whole post: an AI agent is not a chatbot. A chatbot answers when you ask; an agent can call tools and act on its own — run code, read logs, deploy services, run experiments, and wake up on a schedule to do work at the right time. You don’t hand it a question. You hand it a job. And once you’re handing over real jobs, a lot of chat-era habits have to change.

The 15 lessons below fall into five phases: laying the foundation, delegating the work, verifying the results, building team memory, and guarding quality.

What Is an AI Agent, and How Is It Different from a Chatbot?

Regular AI chat AI agent
How you interact Question in, answer out You assign a task; it works on its own
What it can do Produce text Run code, read logs, deploy, send notifications, run experiments, work on a schedule
Your role The person asking questions The person delegating and verifying
What you get back An answer Finished work, with proof

The entire difference comes down to one mechanism: tool calls let an agent touch the real world. It can run the code it writes and read the logs that run produces. That single fact powers most of the lessons below.

Part 1: Lay the Foundation Before You Delegate Anything

1. Always Use the Newest, Strongest Model

My position is blunt: use the latest and greatest models — everything else is potentially a waste of time. Don’t try to save money here. Suppose a model is wrong 10% of the time. You don’t know which 10%, so every miss turns into retries, re-checks, and rework. The money you saved on the model comes back around and gets spent on all that churn.

Here’s the hiring version of the same question: would you really hire a generalist who’s 50% cheaper but also randomly 20% dumber? I didn’t think so. And if you’re wondering which models count as “latest” — who’s still using Opus 4.5? Exactly.

What to do: hand your work to the newest, strongest model available, and don’t let “good enough” talk you out of it.

The trap is the “value-for-money illusion”: comparing two models’ price tags while never counting the cost of rework. The money saved is the small part; the time burned on churn is the big one.

2. Let the Agent See the Whole Software Lifecycle (This Is What Kills Hallucinations)

What actually stopped hallucinations for me? Tool calls. Hallucination is a fancy word for a simple failure: the AI makes things up with a straight face — invents an interface that doesn’t exist, pretends steps ran when they didn’t. The root cause fits in one sentence: if the agent can’t see something, it makes it up.

Tool calls matter because they let the agent touch reality. Make the whole software development lifecycle legible to it: let it run what it builds end to end, read production logs, deploy, watch the rollout, cut the release, flip the feature flag, triage the bug report, and email the customer.

My rule in one line: anything you can see, the agent should see too.

You can open this up in three steps:

  1. First, let it run what it wrote, all the way through.
  2. Then, give it access to runtime logs and error messages.
  3. Finally, hand over deployment and release steps, one at a time.

The trap is the “black box”: any step the agent can’t see inside a task you delegated is an open invitation to invent. The more of the system it can see, the less room it has to make things up.

3. Give It Custom Tools for Every Job

Visibility isn’t enough — the agent also needs to reach. Around our software lifecycle we built custom plugins. The ones I’d name: one for handling bug reports, one for emailing users, one for answering “Is our system healthy?”, and one for granting feature flags. (A feature flag is exactly what it sounds like: the switch you hold for a new feature — on when you want it, off when you don’t.)

All four plugins share one property: they turn “something a human had to do by hand” into “something the agent can do itself.” Missing a tool, the agent stalls mid-task waiting for you — or, per lesson 2, starts guessing.

What to do: watch where the agent gets stuck, and build the tool for that step. It’s the same as giving a new hire a badge for the workshop they need to enter: no badge, no work.

4. Move Development Off Your Local Machine

I’ll say it plainly: local development feels yucky now. The ideal is that each agent can install and run whatever it needs to get the job done — easy on remote machines, painful locally. Try running several agents on one computer, each installing its own environments and testing things end to end, and resource conflicts are hard to avoid.

This points at a new reality: when work shifts from “one person at one computer” to “several agents working at once,” the working environment itself has to change too.

What to do: move to remote machines wherever you can, and give every agent its own stage. If something must run locally, at least don’t let agents step on each other’s toes.

The trap is treating environment setup as a small problem. When several agents’ tests get tangled together, you can’t even tell whose failure it was — and debugging that costs more than rerunning everything.

Part 2: How Should You Give an AI Agent Instructions?

5. Prompt the What, Not the How

Describe what you want, not how you’d do it — you’ll often get better results. One instruction I’ve sent: “Make the bytecode compiler and VM as fast as you can. Do not stop until it’s 2x faster.” You don’t need to know what bytecode is to feel the shape of that sentence: the goal and the bar are pinned down; the path is not. Another phrase I lean on constantly: “Here’s how it should work in the end.”

Why does this work? Every step you prescribe is a road you’re drawing for the agent. The finer the road, the less room it has to maneuver. Describe the destination clearly, and it can find its own way there.

A usable instruction has three parts:

  1. The end state, as concretely as you can make it.
  2. A checkable bar — “don’t stop until it’s 2x faster” — so the agent knows when it’s done.
  3. Restraint: swallow “first refactor this function, then touch that file.” That’s its job, not yours.

The trap is helping too much. What feels like a shortcut is a leash.

6. Don’t Iterate with the Agent — Let It Build Tools to Iterate

Skip the “let’s try this… ah no, let’s try that” loop. Instead: “Generate 20 variations and a little page that lets me combine and test them.” The agent builds its own test bench, and you just pick from the results.

The same move applies to problems, not just solutions. Want to know why the system is slow? Don’t guess one theory at a time. Say: “Give me 4 theories on why this is slow, then check all four.”

The difference in one line: used as a Q&A machine, the agent burns your time one round-trip at a time; used as a self-built trial-and-error machine, it runs the whole search and shows you the outcome.

What to do: before your next back-and-forth, ask whether you can turn “round-trips” into “batches” — write the number of variations, the test method, and the acceptance bar into the instruction, and let the agent build the experiment itself.

The trap: mistaking ping-pong for steering. Direction is controlled by the acceptance bar, not by correcting one sentence at a time.

7. Don’t Wait for Your Agent. Make It Wait for You.

If you’re worrying about TTFT — the time it takes the model to produce its first token after you hit enter — you’re probably doing something wrong.

Lean into async instead. Give agents bigger, more ambitious tasks. Batch instead of going back and forth. Spell out the goal, the bar, and what proof you expect (more on proof in lesson 9), send it off, and go do your own work.

Here’s the inversion that makes it click: you’re not waiting on the agent — the agent is waiting on you, for your next instruction, your review, your next task.

What to do: get three things into the task before you send it — the goal, the standard, and the form of evidence. Then walk away.

The trap is “waiting anxiety.” Small tasks mean more round-trips; more round-trips mean more anxiety. There is exactly one exit from that loop: send bigger tasks.

8. Schedules, Wake-Ups, and Heartbeats Are the Underrated Killer Feature

A lot of work doesn’t need to happen right now — it needs to happen at the right time, for sure. That’s what scheduled tasks, calendars, wake-ups, and heartbeats solve. I didn’t think this feature was a big deal until it was turned off; then I missed it dearly. Now I use it all the time.

My instructions all look like this:

  • “Check the logs in 2 hours.”
  • “Let me know once this is live.”
  • “Check every day at 9am.”

You supply the task and the time; the agent wakes itself up, does the work, and reports back.

What to do: pick one thing you currently watch by hand every day — logs, system status, whether a change took effect — and rewrite it as one scheduled instruction. There’s almost no setup cost. Try it today.

The trap: keeping “things that must happen at a certain time” in your own head. They eat attention, and forgetting is the norm, not the exception.

Part 3: How Do You Know the Work Is Actually Done?

9. Ask for Irrefutable Proof

This one changed how I work more than any other: don’t listen to the report — demand the evidence.

Agents happen to be excellent at producing proof. Three forms I use constantly: an end-to-end walkthrough of the finished thing, a recorded demo video, and before/after numbers. “It’s changed” and “it’s fixed” are two different claims — the first is the agent’s story, the second is a verifiable fact.

Three steps to make this operational:

  1. Name the acceptance format when you delegate: “give me a full end-to-end walkthrough when it’s done,” or “give me before/after numbers.”
  2. Put “this is not evidence” in your AGENTS.md — the file in your repository written for agents to read — and pin down what doesn’t count. Deciding that list is worth doing carefully before you write it.
  3. When results come back, look at the evidence before the conclusions. If the evidence holds, talk details. If it doesn’t, send it straight back.

Trust between you and an agent is built from accumulated, irrefutable proof — and your instinct for what counts as evidence is something you train over time.

The trap: approving work because it “sounds reasonable.” Reasonable is not built; built is not running. Only evidence separates those three.

Part 4: How Do You Turn Agent Threads into Team Knowledge?

10. Eval Your Agentic Knowledge — Regularly

After a while, knowledge piles up in the codebase: AGENTS.md files, skills, scripts, docs. Which raises a question almost nobody asks: are the agents actually using it?

My check is embarrassingly simple: spawn five blind agents — a group with the knowledge and a group without it — run the same task with each, and compare the results. It sounds like a drug trial, and it is one. Don’t knock the simplicity: you’d assume the knowledge is being used. Measured and assumed are two different things.

Better still, agents are really, really good at running experiments — so even organizing the quiz can be delegated to the agents themselves.

What to do: pick the one piece of knowledge you most want followed, run the blind comparison, keep what proves itself out, and investigate and rewrite what doesn’t.

The trap: “written = used.” Knowledge sitting in a repository doesn’t activate itself. It counts once it survives a test.

11. Stop Manually Managing Context: One Thread, One Task

Two quick definitions. A token is the unit of text an AI processes. Context is everything the agent can “hold in mind” within one conversation.

Now, stop checking whether the thread is “at 300k or 380k tokens.” Every thought you spend wondering about that number is wasted time — compaction works incredibly well now. Long stretches of conversation get folded up automatically to make room. Don’t manage context by hand.

The only rule worth enforcing yourself: one thread = one task. Some of my threads are 46 messages. One is 3,714. Length doesn’t matter; a clean boundary does — this thread, start to finish, is about this one thing.

What to do: new task, new thread. Old task stays in its old thread. Don’t be shy about opening threads.

The trap: rationing context like water in a drought. Open as many threads as you want, and spend the saved energy on describing the task clearly.

12. Threads Are Your Company’s Memory

My team works in Amp, and one pattern stands out: the more people on the team use it, the more knowledge multiplies — because every thread is a record of why we did it this way.

Reconstruct the scene: six months from now, someone points at a piece of code and asks, “Why did we change this?” With no record, you’re hunting down everyone who was there. With threads connected to git commits — the archive points where each change is packaged with a timestamp and a message — the answer is sitting in that old thread.

That’s a game changer: the team’s knowledge compounds, and the most direct payoff is that you can look up the pitfalls other people already hit and the decisions they already made, instead of doing the same work twice.

What to do: if your tool links threads to commits, build the habit of making the agent explain important decisions in the conversation — not just in your head. What gets said gets kept; what stays in your head is gone.

Part 5: What Should You Still Review Yourself?

13. Stop Worrying About Accumulating “Slop”

The fear goes like this: if AI writes most of the code, won’t your codebase turn into an unmaintainable mess?

My answer has two layers. First: “It’ll turn your codebase into an unmaintainable mess” — maybe that was true six months ago. Now? I’m not convinced AI adds slop anymore. Second, and more bluntly: even if it does, I’m not convinced the result is unmaintainable.

Note what I’m not saying. I’m not claiming it can never get messy. I’m saying this fear deserves to be re-tested, not enshrined as an axiom. For a lot of people the blocker isn’t technical — it’s that they don’t dare start. And while this gate stays shut, none of the other fourteen lessons even get a chance to work.

Of course, letting go of the worry isn’t the same as letting go of the code. What you do watch is the next two lessons.

14. Don’t Let Agents Write for Humans

Here’s one people don’t expect: anything ultimately read by a living human, don’t let the agent ghostwrite.

The exceptions: debugging steps, incident reports, some docs. Mechanical writing, where the reader doesn’t much care whether a human produced it. Those are fine to hand off.

The boundary is clean: the more mechanical the writing, the safer it is to delegate; the more it’s meant for humans, the more it should come from you.

What to do: sort your writing into two buckets. Mechanical — step records, formatted incident reports, reference docs — delegate freely. Anything that needs human judgment and weight in it, write yourself.

The trap: mixing the two buckets to save a few minutes. What you save is minutes; what you risk is exactly the part the reader cared about.

15. Review Only Code with a High Blast Radius

Blast radius — if this code breaks, how big is the explosion? That’s the only triage question for human review.

In practice: there are fewer than five central files in the codebase — those I review myself. Database migrations, yes — anything touching the foundation of the database, I read personally. Everything else? Closure vs. class, a neater type, variable names, even duplication: I don’t care anymore.

The attention I save goes to four questions on the critical code:

  1. Does it work?
  2. Can I explain it at the arrows-in-a-diagram level?
  3. Did the agent test it end to end?
  4. Can I still change it in a month?

If all four pass, the code passes.

Why split it this way? Your attention is the scarce resource in code review. Spread across every file, it reviews nothing. Concentrated where the explosion would be biggest, it’s finally aimed right.

What to do: walk your repository and mark the files that “can’t be allowed to explode” — core logic, database schema, the parts everyone depends on. Aim human review only at them. For the rest, let lesson 9’s evidence do the gatekeeping.

The 15 Lessons at a Glance

# Lesson Why it works
1 Use the newest, strongest model You can’t predict where a cheaper model errs; rework costs more
2 Make the whole software lifecycle visible to it What it can’t see, it makes up
3 Build custom tools for its jobs Without tools it stalls — or guesses
4 Move to remote machines Local setups fight over resources
5 Prompt the What, not the How The more path you prescribe, the less room it has
6 Let it build its own trial-and-error machine 20 variations + a test page beats 30 round-trips
7 Send bigger tasks, go async If you’re watching TTFT, the workflow is wrong
8 Use schedules, wake-ups, heartbeats “Check every day at 9am” beats remembering to check
9 Accept only irrefutable proof Walkthroughs, demo videos, before/after numbers
10 Blind-test your own knowledge base Five blind agents, with vs. without
11 One thread = one task 46 messages or 3,714 — boundaries matter, not length
12 Link threads to git commits Team memory: “why did we change this?” has an answer
13 Re-test the slop worry Worth doubting, not worshipping
14 Don’t let it write for humans Exceptions: debugging steps, incident reports, some docs
15 Review only high-blast-radius code Fewer than 5 central files, plus database migrations

FAQ: Working with AI Agents

Are AI agents and chatbots the same thing?

No. A chatbot is question in, answer out — its output is text. An agent calls tools and acts: it runs code, reads logs, deploys services, runs experiments, and executes tasks on a schedule. You don’t hand an agent a question; you hand it a job.

Can I save money by picking a cheaper model?

It usually costs more than it saves. Every model is wrong some of the time — say 10% — and you can’t predict which 10%. Every miss becomes retries and rework, and the money you saved on the model gets spent on the churn. You wouldn’t hire a generalist who’s 50% cheaper but randomly 20% dumber.

How do I stop an AI agent from hallucinating?

Tool calls. Hallucinations happen because the agent invents what it can’t see — so the fix is visibility and reach: let it run what it builds, read runtime logs and errors, and give it tools to check system health, triage bug reports, and flip feature flags. The more of the system it can see, the less room it has to make things up.

How detailed should my instructions to an AI agent be?

Describe the what, not the how. Pin down the end state and a checkable bar — “don’t stop until it’s 2x faster” — then resist prescribing steps. Every step you dictate narrows the agent’s room to find a better path than the one you imagined.

Should I worry that AI-written code will turn my codebase into a mess?

That worry deserves re-testing, not worship. Six months ago, maybe. Now I’m not convinced AI even adds slop — and even if it does, I’m not convinced the result is unmaintainable. Spend the energy somewhere concrete instead: personally review the small set of high-blast-radius files and every database migration.

Can I publish text written by an AI agent?

Split by audience. Mechanical content — debugging steps, incident reports, reference docs — delegates fine. Anything ultimately written for living humans, with your judgment and weight in it, write yourself.

Do I need to manually manage the context window?

No. Compaction works incredibly well now — long conversations get folded up automatically to make room. The only rule worth enforcing is one thread per task: new task, new thread; the old task stays in its old thread.

How do I know agents actually follow the AGENTS.md and docs I wrote?

Test it. Run blind agents — some with the knowledge, some without — on the same task and compare the results. “Written” and “used” are different claims; only the measured version counts. Agents are excellent at running experiments, so delegate the quiz too.

How does a team avoid repeating the same mistakes?

Treat threads as company memory. When threads are connected to git commits, “why did we change this?” six months later has a searchable answer. Make important decisions get explained in the conversation — what gets said gets kept.

Two Things You Can Try Today

You don’t need all fifteen on day one. Pick these two:

  1. In your next instruction, swallow the “how.” Say only the what — the end state and the bar.
  2. Before you sign off, ask the agent for before/after numbers on whatever it changed.

Tools will change. Models will change. The parts of this method that won’t change are almost plain: let it see, say what you want clearly, and settle for nothing less than proof.

Exit mobile version