WED, NOVEMBER 18, 2026
Independent · In‑Depth · Practitioner‑Tested
MAI-Code-2 Coding

MAI-Code-2 Prompts for Agentic Coding Work

Microsoft positions MAI-Code-2 for demanding agentic coding rather than autocomplete, which changes what a good prompt looks like. An agent that can edit twenty files needs to be told where to stop more than it needs to be told what to do. These six are built around that: each one constrains scope, forces the model to show its reasoning before it acts, or makes it report honestly when it has nothing. Paste the relevant code or diff first, then the prompt.

⌨️ 6 prompts 🕐 Updated Nov 18, 2026 👁 17 views
💡 How to use these prompts: Replace everything in [BRACKETS] with your specific details before sending. Click Copy to copy any prompt to your clipboard instantly.
1
Scope before it writes
Planning a change
Before you write any code, list every file you intend to change and why, and every file you considered and decided not to touch.\n\nThen stop and wait. Do not start editing.\n\nIf the change touches more than five files, tell me what the smallest useful subset would be instead.
2
Make it fail first
Bug fixing
Write a failing test that reproduces this bug before you fix anything. Run it and show me the failure output.\n\nOnly once I confirm the test fails for the right reason should you write the fix.\n\nIf you cannot reproduce it in a test, say so plainly and tell me what you would need - do not guess at a fix.
3
No new dependencies
Dependency discipline
Implement this using only what is already in the project's dependency manifest.\n\nIf you believe a new dependency is genuinely necessary, stop and make the case: what it does, what it would replace, and roughly how much code it saves. Do not add it.\n\nPrefer twenty lines of our own code over a package we have to track.
4
Explain the blast radius
Refactoring safely
Before applying this change, tell me everything that calls the code you are about to modify, directly or transitively, as far as you can trace it.\n\nFor each caller, say whether the change is safe for it and how you know.\n\nList anything you could not trace. That list is the risk.
5
Finish the job
Finishing a change
You have made the change. Now do the parts that usually get skipped.\n\nUpdate any comment or docstring that is now wrong. Update the README if behaviour changed. Check whether any test now asserts the old behaviour. Check whether any error message still names the old thing.\n\nList what you changed in each category, or write NONE for that category.
6
Review your own diff as a stranger
Self review
Read back the diff you just produced as if someone else wrote it and you are reviewing it.\n\nName the three things most likely to be wrong, in order. For each one, say what input or state would expose it.\n\nIf you genuinely believe there is nothing wrong, say NOTHING FOUND rather than inventing something - but say it only if you mean it.