What is AI coding, and which tool fits which job?
AI coding is any workflow where a model writes, explains, reviews or tests code and you decide what ships. The tools come in three shapes. Autocomplete finishes the line you're typing. A chat model such as Claude, ChatGPT or Gemini answers questions about code you paste in. An agent reads your repo, edits files and runs commands, and that's where Claude Code, OpenAI Codex and Cursor compete. The table shows what each one costs on its vendor's own pricing page, checked on 3 November 2026.
| Tool | What it does | Cheapest paid plan that includes it | Free option |
|---|---|---|---|
| GitHub Copilot | Completions and an agent inside your editor | Copilot Pro, $10 a month, unlimited completions | Copilot Free, 2,000 completions a month |
| Claude Code | Agent in the terminal that edits and runs your repo | Claude Pro, $20 a month ($17 a month billed yearly) | Not on Claude Free |
| OpenAI Codex | Agent in the terminal, the IDE and the cloud | ChatGPT Go, $8 a month | Included on ChatGPT Free |
| Cursor | AI code editor with its own agent | Cursor Plus, $8 a month, Grok models only (Premium at $30 adds third-party models, billed at API list price) | Cursor Free, limited agent and chat requests |
Developers already use these tools every day, and they still don't trust what comes out. Stack Overflow's 2026 survey found that over 70% of respondents use AI daily, and 48% say they trust it when they can easily validate the answers. A year earlier, 66% of respondents named their top frustration as "AI solutions that are almost right, but not quite," and 45.2% said debugging AI-generated code takes more time. The speed gain is shakier than it feels. METR's July 2025 trial put 16 experienced open-source developers on 246 real issues, and with AI they took 19% longer while believing it had sped them up by 20%. METR's February 2026 rerun, with 57 developers and over 800 tasks, estimated that returning developers now take 18% less time, with a confidence interval from 38% less to 9% more. METR itself warns that developers who refused to work without AI skewed that sample. So the workflow below makes the tests the judge, not your impression.
The model you pick moves the bill more than the tool does. Anthropic's own price list runs from $0.10 per million input tokens on Claude Haiku 5.5 to $4 on Claude Opus 5.5. On the standard answer that Whizi's model cost index uses, 1,000 input plus 500 output tokens, that's $0.00035 against $0.014, a 40x gap inside one vendor. DeepSeek V4.1 Flash costs $0.0009 at its peak rate (half that off-peak), GPT-6.1 Terra costs $0.0035 and Claude Sonnet 5.5 costs $0.007, all worked out from the vendors' pricing pages on 3 November 2026. Send explain-this-code and log-triage questions to a cheap model. Save Claude Sonnet 5.5 or Claude Opus 5.5 for the review pass and the refactor plan on code you can't afford to break.
How do you debug code with AI? Reproduce the bug first
You debug with AI in five stages: reproduce, isolate, hypothesize, patch and verify. Don't open with "fix this." Open with the evidence. Give the model the failing command, the exact error, what you expected, what you got, the code involved, your environment and any recent change that could have caused it.
Stage 1 is the reproduction. For backend code, that's the request, the response, the status code, the logs and the failing test. For frontend code, it's the route, what the user did, the console error, the network response and the component state. For a broken build, paste the command, the package manager, the Node version and the full error around the first failure.
Stage 2 asks for hypotheses before any code. A careful model ranks the likely causes and says what evidence supports each one. If it can't tell two causes apart, ask it for the smallest diagnostic step. That might be one log line, one focused test, a type check or one more file to read.
Stage 3 is the smallest patch. Tell the model not to rename variables, rewrite the code around the bug, add dependencies or change public behavior unless it can say why. Ask it to return the root cause, a patch outline, the files it touches, the tests and the risk.
Stages 4 and 5 happen on your machine, not in the chat. AI output isn't a verification step. The verification is the command or the user path that proves the behavior, so run it. If no automated test exists yet, have the model write a regression test that fails first, and only then write the fix.
Debugging prompt:
Act as a careful debugging partner. Don't write any code yet. First restate the reproduction, what I expected, what I saw, and the three most likely root causes. Rank each cause by the evidence for it. Then suggest the smallest step that would tell them apart. Bug: [describe it]. Command or user action: [paste]. Error and logs: [paste]. Relevant code: [paste]. Constraints: [your stack, the files not to touch, the behavior to keep].
Fix prompt:
Using the root cause we confirmed, propose the smallest safe fix. Give me the root cause, the files and functions you'd change, a patch outline, tests that fail before the fix and pass after it, the edge cases, and the rollback risk. Don't refactor anything that isn't part of the bug. Context: [paste].
Can AI review code? Yes, and it reviews better than it writes
AI is a better reviewer than a first author, because a review only has to find what's wrong with code that already exists. Hand it a diff and it can spot missed edge cases, security holes, stale assumptions, test gaps and behavior changes. The trick is to make the review specific. If you ask "does this look good?" you'll get polite approval. If you ask it to hunt for correctness risk, you'll get objections you can use.
Give the model the diff, the behavior you intended, the related tests and any constraints. Tell it to skip minor style unless it hurts maintainability. You want it to rank bugs first, not to show off with nitpicks.
| Review area | Questions AI should answer |
|---|---|
| Correctness | Does the diff actually satisfy the requirement? |
| Regression risk | What existing behavior might change by accident? |
| Security | Are inputs, auth, secrets, permissions and injection risks handled? |
| Error handling | What happens on nulls, timeouts, retries, bad responses or partial state? |
| Tests | Which behavior claims have no test behind them? |
| Dependencies | Does the diff add a package, or call an API that the installed version doesn't have? |
| Maintainability | Does it follow local patterns and keep the change easy to follow? |
Code review prompt:
Review this diff like a strict but practical maintainer. Look for correctness, regression risk, security, edge cases and missing tests. Ignore minor style unless it creates a real maintenance risk. Return a table with the issue, its priority, the evidence from the diff, a suggested fix and the test it needs. What the change should do: [paste]. Diff: [paste]. Existing tests: [paste].
For a high-risk change, run the same review prompt on two or three models. Whizi's side by side model chats put two models on one prompt in two columns. If one model flags an issue, don't accept it blindly. Check whether the issue is real in the codebase. The point is to widen the review before you merge, and every objection gets traced back to the code instead of counted as a vote. Which model to send which kind of code to is covered in the best AI tools for developers.
How do you refactor with AI without changing behavior?
You refactor safely with AI by naming the invariants before it touches the code. Most refactors are judged by what doesn't change, and a model can make code prettier while it quietly shifts behavior, error handling, timing or a public contract. So the invariants come first.
Step 1: describe the goal. It might be cutting duplication, splitting a large component, isolating data access, simplifying branches, migrating an API wrapper or making the code easier to test. Then write down what must stay the same: function signatures, route behavior, event names, response shapes, analytics, permissions, accessibility and performance.
Step 2: ask for a staged plan. A useful plan is reversible. Each stage touches a small area, comes with tests and leaves the code working in between. Avoid one-shot rewrites unless the code is tiny and well covered.
Step 3: write characterization tests. Before anything changes, have the model describe what the code does today and draft tests that lock the important cases down. They're most useful on legacy code where nobody remembers the intent. Cover normal inputs, boundary inputs, failure paths and one regression case tied to the reason for the refactor.
Step 4: do one stage at a time. After each stage, run the tests and ask for a focused review. If the model proposes a broad new abstraction, make it show you the duplication or risk it removes. If it can't, keep the code boring and local.
Refactor planning prompt:
Create a staged plan for this refactor. Goal: [goal]. Current code: [paste]. Keep the public behavior the same, change as little as you can, follow the patterns already in the code, add no new dependencies, and make every stage testable on its own. Return the invariants, a map of what depends on what, the stages, the files each one touches, the tests for each stage, the rollback risk and a review checklist.
Unit test prompt:
Write the tests before any implementation changes. Use the test style shown here: [paste]. Behavior to keep: [paste]. Code under test: [paste]. For each test, give me its name, the setup, the input, the expected result and why it matters. Include a happy path, a boundary case, an error case and a regression case.
Which AI coding prompts remove the guesswork?
A good coding prompt is exactly as long as it needs to be to remove ambiguity, and no longer. It names a role, the task, the context, the constraints, the output format and how you'll check the answer. Save the prompts that work, and AI turns into a repeatable part of how you build instead of a one-off chat. The coding prompt pack has twenty more built the same way. The table pairs each coding job with the first thing to ask for and the check that proves the answer.
| Coding task | What to ask for first | What proves the answer |
|---|---|---|
| Debugging | Ranked root causes with the evidence behind each one | A regression test that fails before the fix and passes after |
| Code review | Correctness, regression risk, security, edge cases and test gaps | Every issue traced to a specific line in the diff |
| Refactoring | Invariants and a staged plan before any implementation change | Characterization tests still pass at the end of each stage |
| Writing tests | Happy path, boundary, error and regression cases | Each test maps to a behavior claim you can name |
| Explaining code | Purpose, inputs, outputs, data flow, dependencies and failure modes | Facts visible in the code kept apart from assumptions |
| Security check | Auth, injection, secrets, validation and data exposure, each with evidence | A failing test or a manual check you can repeat |
Code explanation prompt:
Explain this code to a developer who just joined the project. Cover what it's for, its inputs and outputs, how data moves through it, what it depends on, how it can fail, and which tests would make you more confident. Keep the facts you can see in the code apart from your assumptions. Code: [paste].
Secure coding prompt:
Review this code for security risks. Look at auth, permissions, injection, secrets, validation, unsafe redirects, file handling, dependency risk and any sensitive data it exposes. Only list issues you can back with evidence, and give the impact, a suggested fix and a test or manual check for each. Code or diff: [paste].
Compare-model-fixes prompt:
I'm comparing AI models on a coding task. Use only the context I give you. Return the root cause, the smallest safe fix, the tests, the risks, your assumptions and any questions you have. Grade your confidence from 1 to 5 and tell me what evidence would change your answer. Task: [paste]. Context: [paste].
QA checklist before you accept AI-generated code:
- The model restated the task correctly.
- The patch is smaller than the problem, not larger.
- Public behavior and contracts are named.
- Tests cover the bug or the refactor goal directly.
- Edge cases and failure paths are listed.
- Security-sensitive inputs were reviewed.
- The diff follows the project's existing patterns.
- You ran the relevant test, lint, build or manual reproduction.
- A human reviewed the final diff.
One honest limit: Whizi is a chat workspace, not an IDE plugin or a terminal agent. For completions while you type, Copilot or Cursor wins, and for an agent that edits your repo, Claude Code or Codex does. Whizi earns its place at the checkpoints. Paste the same debugging or review prompt into Claude Sonnet 5.5, GPT-6.1 Sol and DeepSeek V4.1 Flash, then score the answers on evidence, scope, tests and risk. Start with ChatGPT alternatives for coding if you want a model-selection guide, compare plans on pricing, or create an account to run the workflow on your own code.
- Start with a real reproduction, not a vague bug description.
- Ask for ranked hypotheses and their evidence before asking for code.
- Request the smallest safe fix and the files it touches.
- Name the behavior that must not change before a refactor.
- Write or update tests before you trust the patch.
- Review every AI-generated diff for correctness, security and edge cases.
- Send cheap questions to a cheap model and the risky review to a frontier one.
- Have a human review the diff before anything merges.
Frequently asked questions
Can AI do coding on its own?
Yes, for scoped tasks, but not unsupervised. Agents like Claude Code and OpenAI Codex can read a repo, edit files and run tests by themselves. They still ship code that looks right and isn't. In Stack Overflow's 2025 survey, 66% of respondents named "almost right, but not quite" answers as their top frustration. Let the agent draft, and keep a person on the review and the merge.
What is the best AI model for coding?
The best pick depends on the risk of the task. Use a frontier model such as Claude Opus 5.5 or Claude Sonnet 5.5 for reviews and refactor plans on code that matters. For code explanation and log triage, Claude Haiku 5.5 costs $0.00035 per standard answer, 40 times less than Claude Opus 5.5 on Anthropic's list rates. Run the same prompt on two models and keep the answer with the clearest evidence and the strongest tests.
Is there a free AI for coding?
Yes. As of November 2026, GitHub Copilot Free gives you 2,000 completions a month, ChatGPT Free includes Codex, and Cursor Free comes with a limited number of agent and chat requests. Claude Code isn't on Claude Free, so it starts with Claude Pro at $20 a month.
Can AI write unit tests?
Yes, AI can draft unit tests, but you have to demand real behavior coverage. Ask for a happy path, a boundary case, an error case and a regression case, then check that each test fails before the fix and passes after it. A test that passes either way proves nothing.