[KongchangAI]
· 3 min read· 1,663 words

No AI-Written Code: I Built a Rust Coach

No AI-Written Code: I Built a Rust Coach

Claude-based Rust coach rustcoach forces you to write passing code yourself through structured courses and a real sandbox.

rustcoach is a Claude-based AI programming coach for Rust whose core philosophy is teaching, not doing—the coach never gives assignment answers, and code must be written by the learner until cargo test passes. It offers 609 verified real-code questions, five structured courses (Core Rust, Async, Macros, Concurrency, Advanced Types), and a browser sandbox running real cargo/clippy/rustfmt assignments. Each personalized lesson includes quick checks, tiered hints, plain-language error explanations, lint teaching, and line-by-line Trace debugging. Spaced-repetition cards and mastery tracking mean the coach remembers and retests weak spots. Pricing is a one-time pack ($49/50 credits), new accounts get 5 free credits, and the skills test is free.

Pasting a Rust compiler error into an AI chat box, getting back an explanation and working code, watching the build go green—many people have felt that sense of "efficiency." But a week later, when you hit the same borrow checker error, you're back in that chat window asking from scratch.

The problem isn't the quality of the explanation. It's that a chat box is missing a few things: a sequenced syllabus, a persona that remembers where you went wrong last time, and one hard rule—the code must be written by you until it actually passes.

Over on dev.to, a developer shared how he built rustcoach, a Claude-based AI programming coach. Its core thesis is clear: don't let the AI write code for you—use structured teaching to force you to learn it yourself.

First, Measure Your Real Level

Before any course begins, you can take a free Rust skills test with no account required. There are two formats: a comprehensive test covering five domains with 30 questions, taking about ten minutes; and a module test targeting one area—async, macros, concurrency, or the type system—with 20 questions.

Questions go from easy to hard, and most show real Rust code snippets—what does this print, will it compile, which line panics. After each answer, you immediately get the correct answer and the reasoning, so the test itself teaches.

The question bank has 609 questions, 446 of which include Rust code snippets. Every snippet comes with a claim (compiles / fails with a specific error / prints a specific output / panics), and a tool actually compiles and runs each snippet to verify the claim holds. A question claiming "this code prints X" really was run and printed X.

After the test you get a level (Beginner, Intermediate, Advanced, or Expert), a bar chart of your score by domain, your strongest and weakest topics, all missed questions with correct answers, and a recommendation for which module to study next. If you later create an account, you can choose whether to share the test results with the coach—off by default. When enabled, the coach knows which topics you got right and wrong and plans your first lesson accordingly.

About the Rust Borrow Checker: The "borrow checker error" mentioned at the start refers to the static analysis the Rust compiler performs at compile time to enforce ownership rules—every value has exactly one owner, references must always be valid, and you can't have both a mutable and immutable reference at the same time. It lets Rust guarantee memory safety without garbage collection, but because "the compiler speaks bluntly," it's the biggest hurdle for beginners. Typical errors look like cannot borrow x as mutable more than once or value borrowed here after move. Understanding the root cause of these errors matters more than memorizing fixes—which is one reason rustcoach insists on "no ghostwriting your code."

A Sequenced Syllabus, Not Wait-for-Your-Question

A chatbot waits for you to know what to ask. rustcoach provides five courses, each with chapters, topics, and progress tracking:

ModuleChaptersTopics
Core Rust1650
Async & Tokio1251
Macros1150
Concurrency & Atomics1252
Advanced Types & Traits1150

Core Rust starts with variable bindings, ownership, and borrowing, then covers traits, lifetimes, iterators, smart pointers, threads, macros, unsafe, and async. Each deep-dive module opens with a short "fundamentals" chapter; topics you've already covered in Core Rust are automatically marked complete.

Every topic has a mastery score and the coach's notes about you. Correct answers raise the score; wrong answers lower it.

Every Lesson Is Written Live for You

There is no shared "Lesson 7" that everyone takes. The coach first reads its notes about you, retests what you got wrong last time, then teaches a concept with runnable code.

After every two or three explanations, it pauses to check whether you understood: one question, a few options, one click. The right sidebar keeps context visible: mastery for that topic, the coach's notes about you, cards due for review, and your quick-check score for this lesson.

The Key Part: You Write the Code Yourself Until It Passes

This is where real difference happens. Each lesson culminates in an assignment: a real cargo crate with integration tests, where starter code makes the tests fail and a correct solution makes them pass. You write code in the browser, and the tests run real cargo test in a locked-down sandbox (no network, memory and CPU limited, read-only filesystem).

