Crabrix blog

Learn Rust with AI: Claude, Codex and Cursor with Crabrix Academy

Learn Rust with AI that teaches from real lessons: connect Claude, Claude Code, Codex or Cursor to Crabrix Academy for graded hints, practice and honest progress.

Learn Rust with AI that teaches from a real curriculum

You can learn Rust with AI in two quite different ways. You can ask a chat model to teach you, and it will produce fluent explanations and exercises from memory. Or you can connect the same agent to a curriculum it has to follow: real lessons with stable URLs, exercises with success criteria, graded hints and a compiler you run yourself. Since this week, Claude, Claude Code, Codex, Cursor and other MCP clients can connect to Crabrix Academy and teach from its lessons, while you write the code.

AI stays optional. Every lesson, quick check and compiler lab, and the Playground, work exactly as before without it.

An orange paper crab mentor beside a learner at a desk, pointing at a chat window on a laptop that is linked to a Rust lesson card
Original generated illustration: a crab mentor and a learner at a desk, with the chat window linked to a real Rust lesson card.

Explore in Crabrix: Learn Rust with your AI agent · All Crabrix Academy courses

Why a bare chat makes a weak AI Rust tutor

A general chat model knows a lot of Rust, and that is part of the problem. Ask it for an exercise and it invents one, with no fixed success criterion. Ask for help and it tends to hand over finished code, because a complete answer looks helpful. Ask whether your solution is correct and it may say yes without anything having been compiled. The next day it has no idea which lessons you finished.

An agent connected to a curriculum has fewer ways to drift. It looks the lesson up, links the original and takes the exercise from it. Its hints come from the lesson's own material in a fixed order, the compiler output you discuss is the output you produced, and its review is labelled "AI reviewed", which is not the same as passing. The model is no less fallible, but the facts now live in a source you can check.

What Crabrix Academy MCP gives your agent

Crabrix Academy MCP is a set of read-only tools in Crabrix MCP 0.6.0, the npm package crabrix. They read the public Academy on crabrix.com: 839 lessons, of which 239 are Rust lessons and 600 are Algorithm Atlas steps, plus 46 example projects and 8 learning paths. There is no account, sign-in or API key. The crabrix_academy_* tools find lessons (catalog, search), return a lesson, its exercise and graded hints (get_lesson, get_exercise, get_hint), plan study (learning_path, next), list examples, return Playground links, review an attempt against the lesson's rubric and handle an AI Learning State.

The remote server at https://crabrix.com/mcp/academy speaks Streamable HTTP, needs nothing installed and exposes only the Academy tools, with no access to Playground rooms. The local server, npx -y crabrix@0.6.0 academy, runs the same tools over stdio with Node.js 22 or newer, plus crabrix_academy_import_progress_backup, which reads a backup file from your disk and is never offered over HTTP. Both follow the Crabrix teaching contract, version 1.1.0: real lessons with their URLs, hints before solutions, no claims of completion.

Sources: MCP transports: stdio and Streamable HTTP · Crabrix SDK and MCP server source

Explore in Crabrix: Rust Basics course · Ownership Mastery course

Claude and Claude Code: add the Academy in one step

In Claude on the web, desktop or mobile, open Customize, then Connectors, choose + and then Add custom connector. Name it Crabrix Academy and paste https://crabrix.com/mcp/academy. No sign-in follows. A connector you add on the web is also available in the Claude app on your phone or tablet.

For Claude Code, the command below adds the Academy as a remote MCP server. Alternatively, install the Crabrix plugin, version 0.6.0 or newer, by running /plugin marketplace add sergii-ziborov/crabrix-sdk and then /plugin install crabrix@crabrix inside a session. It adds a local Academy server, the crabrix-learn-rust skill with the teaching rules and the shared Playground tools; an existing installation keeps its handoff skill and rooms. Pick one route, or the agent sees every Academy tool twice.

claude mcp add --transport http crabrix-academy https://crabrix.com/mcp/academy

Sources: Connect Claude Code to tools via MCP

Codex, Cursor and other clients: one Rust MCP server URL

Codex takes the same URL: codex mcp add crabrix-academy --url https://crabrix.com/mcp/academy. To run the Academy on your own computer instead, register codex mcp add crabrix-academy -- npx -y crabrix@0.6.0 academy, which needs Node.js 22 or newer. If you already have a crabrix server registered for Playground rooms, it stays as it is; the Academy entry is separate.

Cursor reads MCP servers from ~/.cursor/mcp.json. Add the entry below and restart Cursor. Any other client that supports remote MCP servers over Streamable HTTP without authentication can use the same URL, and clients that only run local servers can start the same read-only tools with npx -y crabrix@0.6.0 academy. To test a setup, ask the agent to list the Crabrix Academy courses: a working connection answers from crabrix_academy_catalog, not from memory.

