# Learn to code with AI: a practical guide for beginners

URL: https://agentvera.dev/en/blog/learn-to-code-with-ai/ · Published: 2026-10-27

Use an AI coding agent as a tutor, not a vending machine: explain-first prompts, learning output styles, plan mode, small projects and habits that build real skill.

**In short:**

- An AI coding agent can be a patient tutor if you ask it to explain before it writes, and to leave the important parts for you to type.
- Claude Code’s Learning output style marks spots with TODO(human) for you to write; plan mode lets you read and question an approach before any file changes.
- Build small projects you care about, read every diff, ask why, and regularly rebuild something without the agent to check what you actually learned.

To learn to code with AI, use the coding agent as a tutor instead of a code vending machine: ask it to explain before it writes, have it leave key parts for you to type, read every change it makes, and ask why until the answer makes sense. Pair that with small projects you actually want, and every so often rebuild something without the agent to see what stuck.

This guide is for people starting from zero or close to it. It assumes you have a terminal and an AI coding agent such as Claude Code, Codex or Gemini CLI (or are about to pick one). If you want to build things quickly and don’t care much about learning the code underneath, [how to vibe code](/en/blog/how-to-vibe-code/ "How to vibe code") is the better read. This post is for when you want the skill to stay with you.

## Why an agent can be a good teacher (and how it can be a bad one)

A [coding agent](/en/glossary/coding-agent/ "What is a coding agent") reads your files, runs commands and edits code in your project. For a learner that is powerful: it can look at *your* code, explain *your* error and show the fix in context, at 2 a.m., without getting tired of the same question.

It can also do all of the work for you. If the agent writes 400 lines and you press accept, you have a program but no new skill. The difference is not the tool; it is how you ask.

| Vending machine use | Tutor use |
| --- | --- |
| “Build me a to-do app.” | “I want to build a to-do app to learn JavaScript. What are the parts, and which should I write first?” |
| Accept every change | Read the diff, ask about each line you don’t understand |
| Paste the error, accept the fix | “Explain what this error means before you fix it. Where did I go wrong?” |
| Next feature, next prompt | Rebuild the feature yourself the next day without help |

## Set the agent up to teach

### Tell it who you are

Agents adjust to context. A short note at the start of a session, or in your project’s instructions file (`CLAUDE.md` for Claude Code, `AGENTS.md` for Codex), changes the tone of everything after it:

```text
I am learning to program. This project is for practice.
- Explain concepts in plain language before showing code.
- Prefer small steps. After each step, stop and let me try it.
- When there is a choice, tell me the options and why you would pick one.
- Do not write more than about 20 lines at a time unless I ask.
- If I make a mistake, give me a hint first, not the answer.
```

### Use a learning output style (Claude Code)

Claude Code has output styles that change how it responds. Two of them are made for learning, as of October 2026:

- **Explanatory** adds short “Insight” notes about why it made implementation choices and what patterns your codebase uses, while still doing the task.
- **Learning** goes further: it shares insights and also leaves small, meaningful pieces for you to write, marked with `TODO(human)` in the code, and waits for you to fill them in.

Switch with `/output-style learning` or through `/config` → Output style, or set it in your settings file:

```json
{
  "outputStyle": "Learning"
}
```

Both styles give longer answers and use more tokens, which is a fair trade while you are learning. Switch back to the default once you are building rather than studying.

Codex and Gemini CLI don’t have the same built-in styles, but the instructions block above gets you most of the way there.

### Use plan mode to read before anything changes

Plan mode lets the agent look at your project and propose an approach without editing files. In Claude Code you enter it with Shift+Tab or `/plan`. For a learner this is a free lesson: you see how an experienced programmer would break the problem down, and you can question each step before a single line is written.

```text
/plan I want to add a feature that saves my to-do list to a file
so it survives a restart. Explain the plan as if I've never worked
with files before. What will change, in which files, and why?
```

Ask follow-up questions on the plan: “Why JSON and not a plain text file?” “What happens if the file doesn’t exist yet?” Then decide whether you write it, the agent writes it, or you split the work. [Claude Code plan mode](/en/blog/claude-code-plan-mode/ "Claude Code plan mode") covers the mechanics in detail.

## Pick small projects you actually want

Tutorials teach syntax; projects teach programming. A good first project is small enough to finish in a few sessions and useful enough that you care whether it works.

