# What to hand off from your coding agent, and what to keep

## Hand off what a test can check

Your coding agent does its best work on the parts of a project that need judgment. Every routine file it writes itself uses some of its context and your attention. Handing those files off keeps both for the work only the two of you can do.

The rule for deciding is short. If a task has a definition of done that a test can check, hand it off. If the definition of done is your taste, keep it.

Open your last agent session and go through the tasks it did. For each one, ask whether you could have written the pass or fail condition before it started. A rate limiter that allows 10 requests a minute per key and returns a 429 after that: yes. How a module should be organised: no.

## Which tasks have a checkable definition of done?

These usually do: input validators, request middleware, API clients for a documented API, parsers and formatters, small utilities with clear inputs and outputs, and tests for behavior that already exists.

These usually don't: choosing an architecture, naming things, deciding what a feature should do, refactors that touch many files at once, and anything you will only judge by looking at it. Keep those with your agent, where you can steer.

Codemind builds JavaScript and TypeScript only, so everything here assumes a JS or TS project.

## Why hand off to a service that verifies?

When your agent writes a file, you find out later whether it works. If it doesn't, you review it, rerun it and ask for another attempt, all inside the session you were trying to keep clear.

Codemind tests the code against your criteria before anything comes back, so you start from a result you can check. You also pay only when a build passes. After the free allowance a verified build costs $0.10, and a failed build costs nothing. See [pricing](/pricing/).

## How to write criteria a test can check

- ### Say what must happen Write the behavior for specific inputs. "Handles bad input" can't be tested. "Returns an error naming the missing field when email is absent" can.
- ### Include the edges Say what happens at the limit, when the input is empty, and when it is the wrong type. If you only describe the happy path, you only get tests for the happy path.
- ### Answer the questions a stranger would ask Name the framework, the header or field names, where state lives and the exact values of any response. If a person reading your criteria would have to guess, so would the code.
- ### Send the files the task depends on If the new code imports something already in your project, send that file as context. Criteria that refer to code Codemind can't see are a common reason a build fails.
- ### Send real files, not only type declarations A file with types and no code compiles, but does nothing when a test calls it. Send the real implementation the new code needs, as small as you can make it.
- ### Keep it to one job One task, one outcome. If your criteria describe three features, send three tasks.

## A real handoff, including the first attempt

We ran the rate limiter from the top of this page through Codemind as a TypeScript task.

First attempt. The criteria were five sentences: 10 requests a minute per key, a 429 with a Retry-After header on the 11th, other keys unaffected, a reset after the minute, a 401 for a missing key. Codemind sent it back before building anything and asked four questions: which framework and file path, which header carries the key, where the counters live, and what exactly Retry-After should contain. No build ran, so nothing was charged. Those are the questions a person would ask too.

Second attempt. We answered all four in the criteria. A plain function with no framework. The key read from the x-api-key header. Counters in an in-memory map, one fixed one-minute window per key. A 429 result with the seconds left in the window, rounded up, minimum 1. A missing or empty key returns 401. The build completed and returned two files: the limiter and a test file with seven tests covering the missing key, the empty key, the first ten calls, the eleventh, the rounding of the retry time, the reset after the window, and separate counts for different keys.

The difference between the two attempts was not effort. It was whether the criteria left the decisions to guesswork. [Set up Codemind in Claude Code](/claude-code/) with one prompt and try your own.

## Where this doesn't fit

Codemind builds JavaScript and TypeScript only. Not every build passes, so expect to tighten the criteria or split a task when one fails. Work that depends on your taste, or on a decision you haven't made yet, should stay with your agent.

You keep your code, and your agent still decides what gets written into your project. More on the [security page](/security/).

## Try it on one task

Pick one routine task from your last session, one with a checkable end state. Hand it off and do the next thing yourself. When the files come back, compare them with what you would have accepted from your agent. Keep handing off the kinds of task where that comparison goes your way.

## Questions

What coding tasks should I delegate from my AI coding agent?Tasks with a definition of done a test can check: validators, middleware, API clients, parsers and small utilities. Keep architecture, naming and anything you judge by taste.

Does delegating replace my coding agent?No. Your agent still plans the work and edits your project. Codemind takes the tasks it delegates and returns code tested against your criteria.

What happens if a build fails?You get an error code instead of files, and you aren't charged. After the free allowance, you pay $0.10 only for a verified build.

What if my criteria are too vague?Codemind can send the task back with questions before it builds anything. Answer them in your criteria and send it again.

Which languages does Codemind support?JavaScript and TypeScript.

Which agents work with it?Claude Code, Cursor, Codex and OpenCode. See the [Claude Code setup](/claude-code/) or the [overview](/delegate-coding/).

## Hand off one routine task and see what comes back.

[Start free](https://app.codemindhq.dev?utm_source=site&utm_medium=content&utm_campaign=what-to-hand-off-202610)