{
  "mcpServers": {
    "crabrix-academy": {
      "url": "https://crabrix.com/mcp/academy"
    }
  }
}

Sources: Codex: Model Context Protocol · Cursor: Model Context Protocol

Four prompts to start a Rust session

The Learn with AI page offers four plain-text prompts that work in any connected client. For a beginner: "Teach me Rust through Crabrix Academy. Start from the basics, give me practical exercises, and help me understand each concept before moving on." For a Node.js developer: "I am experienced with Node.js and TypeScript. Teach me Rust through Crabrix Academy using concepts familiar to backend developers. Give me practical exercises and use the Crabrix Playground when appropriate."

For a C developer: "I have experience with C. Teach me Rust through memory management, ownership, borrowing, lifetimes and system programming. Use Crabrix Academy lessons and practical examples." And to pick up where you stopped: "Help me continue my Crabrix Rust learning using my available progress and previous exercises. Do not assume I have completed lessons unless the learning state confirms it." The last sentence stops the agent guessing your history.

Every lesson page also has a Learn this lesson with AI prompt with the lesson's IDs, link, goal and practice option, which asks for hints before any solution and nothing marked as passed. Clients with MCP prompt support also get learn_rust_with_crabrix (background and mode) and continue_crabrix_learning.

Explore in Crabrix: The four prompts on Learn with AI · What Rust Is · Rust for Node.js Developers · Rust for C Developers

Teaching modes: guided, Socratic, pair programming and review

You choose how the agent teaches, and it switches only when you ask. Guided is the default: the agent explains one idea at a time, asks a short question, gives the lesson's exercise and helps step by step. In Socratic mode the agent asks questions that lead you to the answer and explains only after you have tried. It suits borrowing, where the rule clicks once you have predicted the compiler's objection.

Review mode starts from your solution: the agent reads it, points to concrete issues, explains why they matter and suggests the next lesson. Pair programming means editing code together in a Crabrix Playground, and only in a room you share with the agent or ask it to create. The Academy server has no room tools, so pairing needs the regular Crabrix MCP server, included in the Claude Code plugin, or an agent link from Connect AI. For most learning, guided or Socratic mode is enough.

Explore in Crabrix: Connect AI to a shared Playground

Graded hints from 1 to 5, and why the solution needs an explicit ask

When you are stuck, the agent calls crabrix_academy_get_hint one level at a time, and every level is built from the lesson's own material. Level 1, direction, repeats the lesson's rule and its first trace step. Level 2, concept, gives the opening of the lesson's explanation. Level 3, structure, lists the trace steps in order. Level 4, the detailed hint, names the common misconception, its correction and the lesson's feedback, and adds the transfer challenge. Level 5 is solution material: the lesson's worked example or, for an Algorithm Atlas step, the expected answer and the Rust sketch.

Level 5 sits behind a flag. A request without revealSolution: true returns no material, only a note telling the agent to ask whether you want it and otherwise to offer level 4. The teaching contract allows the flag only after you explicitly ask for the solution. Reading a correct program teaches far less than producing one, and being stuck for a while is where much of the learning happens. Even level 5 is labelled honestly: a worked example shows the rule but is not the graded answer, and the app's grading harnesses are private.

Diagram of the teaching loop: LESSON, HINT, YOUR CODE, AI REVIEW and APP CHECK cards joined by arrows, with a return arrow to the lesson
Original generated diagram: the teaching loop runs from lesson and hint to your code and an AI review; only the app check records progress.

An example session: the Borrowing lesson and E0502

A shortened, illustrative session in Claude Code, Guided mode. The lesson text, task, hint and compiler message are real; the agent's wording is typical, not recorded.

You: I write TypeScript for a living. Teach me borrowing, and do not give me the answer. Agent [crabrix_academy_search, then crabrix_academy_get_lesson with view teaching]: This is Borrowing in Ownership Mastery, at crabrix.com/learn/ownership/borrowing/. Its rule: "Many shared borrows or one mutable borrow, never both at once." In TypeScript any reference to an array can push to it; Rust allows many readers, but a writer needs exclusive access. Why could push be dangerous while something points at element 0?

You: Because the vector may move to a bigger buffer, and the old reference would point at freed memory? Agent [crabrix_academy_get_exercise, crabrix_academy_open_playground]: Yes, close to the lesson's recall answer. The task: "Repair E0502 with the smallest edit that keeps the push and the printed value." The starter takes let first = &items[0];, pushes "compiler", then prints first. The Playground link opens a practice copy of the lesson's example; put the starter in main and press Run.