| Project | What it teaches |
| --- | --- |
| Command-line to-do list | Variables, lists, loops, reading input, saving to a file |
| Personal web page | HTML structure, CSS layout, deploying a site |
| Quiz or guessing game | Conditions, random numbers, keeping score, game loops |
| Tip or budget calculator | Functions, numbers and rounding, input validation |
| A small bot for a chat app | APIs, tokens and environment variables, events |
| A tiny web API | Routes, JSON, HTTP status codes, testing with curl |

If you want guided versions, [build a website with AI](/en/blog/build-website-with-ai/ "Build a website with AI") and [make a game with AI](/en/blog/make-a-game-with-ai/ "Make a game with AI") walk through two of these end to end.

Start each project by asking the agent for the smallest version that works, then grow it one feature at a time:

```text
I'm building a command-line to-do list in Python to learn.
What is the smallest first version that works? List the steps.
Don't write the code yet. I'll try step 1 myself and show you.
```

## Read every diff

Every change the agent makes shows up as a diff: lines removed in red, lines added in green. Reading diffs is one of the most useful skills you can build, because it is exactly what professional developers do all day in code review.

For each change, ask yourself three questions:

1. What did it change?
2. Why there, and not somewhere else?
3. What would break if I removed this line?

If you can’t answer one of them, ask the agent:

```text
In the change you just made to app.py, explain lines 12 to 20
one at a time. Why did you use a dictionary instead of a list here?
```

`git diff` in the terminal shows the same thing if your tool doesn’t display diffs well. Speaking of which: learn the basic git commands early (`git init`, `git status`, `git add`, `git commit`, `git diff`, `git log`). Commit after every working step. When the agent breaks something, you can always go back, which makes experiments much less scary.

## Ask why, then ask again

The habit that separates learning from copying is asking why. Some questions that work well:

- “Explain this as if I only know variables and loops.”
- “What would a beginner usually get wrong here?”
- “Show me a simpler version, even if it’s less efficient. Then tell me what the better version improves.”
- “What’s the name of this concept, so I can read about it?”
- “Quiz me with three questions about the code we just wrote.”

The last one is surprisingly effective. If you can’t answer the agent’s quiz, you haven’t learned it yet, and now you know exactly what to review.

## Avoid copy-paste dependence

The real danger of learning with AI is feeling productive while learning little. A few rules keep you honest:

- **Type the core yourself.** Let the agent write boilerplate and setup; you write the function that is the point of the exercise.
- **Hints before answers.** When you are stuck, ask for a hint, then a bigger hint, then the answer.
- **Rebuild without help.** A day after finishing a feature, delete it (git keeps a copy) and write it again with the agent closed. What you can’t rebuild, you haven’t learned.
- **Explain it back.** Write a two-line comment above each function in your own words. If you can’t, ask the agent to explain until you can.
- **Read error messages first.** Before pasting an error to the agent, read it and guess what it means. Then compare your guess with the agent’s explanation.

## Debugging is the best teacher

You will learn more from bugs than from features. When something breaks, resist the urge to say “fix it”:

```text
My program crashes with the error below. Don't fix it yet.
1. Explain what the error message means in plain words.
2. Give me a hint about where to look.
3. If I still can't find it, show me how you would track it down.

TypeError: can only concatenate str (not "int") to str
```

After the fix, ask how you could have found it faster next time: printing values, reading the stack trace, running one piece at a time. That is the skill that lasts. [Debugging code with AI](/en/blog/debug-code-with-ai/ "Debug code with AI") goes deeper into this loop.

## Choosing a tool and what it costs

You don’t need the most expensive setup to learn. In general terms, as of October 2026:

- **Claude Code** needs a paid Claude plan (Pro, Max, Team or Enterprise) or API credits; the free Claude plan doesn’t include it. Its Learning and Explanatory output styles make it a strong fit for studying. See [Claude Code pricing](/en/blog/claude-code-pricing/ "Claude Code pricing") for details.
- **Codex** is included with ChatGPT plans, including some lower-cost and free tiers, with usage limits that vary by plan.
- **Gemini CLI** and other agents have their own free and paid options that change often; check the official pricing page before you commit.
- **Local models** run on your own computer at no per-token cost, though they are usually weaker than the large hosted models. [Running a coding agent with a local LLM](/en/blog/local-llm-coding-agent/ "Local LLM coding agent") explains the setup.

Prices and limits change. Pick one tool, learn it well, and switch only when you have a concrete reason.

## Learning with AgentVera

