Learn to code with AI: use it as a tutor, not a shortcut (12-week plan)

Learn to code with AI: use it as a tutor, not a shortcut (12-week plan)

You can learn to code with AI faster than with books alone, as long as AI explains and questions you instead of writing your code. This guide covers what recent research says about AI and skill building, the tutor settings and prompts that keep you thinking, rules for when to let AI write code and a 12-week plan.

In shortTL;DR
  • In a 2026 Anthropic study, learners who delegated coding to AI scored far lower on a follow-up quiz than those who used it to ask questions and get explanations.
  • Use AI as a tutor: ask for hints, explanations and quizzes, and write the code yourself.
  • Turn on a learning mode where available, such as Claude Code's Learning output style or ChatGPT's study mode.
  • Follow a simple rule: try first, ask for a hint second, and only read a full solution after you have a working attempt.
  • Build real projects early, and use AI agents for whole features only once you can read and judge the code they write.

Can you learn to code with AI?

Yes. AI assistants are patient, available at any hour and good at explaining the same idea five different ways, which makes them strong tutors for learning to code. The catch is that the same tools will also write your code for you, and if you let them, you can finish every exercise and still not be able to program.

The difference comes down to who does the thinking. When AI explains, hints and checks your work, you learn faster than you would alone. When AI writes the code and you paste it, you practice pasting.

This guide is about the first way. It covers:

  • What a recent controlled study found about AI and learning.
  • How to set up AI tools so they teach instead of answer.
  • Prompts that keep you doing the work.
  • When it is fine to let AI write code.
  • A 12-week plan from zero to small real projects.

What does research say about AI and learning to code?

The best recent evidence comes from a randomized controlled trial Anthropic published in 2026. It found that developers learning a new library with an AI assistant scored noticeably lower on a follow-up quiz than those who learned without one, but only when they used AI to do the work rather than to understand it.

The setup, from Anthropic's write-up of the study:

  • 52 mostly junior software engineers, each with more than a year of regular Python use.
  • They learned Trio, a Python library for asynchronous programming that none had used.
  • One group had an AI assistant; the other had documentation and web search.
  • Afterward, everyone took a quiz on the concepts they had just used.

The results:

FindingDetail
Quiz scoresAI group averaged 50%, hand-coding group 67%
SpeedAI group finished about two minutes faster, not statistically significant
Biggest gapDebugging questions: recognizing when code is wrong and why
Low scorers (under 40%)Delegated code writing, or used AI to debug without understanding
High scorers (65% or more)Asked conceptual questions, or asked for explanations along with code

Two points from the study are worth carrying into your own learning. First, how you use AI mattered more than whether you used it: people who generated code and then asked follow-up questions to understand it did well. Second, the authors wrote that cognitive effort, "and even getting painfully stuck", is likely important for mastery.

The study was small and covered one library over a short session, so treat it as a strong signal rather than the final word. It matches what teachers have long known: you learn what you practice.

How do you set up AI as a coding tutor?

Set up your AI tool so its default is to teach. Several tools have a built-in learning mode, and you can turn any chat assistant into a tutor with standing instructions.

Built-in learning modes:

  • Claude Code's Learning output style. According to the Claude Code output styles docs, the Learning style explains its choices in short Insight blocks and, when it reaches a real design decision, leaves a TODO(human) comment in the file and asks you to write that piece. Switch with /output-style learning or through /config. The Explanatory style adds the explanations without asking you to write code.
  • ChatGPT's study mode is designed to guide you through problems step by step instead of handing over answers. Anthropic's study names it alongside Claude Code's learning modes as a tool built to foster understanding.
  • Course tutors. Harvard's CS50 has its own AI tutor, the CS50 Duck, designed to lead students toward answers rather than spoil them.

Custom tutor instructions for any assistant (paste into custom instructions, a project or a style):

tutor instructions
I am learning to program in Python. Act as a patient tutor.- Do not write complete solutions unless I explicitly say "show solution".- When I am stuck, give the smallest useful hint first, then a bigger one if I  ask again.- When I share code, point out problems by asking questions ("What happens to  `total` when the list is empty?") before telling me the fix.- Explain new concepts with a short example that is different from my  exercise, so I still have to apply the idea myself.- After I solve something, ask me one question to check I understood why it  works.- Use plain language and define any jargon the first time you use it.
Tip

Use the AI in a separate window from your editor, and type code yourself instead of copying it. That friction helps: retyping and adapting code is how it moves from the screen into your head.

Which prompts help you learn instead of copy?

Good learning prompts ask for explanations, hints, reviews and quizzes. They keep you responsible for producing the code. Here are the patterns that cover most situations.

When a concept does not click:

prompt
Explain Python dictionaries to someone who understands lists. Use an analogy,then a 5-line example, then give me one small exercise to try. Don't solve it.

When you are stuck:

prompt
I'm trying to count how many times each word appears in a sentence. Here ismy attempt and the error. Give me one hint about what's wrong, not the fix.

When your code works but you are not sure it is good:

prompt
Review this function like a senior developer reviewing a beginner. List up tothree improvements, most important first, and explain why each matters. Don'trewrite it; I'll make the changes.

When you read code you did not write:

prompt
Walk me through this code line by line. After each block, stop and ask me whatI think the next block does before you explain it.

When you finish a topic:

prompt
Quiz me on loops and conditionals in Python: 5 questions, one at a time,mixing "what does this print" and "find the bug". Wait for my answer each timeand explain any I get wrong.

Compare those with prompts that skip the learning: "Write a word counter in Python", "Fix this", "Do exercise 4". They get you working code and nothing else.

When is it OK to let AI write the code?

Let AI write code when the code is not what you are trying to learn right now, or when you already understand it well enough to judge the result. A simple rule works for most learners: try first, hint second, solution last.