You: Run says error[E0502]: cannot borrow items as mutable because it is also borrowed as immutable. A hint, please, not the fix. Agent [crabrix_academy_get_hint, level 1]: From the lesson: first borrows items at let first = &items[0];, and that shared borrow stays active until println!("{first}");, its last use. Where is that last use compared with the push?

You: After it. I moved the println! above the push and Run printed crab. Agent [crabrix_academy_review_attempt with ran: "yes"]: That is the minimal change the lesson describes: the shared borrow ends at its last use, before the mutable one starts, with no clone. Status: compiled_by_learner, not a pass; finish the lesson in the Crabrix app to record it. Next in the course is Slices.

Below is the learner's version, with an extra line showing the push happened. With rustc 1.99.0 and --edition 2024 it printed crab, then 3 items: ["crab", "rust", "compiler"]; it also builds for wasm32-wasip1. The starter fails with exactly the E0502 message above, and rustc marks the println! with "immutable borrow later used here". The agent never wrote the fix, invented an exercise or called the lesson complete.

fn main() {
    let mut items = vec!["crab", "rust"];
    let first = &items[0];
    println!("{first}"); // last use of the shared borrow
    items.push("compiler"); // the mutable borrow starts here, after it
    println!("{} items: {items:?}", items.len());
}

Sources: The Rust Book: references and borrowing · Rust error code E0502

Explore in Crabrix: Borrowing lesson · Slices, the next lesson

Practise in the Playground: practice copies, Example copies and no rooms

crabrix_academy_open_playground returns a link such as /playground/?lesson=ownership/borrowing, and its kind says what opens. Besides a lesson's own project (lesson-project) and Atlas inputs (algorithm-trace), 190 lessons gained a practice-copy this week: the lesson's practice code or worked example, unchanged, placed inside a program when it is a fragment. All 190 were checked with rustc for wasm32-wasip1 and then in the browser Playground. 189 compile; Why Borrowing Works is a fix-me exercise whose copy deliberately does not, and its notice says so.

/playground/?example=<id> likewise opens a copy of any of the 46 example projects. Every copy is a new, unsaved document that never overwrites your saved drafts or changes the original. A copy is served only while the lesson's code matches the checked version, so an edited lesson never opens a stale starter.

Opening a link never creates a shared room, deliberately. A room is a capability: whoever holds its link can read the source, and an agent link lets an agent edit it. That should be your decision, not a side effect of practice. You open the link in your own browser, and Run and Debug happen on your device. To bring the agent into the editor, share the Playground yourself.

Explore in Crabrix: Open the Playground · Why Borrowing Works, the fix-me exercise · Variables, a lesson with a practice copy

Honest progress: AI reviewed is not passed

Crabrix separates what an agent may say from what counts as progress. Only the Crabrix app's own checks record a lesson as completed: a quick check answered, a compiled lab whose private tests pass, or a borrow exercise the compiler accepts with the expected output. The agent cannot write progress anywhere, and the tools never return "verified" or "passed".

crabrix_academy_review_attempt takes what you report (compiled, ran, output matched, app check) and returns the lesson's rubric with one of three statuses. compiled_by_learner: you said it compiled or ran, and the agent reviewed it. ai_reviewed: reviewed, with no compiler result reported. not_verified: it does not compile yet, so the first error comes first. If you report that the app check passed, the tool replies that the record lives in Crabrix and it cannot confirm it. Source code never goes to this tool.

The teaching contract also asks agents to separate three things in every answer: what the compiler or a run actually printed, what you told them, and what they reasoned. The habit is worth copying: if an agent says your loop is correct, ask whether anything was compiled.

Continue later with an AI Learning State

Unless you connect your progress in the app (see the next section), nothing is synchronised between the app, the website and your agent, so a new session knows only what you give it. You can name the lesson you are on, or paste an AI Learning State: a JSON file, crabrix-learning-state.json, that you own. It holds your path, mode, current lesson, a summary, concepts to review, evidence of what was discussed, compiled, run or AI reviewed, and optionally a copy of the lessons the app recorded.

In Crabrix 1.2 the app can export it from Learn, Learn with your AI agent, in the Continue learning section. Completed lessons are included only after you switch on Include my completed lessons; the export holds lesson IDs, not answers, code or projects, and it never changes your progress in the app. Copy prompt puts the state under the Continue learning prompt; Share file sends the JSON. On a computer, the local server can read a .crabrixprogress backup file you name, without uploading it.