AgentVera is a desktop app for macOS, Windows and Linux that runs Claude Code, Codex, Gemini CLI and other CLI agents in panes side by side. A few of its features are especially handy when you are learning:

- **[Project tour](/en/features/project-tour-and-code-map/ "Project tour and code map"):** open any project and ask for a tour. A read-only Claude Code session explains how the code is organized, and a module graph shows which files depend on which. Useful when you open an example project and don’t know where to start.
- **[Editor and terminal](/en/features/editor-and-terminal/ "Editor and terminal"):** read code in the built-in editor, select a confusing line and press ⌘⇧L to send it to an agent with your question. The Changes tab shows each diff side by side or unified.
- **[Workspace](/en/features/workspace/ "Workspace"):** keep a “tutor” pane in plan mode that only explains, next to a “builder” pane where you and the agent write code. Questions don’t clutter the build session.
- **[Checkpoints](/en/features/checkpoints-and-replay/ "Checkpoints and replay"):** every turn is saved, so you can go back to before an experiment went wrong and try again.
- **[Code review](/en/features/code-review/ "Code review"):** a reviewer model looks at each turn’s changes and points out problems with file and line, which is a second explanation of what could go wrong.

These are on the free plan. To get set up, follow [getting started with AgentVera](/en/blog/getting-started-with-agentvera/ "Getting started with AgentVera") or [download AgentVera](/en/download/ "Download AgentVera") directly.

## A four-week starter plan

If you want structure, here is one way to spend your first month:

1. **Week 1: basics with a tutor.** Pick a language (Python or JavaScript are common first choices). Use the Learning style or the instructions block above. Write tiny programs: greet the user, add numbers, loop over a list. Ask the agent to quiz you at the end of each session.
2. **Week 2: your first project.** Build the command-line to-do list in small steps. Commit after each working step. Read every diff.
3. **Week 3: something visible.** Make a personal web page or a small game. Use plan mode before each feature and question the plan.
4. **Week 4: rebuild and extend.** Rebuild week 2’s project without the agent. Then add one feature you design yourself, using the agent only for hints and review.

Once you are comfortable reading and changing code, [AI pair programming](/en/blog/ai-pair-programming/ "AI pair programming") shows how to work with an agent as a teammate rather than a teacher. And when your projects start handling logins or user data, [finding security vulnerabilities with AI](/en/blog/find-security-vulnerabilities-with-ai/ "Find security vulnerabilities with AI") is a good next step.

## Wrapping up

AI makes learning to code faster only if you stay the one doing the learning. Tell the agent you are a learner, use a learning output style or explain-first instructions, plan before you change anything, and build small projects you care about. Read every diff, ask why, take hints before answers, and prove to yourself what you know by rebuilding it without help. The agent can explain anything you ask; your job is to keep asking.

## Frequently asked questions

**Can I learn to code with AI if I am a complete beginner?** Yes, as long as you use the AI to explain and guide rather than to produce finished programs you don’t read. Start with small projects, ask it to explain each step before writing code, and type the core parts yourself.

**Will using AI stop me from really learning to program?** It can, if you only copy and paste. The risk is in how you use it. Asking why, reading diffs, writing parts yourself and rebuilding small things without help keep the learning in your head instead of in the chat history.

**Which AI coding tool is best for learning?** Any agent that can explain code and work in plan mode will do. Claude Code has Explanatory and Learning output styles made for this. Codex and Gemini CLI work too if you prompt them to teach. Pick one you can afford and stick with it for a while.

**Do I need a paid plan to learn to code with AI?** Not necessarily. As of October 2026 some agents have free tiers with limits, and you can run local models on your own machine. Claude Code itself needs a paid Claude plan or API credits. Check each tool’s current pricing page before you choose.

**What should my first project be?** Something small that you will use yourself: a command-line to-do list, a personal web page, a quiz game, a tip calculator or a simple bot. Small enough to finish in a few sessions, useful enough that you care whether it works.

---

**About AgentVera.** AgentVera is a desktop app for macOS, Windows and Linux, built by Solviera Teknoloji. It runs 18 AI coding agents (Claude Code, Codex, Gemini CLI, Copilot, Cursor, Antigravity, opencode, Hermes, Qwen Code, Kimi Code, Kiro, Amp, Droid, Goose, Vibe, Crush, Aider, Cline) side by side, per project, in real terminals with the user's own CLI installs and logins. The free plan has unlimited agents. Download: https://agentvera.dev/en/download/ · Pricing: https://agentvera.dev/en/pricing/