In one lesson, the assignment was a vending machine: restock had to treat a zero quantity as a bug (with assert!), and buy had to treat "not enough money" as an expected failure (returning Err). The starter code had all its tests in the red.

If the first attempt doesn't compile, every rustc error is listed and the relevant lines are highlighted. An "Explain with Coach" feature translates errors into plain language: what went wrong, what to try. But it won't write the fix for you.

Not sure which API to use? The hints feature places a coach note next to each function: which API to use, what pitfalls to avoid—but never the answer.

When the build passes, every run also executes cargo clippy. Each lint shows up in the sidebar as a broom icon with a message, help text, and a link. One author's solution passed all five tests but still received a clippy warning.

The Trace feature can trace function execution within a test, showing each variable's value line by line. For learners who haven't set up a debugger, it's essentially a built-in debugger.

About cargo test and cargo clippy: cargo test is the test runner built into Cargo, Rust's official build tool. It automatically discovers and runs functions annotated with #[test], integration tests under the tests/ directory, and tests in documentation examples, reporting pass/fail statistics. cargo clippy is the official static lint tool, built on compiler plugins, providing hundreds of checks for idioms and potential bugs (like unnecessary clones or simplifiable iterator patterns). Both run the real compiler and official lint rules, not a simulated environment—so the errors learners hit are exactly what they'd see in industrial projects. This is the technical basis for rustcoach's claim that "what you see is the compiler itself."

Code Review: Green Tests Aren't the Finish Line

After submission, the coach reviews your code like a pull request: correctness first, then idiomaticity, style, and understanding. Clippy hints are also passed to the coach, who explains the idiom behind one of them.

A detail about its memory. In the author's case, the coach noted: "This is the second lesson in a row with this lint." It remembered. It also pointed out something the author hadn't deliberately gotten right: every u32 subtraction was on a branch that couldn't underflow.

Accepted assignments can earn an optional stretch challenge—for instance, making the current version more idiomatic. The author tried the obvious approach, and the coach said "no," explained why, and broke the task into steps with different data examples so you couldn't just paste.

This is the core rule: the coach will never write the assignment's solution for you, even if you ask or say you give up. You can ask as many questions as you like and get as many hints, explanations, and examples as you want—but the code you submit is always written by you.

About Spaced Repetition: This is a learning method based on forgetting-curve theory. The core idea is to review right at the threshold of forgetting, maximizing long-term memory efficiency. The classic implementation is the SM-2 algorithm used by tools like Anki. rustcoach uses a simpler fixed review interval sequence (1, 3, 7, 14, 30, 60 days), resetting to the start on a wrong answer. This approach acknowledges that "getting it right once doesn't mean mastery"—coding skill involves not just understanding but also memory retrieval speed, and spaced repetition is the core mechanism for turning short-term coding experience into long-term muscle memory.

Make Knowledge Stick with Spaced Repetition

Writing code once isn't enough. Once a lesson is signed off, the coach writes two review cards for each topic it covered. They come back after 1, 3, 7, 14, 30, and 60 days; a wrong answer resets the card to the start, due again tomorrow.

Every lesson stays in your history, with the coach's summary of what was taught, your performance, what needs review, and the full conversation transcript. Any topic you've studied can be redone. Redoing pauses the current lesson and preserves your editor code, then returns you where you left off.

Developer-Facing Details

If you come from Python, JavaScript, or Java, these details make it feel more like a dev tool than a course:

  • Real toolchain: code goes through cargo test, cargo clippy, and rustfmt; the errors and lints you see are the compiler's own, not simulated.
  • Keyboard-first: ⌘↵ runs tests, ⌘⇧F formats, ⌘⇧↵ submits, ? lists all shortcuts.
  • scratch.rs: a throwaway binary crate next to the assignment for those "wait, what does this actually do?" moments.
  • Explain selected code: select any code (or place the cursor in a function), click Explain, and it's sent to the coach as a question.
  • Weak-spot tracking: each topic keeps a mastery score and coach notes; before teaching new material, the coach retests where you went wrong.
  • Streaks and milestones: they're small, but they work.

Pricing

No subscription. New accounts get 5 free credits, enough for up to 5 lessons, no card required. After that, a lesson pack is a one-time $49 (pre-tax) for 50 credits. For a typical learner who already knows another language, that's enough to cover a full module. Top-ups start at $10. The skills test is free and requires no account.

Test your Rust level for free: rustcoach.dev/test Start learning: rustcoach.dev

#Rust AI coach#rustcoach#learn Rust#Claude AI tutor#spaced repetition coding#cargo test sandbox#Rust borrow checker
Share:

Related articles