Agents write only the context and evidence; officialProgress, the copy from the app or a backup, stays as received. States combine only through crabrix_academy_learning_state with action: "merge", which only adds official lessons, so an older or partial file cannot remove one. With the local 0.6.0 server, merging an older export holding one completed lesson with the newer state below, whose officialProgress is null, kept that lesson, took the newer summary and added borrowing to the concepts to review beside shadowing. The file never holds code, links, keys or passwords.

{
  "format": "crabrix.ai-learning-state",
  "schemaVersion": 1,
  "updatedAt": "2026-11-24T19:40:00Z",
  "producer": "claude-code",
  "learningPath": "rust-for-nodejs",
  "teachingMode": "guided",
  "currentLesson": { "courseId": "ownership", "lessonId": "borrowing" },
  "learner": { "background": "nodejs", "goal": "Write backend services in Rust" },
  "aiSession": {
    "lastSummary": "Fixed E0502 by ending the shared borrow before push.",
    "suggestedNextLesson": { "courseId": "ownership", "lessonId": "slices" },
    "conceptsNeedingReview": ["borrowing"]
  },
  "officialProgress": null,
  "evidence": [
    { "courseId": "ownership", "lessonId": "borrowing", "kind": "ran_by_learner", "at": "2026-11-24T19:35:00Z" }
  ]
}

Learning Rust on a phone only

A computer is not required. Add the connector once in Claude, on the web or in the mobile app, and use it from the Claude app. Without a connector, a copied lesson prompt still gives any AI app the lesson's link and goal, but the agent cannot fetch the lesson itself. In the next app version, Crabrix 1.2, the Learn tab gains a Learn with your AI agent entry with setup steps for each client and the prompts, and lessons gain a Learn this lesson with AI button marked with a sparkle. Its prompt holds only the lesson's public details, ready to copy into your AI app.

To continue across days, paste the state exported from the app with the Continue learning prompt and, at the end, ask the agent for the updated JSON. Keep it in your notes for next time; the app does not import it, and nothing an agent writes reaches your progress. Crabrix 1.2 also adds Connect my progress: the app creates a personal connector URL and uploads an encrypted copy of your completed lesson IDs, so your agent can read your real progress with crabrix_my_progress and send lessons that appear at the top of Learn as From your AI tutor. The key exists only on your device and in that URL, the website stores ciphertext, the agent cannot complete a lesson, and Disconnect deletes everything; until you connect, the screen sends nothing. Lessons that reached the website first, such as the bridge courses, open at their URLs until 1.2 arrives.

An orange paper crab on a train seat holding a phone, between a lesson app screen and a chat screen exchanging small JSON cards
Original generated illustration: learning on a phone alone, with a learning state copied from the app into a chat and an updated copy kept for later.

Privacy: what the Academy server sees and what it does not

The Academy server answers requests for public lessons, exercises, hints, examples and paths. It has no accounts and holds no user data. It does not see your Playground code, which runs on your device, your app progress or your rooms; the remote endpoint has no room access.

With the remote server, the arguments the agent sends, such as a search query, lesson IDs you finished or a learning state to validate, reach the Crabrix MCP process to compute the reply and are not stored. With the local server they stay on your computer, and only requests for public lesson data go to crabrix.com. Returned links carry via=ai, so the website can count agent visits in daily totals; it is not an identifier, and the counter stores no cookie, IP address, lesson ID or code.

The largest data flow is the one you control: whatever you paste into a chat goes to your AI provider under its own terms. Paste the exercise and your attempt, not credentials or a private project. The contract also tells agents not to ask for passwords, tokens or room links unless you want to pair.

Eight learning paths over the same lessons

A learning path is another order through existing lessons, not a separate course, and a lesson you finished anywhere counts on every path that contains it. Rust from Zero has 52 steps for people new to Rust or to compiled languages. Rust for Node.js Developers, 47 steps, and Rust for C Developers, 45, start with the bridge courses, 20 lessons each, which put your current habits next to Rust and credit the Academy lessons they cover. Rust for Experienced Programmers, 28 steps, skips the syntax tour.

Rust Backend Development, 27 steps, covers errors with context, CLIs, HTTP, SQL and async backpressure. Async Rust, 16, covers futures, cancellation safety and graceful shutdown. Systems Programming, 22, covers macros, unsafe Rust, FFI, layout and WebAssembly. Rust Interview Preparation, 52, gathers the interview topics.

To start, open the Learn with AI page, add the connector for your client and paste a prompt. Read the lesson the agent links, write the code yourself, ask for hints one level at a time and finish the lesson in the app when you want it recorded.

Explore in Crabrix: From mutation to borrowing, for Node.js developers · From pointers to references, for C developers · Concurrency and Async course · Set up your agent

Explore the free Crabrix lessons →