Learning to code with AI doesn’t mean letting the AI do the work for you. It means using AI as a thought partner that sharpens your reasoning, uncovers gaps in your understanding, and guides you toward solving problems yourself. When you treat an AI coding agent like a teacher—not an autopilot—you build deeper knowledge, avoid shallow fixes, and gain confidence to tackle new challenges.
Here are four ways to turn your AI assistant into a powerful mentor instead of a shortcut.
1. Make the AI Ask You the Questions
Instead of asking for code immediately, ask the AI to guide you through the problem by asking you questions. For example, if you’re building a dashboard that fetches metrics, prompt the AI to verify your understanding of where the API call should happen, how to handle and error states, and why TypeScript types alone aren’t enough to validate real-world data. This forces you to articulate what you know—and exposes what you don’t—before seeing a single line of code.
2. Demand Progressive Hints, Not Instant Fixes
When you’re stuck on an error, resist the urge to ask for a full solution. Request a sequence of help: first a guiding question, then a conceptual hint, then a minimal example, and only finally the correction—if you still need it. This scaffolding ensures help arrives only when your own attempts have failed, reinforcing problem-solving habits rather than dependency.
3. Analyze Your Flawed Attempts
Share your imperfect code with the AI and ask it to rephrase what your code does, identify what’s correct, highlight the two biggest risks, and pose a question that leads you to the next fix. This turns your mistakes into learning material. You’ll realize, for instance, that fetch
can fail, HTTP errors must be handled, and response.json()
returns unvalidated external data—lessons that stick when you discover them through reflection, not correction.
4. Compare Trade-offs, Don’t Just Accept the First Answer
AI often presents one solution as “the right way.” But real development is about trade-offs. Ask the AI to generate two approaches—like fetching metrics directly in a server page versus through an API route—and compare them based on simplicity, security, caching, testability, and error handling. The goal isn’t to pick the fanciest solution, but to understand why one fits your context better than another.
The key isn’t to avoid AI, but to use it in a way that strengthens your judgment. Over time, your prompts will become sharper, your understanding deeper, and your reliance more intentional. You’ll learn to spot when the AI is steering you right—and when it’s missing the mark.
https://nicolas-dabene.fr/en/blog/using-claude-code-or-codex-as-a-teacher-not-an-autopilot/