The To-Do Method: Control AI Coding Agents in Your IDE

TL;DR: Tired of AI agents writing sloppy, off-target code? The "To-Do" method restores fine-grained control inside your IDE. By dropping explicit inline comments (like // TODO: agent - refactor this) directly into your files, you can guide agents through iterative, high-standard implementations while you review and queue up tasks in real time.
When you delegate a feature to an AI coding agent, you often end up spending more time fixing its architectural shortcuts than you would have spent writing the code from scratch. The agent produces code that technically runs, but fails your standard for naming, structure, or performance. Instead of fighting with complex prompts in a chat window, you can manage agent code quality directly in your files using the To-Do Method. It treats the agent like a hyper-fast pair programmer who just needs constant, highly localized steering inside your editor.
What is the To-Do Method for AI Agents?
The To-Do Method is a workflow where you direct an AI agent entirely through structured comments left directly inside your codebase. Instead of writing external prompts, you write inline notes, tell the agent to run, and then review and iterate on its output in place.
Think of it like leaving red-pen edits on a draft. You drop highly targeted instructions right where the work needs to happen. For example, you can write:
// TODO: agent - Write a function that returns true if email contains an @ symbol.
export function isValidEmail(email: string): boolean {
return email.includes('@');
}
You point the agent to your file and say, "Go fix the comments." The agent scans the code, finds your markers, replaces them with code, and stops.
How Do You Keep AI Code Up to Your Engineering Standards?
You maintain high standards by using tight, iterative feedback loops and treating agent-generated code as a draft that you ruthlessly critique. When an agent delivers code that isn't up to par, you do not rewrite it yourself; you write a comment telling the agent exactly why it failed and how to refactor it.
For example, if an agent writes a sprawling, unreadable nested conditional, don't accept the PR. Drop a comment directly above it:
// TODO: agent - This implementation is too complex. Refactor this using guard clauses and extract the validation logic into a helper function.
The To-Do Method Lifecycle
| Phase | Developer Action | Agent Action |
|---|---|---|
| 1. Direct | Write explicit TODO: agent comments in the codebase. |
Idle. |
| 2. Execute | Trigger the agent and point it to the modified files. | Reads comments, replaces them with code, and removes the TODOs. |
| 3. Critique | Review the diff. If it's messy, write a new TODO: agent to refactor. |
Idle. |
| 4. Parallelize | Write TODOs in File B while the agent works on File A. | Implements File A. |
This method pairs beautifully with Test-Driven Development (TDD). You can write your test cases first, leave a comment like // TODO: agent - Make these tests pass using the strategy pattern, and let the agent do the manual labor while you watch the test runner.
Can You Work in Parallel with an AI Agent?
Yes, you can work in parallel with an AI agent by queueing up tasks in different files while the agent is executing your previous instructions. Because the agent is confined to the specific files and comments you tell it to watch, you can stay focused in another part of the editor.
Imagine you are building a complex checkout system. While the agent is busy implementing a calculated tax helper in your service layer, you can move ahead to the controller or the frontend components, writing your next set of TODO: agent comments. By the time you finish mapping out the architecture, the agent has finished the boilerplate, and you are ready to review its work. It keeps your hands on the keyboard and your mind focused on system design.
FAQ
How do I prevent the AI agent from deleting my manual comments?
Clearly prefix your instructions (e.g., // TODO: agent - [instruction]) and specify in your system instructions or agent settings that it should only remove a comment once the requested implementation is fully complete and verified.
Does this method work with all AI coding assistants?
Yes, this workflow works with any agentic IDE tool (like Cursor, Copilot Workspace, or Windsurf) that can read your workspace context and modify files based on natural language commands.
Isn't writing inline comments slower than just chatting with the AI?
While it takes a few extra seconds to type comments in-file, you save time by keeping the agent focused on precise context, eliminating the need to copy-paste code back and forth between your IDE and a browser.