SituationLet AI write it?
The exercise is the skill you are practicingNo. Ask for hints only
Boilerplate you already understand (project setup, config files)Yes, then read it
A working attempt exists and you want to see a better versionYes, then compare line by line
You are stuck for 30+ minutes after hintsYes, then rewrite it yourself from memory tomorrow
A side task unrelated to your goal (a quick script to rename files)Yes

Building whole apps by describing them to an AI and accepting whatever comes back has a name now: vibe coding. It is a fun way to make throwaway prototypes and a poor way to learn. Our article on what vibe coding is covers where it fits and where it causes problems.

Warning

Do not ship AI-generated code you cannot explain, especially code that handles logins, payments or personal data. If you cannot say what each part does, ask the AI to explain it until you can, or do not use it.

A 12-week plan to learn to code with AI

This plan assumes five to ten hours a week and starts from zero. Python is used as the example; swap in JavaScript if you mainly want to build websites. Each week, use AI as a tutor for explanations, hints and reviews, and write the code yourself.

WeeksFocusAI's roleSmall project
1 to 2Setup, variables, types, input and outputExplain errors, define termsA tip calculator
3 to 4Conditionals, loops, functionsHints, line-by-line walkthroughsA number guessing game
5 to 6Lists, dictionaries, filesCode review after each exerciseA word counter for a text file
7 to 8Debugging, reading errors, testing basicsAsk "why" questions, never "fix this"Tests for your earlier projects
9 to 10Libraries, APIs, working with dataExplain documentation, suggest approachesA script that fetches weather or prices from an API
11 to 12One real project of your ownPlan with you, review your codeSomething you will actually use

Habits that make the plan work:

  1. Keep a learning log. After each session, write three lines: what you learned, what confused you, what you will try next. Paste it into the AI at the start of the next session for context.
  2. Explain it back. At the end of each week, explain the main concept to the AI as if teaching it, and ask it to correct your explanation.
  3. Debug before asking. Read the full error message, form a guess and test it before you ask for help. Debugging was where the study found the biggest gap, and it is the skill you will use most. Our guide to debugging with AI shows how to ask for help without giving away the learning.
  4. Use free courses as the spine. A structured course such as CS50 or freeCodeCamp gives you exercises in a sensible order; AI fills in explanations around them.
  5. Commit your code to GitHub from week 3, so you learn version control early and can see your progress.

If you are a student, our guide to AI for students covers academic integrity and study techniques that work across subjects.

What comes after the basics?

After the basics, start building projects you care about, and gradually let AI take on more of the typing while you stay responsible for the design and the review. That is how professional developers work with AI today: they describe, review and correct, which only works because they can read the code.

A sensible progression:

  • Months 3 to 6: Build two or three real projects. Use AI for code review, explaining libraries and writing tests you then read.
  • After that: Try a coding agent such as Claude Code on your own projects, with the Learning or Explanatory output style on at first. Read every diff before accepting it. Our Claude Code tutorial is a good starting point.
  • When you build something bigger: Our guide to building an app with AI covers choosing a stack and avoiding the common traps.

If you are wondering whether this is all worth it given how fast AI is improving, our evidence-based look at whether AI will replace programmers covers which skills are growing in value.

How to start learning to code with AI today

  1. Pick Python or JavaScript based on the first thing you want to build.
  2. Paste the tutor instructions above into your AI assistant, or turn on a learning mode.
  3. Install the language and an editor, with the AI explaining any error you hit.
  4. Do your first exercise, typing every line yourself.
  5. Ask the AI to quiz you on what you did.
  6. Block out five hours for next week and follow the plan.

Later, when your projects grow into longer tasks for coding agents, Orkio runs agents like Claude Code on an always-on cloud box so they can keep working while you study or sleep. For now, the most valuable thing is the code you write yourself.

Frequently asked questions

Can you really learn to code with ChatGPT or Claude?

Yes, if you use them to explain concepts, review your code and quiz you, and you write most of the code yourself. If you let them write the code and only copy it, you can finish exercises without learning much, which is what Anthropic's 2026 study found for learners who delegated.

What programming language should I learn first with AI?

Python or JavaScript. Both have huge amounts of beginner material, AI models know them very well, and they lead directly to useful projects: Python for scripts, data and automation, JavaScript for websites and web apps. Pick the one that matches the first thing you want to build.

Is it still worth learning to code if AI can write code?

Yes, if you want to build or direct software. AI writes code quickly, but someone has to describe the problem precisely, judge whether the result is correct and safe, and fix it when it is not. Those skills come from understanding code, and they are what make AI coding tools useful instead of risky.

How long does it take to learn to code with AI?

With about five to ten hours a week, most people can build small working programs within two to three months. Becoming job-ready takes much longer and depends on the role. AI shortens the time spent stuck on setup and confusing errors, but it does not remove the practice needed to build skill.

Is using AI for coding homework cheating?

It depends on the course policy. Harvard's CS50, for example, allows its own CS50 Duck tutor but treats other AI tools that suggest or complete answers as academic dishonesty unless the course allows them. Check your course rules, and when in doubt, use AI only for explanations.

SOURCES

  1. Anthropic: How AI assistance impacts the formation of coding skills
  2. Claude Code docs: Output styles
  3. CS50 docs: CS50.ai
  • #learn to code
  • #ai tutor
  • #programming
  • #beginners
Orkio team

The team building Orkio. We write about putting AI to work: coding agents that run overnight, always-on boxes and pull requests ready by morning.

Keep reading

All posts

07:06 · YOU MERGED #128

Go to sleep. Wake up to pull requests.

Start for $19 a month
© 2026 Orkio · Hosted in Europe TürkçeStatus